@@ -39,8 +39,10 @@ public int onStartCommand(Intent intent, int flags, int startId) {
3939 Log .v ("python service" , "service exists, do not start again" );
4040 return START_NOT_STICKY ;
4141 }
42+
4243 Bundle extras = intent .getExtras ();
4344 androidPrivate = extras .getString ("androidPrivate" );
45+ // service code is located in service subdir
4446 androidArgument = extras .getString ("androidArgument" ) + "/service" ;
4547 pythonHome = extras .getString ("pythonHome" );
4648 pythonPath = extras .getString ("pythonPath" );
@@ -73,6 +75,8 @@ public void onDestroy() {
7375
7476 @ Override
7577 public void run (){
78+
79+ // libraries loading, the same way PythonActivity.run() do
7680 System .loadLibrary ("sdl" );
7781 System .loadLibrary ("sdl_image" );
7882 System .loadLibrary ("sdl_ttf" );
@@ -85,15 +89,15 @@ public void run(){
8589 System .load (getFilesDir () + "/lib/python2.7/lib-dynload/unicodedata.so" );
8690
8791 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" );
9094 } catch (UnsatisfiedLinkError e ) {
9195 }
9296
9397 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" );
97101 } catch (UnsatisfiedLinkError e ) {
98102 }
99103
0 commit comments