Skip to content

Commit acd9082

Browse files
committed
fixes for service_only
1 parent 6ca419e commit acd9082

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

pythonforandroid/bootstraps/common/build/build.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,9 +297,12 @@ def make_package(args):
297297
# Add extra environment variable file into tar-able directory:
298298
env_vars_tarpath = tempfile.mkdtemp(prefix="p4a-extra-env-")
299299
with open(os.path.join(env_vars_tarpath, "p4a_env_vars.txt"), "w") as f:
300-
f.write("P4A_IS_WINDOWED=" + str(args.window) + "\n")
301-
if hasattr(args, "orientation"):
302-
f.write("P4A_ORIENTATION=" + str(args.orientation) + "\n")
300+
try:
301+
f.write("P4A_IS_WINDOWED=" + str(args.window) + "\n")
302+
if hasattr(args, "orientation"):
303+
f.write("P4A_ORIENTATION=" + str(args.orientation) + "\n")
304+
except Exception as e:
305+
print ('kivy is not in the requirements')
303306
f.write("P4A_NUMERIC_VERSION=" + str(args.numeric_version) + "\n")
304307
f.write("P4A_MINSDK=" + str(args.min_sdk_version) + "\n")
305308

pythonforandroid/bootstraps/service_only/build/templates/Service.tmpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class Service{{ name|capitalize }} extends PythonService {
1717
* {@inheritDoc}
1818
*/
1919
@Override
20-
public int getStartType() {
20+
public int startType() {
2121
return START_STICKY;
2222
}
2323
{% endif %}

pythonforandroid/recipes/android/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def prebuild_arch(self, arch):
4040

4141
is_sdl2 = bootstrap_name in ('sdl2', 'sdl2python3', 'sdl2_gradle')
4242
is_pygame = bootstrap_name in ('pygame',)
43-
is_webview = bootstrap_name in ('webview',)
43+
is_webview = bootstrap_name in ('webview','service_only',)
4444

4545
if is_sdl2 or is_webview:
4646
if is_sdl2:

testapps/setup_testapp_service.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
'blacklist-requirements': 'openssl,sqlite3',
88
'android-api': 27,
99
'ndk-api': 21,
10-
'ndk-dir': '/home/asandy/android/crystax-ndk-10.3.2',
10+
'sdk-dir':'/opt/android/android-sdk/',
11+
'ndk-dir':'/opt/android/android-ndk-r17c/',
1112
'dist-name': 'testapp_service',
1213
'ndk-version': '10.3.2',
1314
'bootstrap': 'service_only',

0 commit comments

Comments
 (0)