@@ -89,6 +89,10 @@ def get_bootstrap_name():
8989 join (curdir , 'templates' )))
9090
9191
92+ DEFAULT_PYTHON_ACTIVITY_JAVA_CLASS = 'org.kivy.android.PythonActivity'
93+ DEFAULT_PYTHON_SERVICE_JAVA_CLASS = 'org.kivy.android.PythonService'
94+
95+
9296def ensure_dir (path ):
9397 if not exists (path ):
9498 makedirs (path )
@@ -430,6 +434,7 @@ def make_package(args):
430434 service = True
431435
432436 service_names = []
437+ base_service_class = args .service_class_name .split ('.' )[- 1 ]
433438 for sid , spec in enumerate (args .services ):
434439 spec = spec .split (':' )
435440 name = spec [0 ]
@@ -454,6 +459,7 @@ def make_package(args):
454459 foreground = foreground ,
455460 sticky = sticky ,
456461 service_id = sid + 1 ,
462+ base_service_class = base_service_class ,
457463 )
458464
459465 # Find the SDK directory and target API
@@ -701,7 +707,7 @@ def parse_args_and_make_package(args=None):
701707 'activity-element.html' ))
702708
703709 ap .add_argument ('--android-entrypoint' , dest = 'android_entrypoint' ,
704- default = 'org.kivy.android.PythonActivity' ,
710+ default = DEFAULT_PYTHON_ACTIVITY_JAVA_CLASS ,
705711 help = 'Defines which java class will be used for startup, usually a subclass of PythonActivity' )
706712 ap .add_argument ('--android-apptheme' , dest = 'android_apptheme' ,
707713 default = '@android:style/Theme.NoTitleBar' ,
@@ -800,9 +806,16 @@ def parse_args_and_make_package(args=None):
800806 ap .add_argument ('--extra-manifest-xml' , default = '' ,
801807 help = ('Extra xml to write directly inside the <manifest> element of'
802808 'AndroidManifest.xml' ))
809+ ap .add_argument ('--extra-manifest-application-arguments' , default = '' ,
810+ help = 'Extra arguments to be added to the <manifest><application> tag of'
811+ 'AndroidManifest.xml' )
803812 ap .add_argument ('--manifest-placeholders' , dest = 'manifest_placeholders' ,
804813 default = '[:]' , help = ('Inject build variables into the manifest '
805814 'via the manifestPlaceholders property' ))
815+ ap .add_argument ('--service-class-name' , dest = 'service_class_name' , default = DEFAULT_PYTHON_SERVICE_JAVA_CLASS ,
816+ help = 'Use that parameter if you need to implement your own PythonServive Java class' )
817+ ap .add_argument ('--activity-class-name' , dest = 'activity_class_name' , default = DEFAULT_PYTHON_ACTIVITY_JAVA_CLASS ,
818+ help = 'The full java class name of the main activity' )
806819
807820 # Put together arguments, and add those from .p4a config file:
808821 if args is None :
@@ -822,6 +835,7 @@ def _read_configuration():
822835 _read_configuration ()
823836
824837 args = ap .parse_args (args )
838+
825839 args .ignore_path = []
826840
827841 if args .name and args .name [0 ] == '"' and args .name [- 1 ] == '"' :
0 commit comments