Skip to content

Home app functionality #2761

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/source/buildoptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ options (this list may not be exhaustive):
- ``--icon``: A path to the png file to use as the application icon.
- ``--permission``: A permission that needs to be declared into the App ``AndroidManifest.xml``.
For multiple permissions, add multiple ``--permission`` arguments.
``--home-app`` Gives you the option to set your application as a home app (launcher) on your Android device.

.. Note ::
``--permission`` accepts the following syntaxes:
Expand Down
2 changes: 2 additions & 0 deletions pythonforandroid/bootstraps/common/build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,8 @@ def create_argument_parser():
ap.add_argument('--launcher', dest='launcher', action='store_true',
help=('Provide this argument to build a multi-app '
'launcher, rather than a single app.'))
ap.add_argument('--home-app', dest='home_app', action='store_true', default=False,
help=('Turn your application into a home app (launcher)'))
ap.add_argument('--permission', dest='permissions', action='append', default=[],
help='The permissions to give this app.', nargs='+')
ap.add_argument('--meta-data', dest='meta_data', action='append', default=[],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,22 @@
{% endif %}
>

{% if args.launcher %}
<intent-filter>
{% if args.launcher %}
<action android:name="org.kivy.LAUNCH" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="{{ url_scheme }}" />
</intent-filter>
{% else %}
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
{% endif %}

{% if args.home_app %}
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
{% endif %}
</intent-filter>

{%- if args.intent_filters -%}
{{- args.intent_filters -}}
{%- endif -%}
Expand Down