ae.kivy_sideloading
kivy mixin and widgets to integrate a sideloading server in your app
this namespace portion provides widgets and a mixin class for your main app instance to easily integrate and control
the ae sideloading server into your main app.
kivy sideloading integration into your main app class
add the SideloadingMainAppMixin mixin provided by this ae namespace portion to your main app class:
class MyMainAppClass(SideloadingMainAppMixin, KivyMainApp):
the sub-app of the sideloading server will then automatically be instantiated when your app starts and will initialize
the sideloading_app attribute with this sub-app instance.
Hint
if you prefer to instantiate the sideloading server sub-app manually, then specify SideloadingMainAppMixin
after KivyMainApp in the declaration of your main app class.
adding sideloading_active to the :ref:`app state variables of your app’s config files will ensure that the running status of the sideloading server gets automatically stored persistent on pause or stop of the app for the next app start.
the running status of the sideloading server will be restored in the app start event handler method
(on_app_run()).
to manually start it offering the APK of the embedding app, call the
on_sideloading_server_start() method passing an empty string and dict:
self.on_sideloading_server_start("", {})
Hint
when you pass the dict with a number in a ‘port’ key, then it will be used as the server listening port.
if no ‘port’ gets specified, then SideloadingMainAppMixin will calculate an individual port number from the
first character of the app_name of the app mixing in this class. this is to prevent
the server socket error [Errno 98] Address already in use if two different applications with sideloading are
running on the same device and want to offer sideloading.
to manually pause the sideloading server, call the
on_sideloading_server_stop() method passing an empty string and dict:
self.on_sideloading_server_stop("", {})
dependencies/requirements in buildozer.spec
to build an Android APK with the kivy sideloading server integrated, make sure that the following external packages are specified in the requirements setting of the [app] section of your buildozer.spec file.
ae.kivy_file_chooser
ae.kivy_iterable_displayer
ae.kivy_qr_displayer
ae.kivy_sideloading
ae.sideloading_server
kivy_garden.qrcode
qrcode
typing_extensions
additionally, the following packages and ae namespace portions required by the above packages have to be included:
typing_extensions, qrcode, kivy_garden.qrcode,
ae.base, ae.files, ae.paths, ae.deep, ae.dynamicod, ae.i18n,
ae.updater, ae.core, ae.literal, ae.console, ae.parse_date, ae.gui,
ae.kivy_auto_width, ae.kivy_dyn_chi, ae.kivy_relief_canvas, ae.kivy, ae.kivy_user_prefs, ae.kivy_glsl,
ae.kivy_file_chooser, ae.sideloading_server, ae.kivy_sideloading,
ae.kivy_iterable_displayer, ae.kivy_qr_displayer
sideloading server life cycle
to activate the sideloading server to offer a different file, specify the path (or glob file mask) of the file to be
offered/available via sideloading in the sideloading_file_mask attribute and then call
the method on_sideloading_server_start(). this method will check if the specified file
exists, and if yes, then it will start the sideloading server. if you specify a file mask instead of a concrete
file path, then this method will check if there exists exactly one file matching the file mask.
after the start of the sideloading server, the sideloading_file_ext attribute will
contain the file extension of the file available via sideloading.
the sideloading server will automatically be shut down on quit/close of the embedding app. you can alternatively stop
the sideloading server manually at any time by calling the on_sideloading_server_stop()
method.
Classes
mixin class with default methods for the main app class. |
|
|
dropdown menu to control sideloading server. |
|
user preferences menu tour. |
- class SideloadingMenuPopup(**kwargs)[source]
Bases:
FlowDropDowndropdown menu to control sideloading server.
- class SideloadingMenuTour(main_app)[source]
Bases:
TourDropdownFromButtonuser preferences menu tour.
- class SideloadingMainAppMixin[source]
Bases:
objectmixin class with default methods for the main app class.
- sideloading_app: SideloadingServerApp
http sideloading server console app
- on_app_state_version_upgrade(from_version)[source]
upgrade app state config vars from the specified app state version to the next one.
- on_app_started()[source]
initialize and start shaders after kivy app, window and widget root got initialized.
- on_debug_level_change(level_name, _event_kwargs)[source]
debug level app state change flow change confirmation event handler.
- on_file_chooser_submit(file_path, chooser_popup)[source]
event callback from FileChooserPopup.on_submit() on selection of a file.