@@ -39,8 +39,10 @@ public int onStartCommand(Intent intent, int flags, int startId) {
39
39
Log .v ("python service" , "service exists, do not start again" );
40
40
return START_NOT_STICKY ;
41
41
}
42
+
42
43
Bundle extras = intent .getExtras ();
43
44
androidPrivate = extras .getString ("androidPrivate" );
45
+ // service code is located in service subdir
44
46
androidArgument = extras .getString ("androidArgument" ) + "/service" ;
45
47
pythonHome = extras .getString ("pythonHome" );
46
48
pythonPath = extras .getString ("pythonPath" );
@@ -73,6 +75,8 @@ public void onDestroy() {
73
75
74
76
@ Override
75
77
public void run (){
78
+
79
+ // libraries loading, the same way PythonActivity.run() do
76
80
System .loadLibrary ("sdl" );
77
81
System .loadLibrary ("sdl_image" );
78
82
System .loadLibrary ("sdl_ttf" );
@@ -85,15 +89,15 @@ public void run(){
85
89
System .load (getFilesDir () + "/lib/python2.7/lib-dynload/unicodedata.so" );
86
90
87
91
try {
88
- System .loadLibrary ("sqlite3" );
89
- System .load (getFilesDir () + "/lib/python2.7/lib-dynload/_sqlite3.so" );
92
+ System .loadLibrary ("sqlite3" );
93
+ System .load (getFilesDir () + "/lib/python2.7/lib-dynload/_sqlite3.so" );
90
94
} catch (UnsatisfiedLinkError e ) {
91
95
}
92
96
93
97
try {
94
- System .load (getFilesDir () + "/lib/python2.7/lib-dynload/_imaging.so" );
95
- System .load (getFilesDir () + "/lib/python2.7/lib-dynload/_imagingft.so" );
96
- System .load (getFilesDir () + "/lib/python2.7/lib-dynload/_imagingmath.so" );
98
+ System .load (getFilesDir () + "/lib/python2.7/lib-dynload/_imaging.so" );
99
+ System .load (getFilesDir () + "/lib/python2.7/lib-dynload/_imagingft.so" );
100
+ System .load (getFilesDir () + "/lib/python2.7/lib-dynload/_imagingmath.so" );
97
101
} catch (UnsatisfiedLinkError e ) {
98
102
}
99
103
0 commit comments