I need to load a .so library in my Service onCreate method, but the process just down after System.load. On the other hand, the same code can work in Activity. Are there some differences between activity and service in the way of load .so file.
My codeļ¼ class AisoundService extends Service{ @Override public void onCreate() { Log.d(TAG, "============> TestService.onCreate"); String libFile = "/data/nativelib/libAisound4.so"; Log.d(TAG, "Trying to load "+libFile); System.load(libFile); Log.d(TAG, "Load "+libFile+" Succes"); } } This is Logcat record: 04-01 07:57:25.761: DEBUG/AisoundService(26726): ============> TestService.onCreate 04-01 07:57:25.771: DEBUG/AisoundService(26726): Trying to load /data/ nativelib/libAisound4.so 04-01 07:57:25.771: DEBUG/dalvikvm(26726): Trying to load lib /data/ nativelib/libAisound4.so 0x42fc5230 04-01 07:57:25.781: DEBUG/dalvikvm(26726): Added shared lib /data/ nativelib/libAisound4.so 0x42fc5230 04-01 07:57:25.901: INFO/DEBUG(26719): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 04-01 07:57:25.901: INFO/DEBUG(26719): Build fingerprint: 'tmobile/ kila/dream/trout:1.1/PLAT-RC33/126986:user/ota-rel-keys,release-keys' 04-01 07:57:25.901: INFO/DEBUG(26719): pid: 26726, tid: 26726 >>> com.iflytek.service <<< 04-01 07:57:25.901: INFO/DEBUG(26719): signal 11 (SIGSEGV), fault addr 00000018 04-01 07:57:25.901: INFO/DEBUG(26719): r0 00000000 r1 ad0665f0 r2 fffee5cc r3 c33578a5 04-01 07:57:25.901: INFO/DEBUG(26719): r4 802cc814 r5 ad07edf8 r6 00000000 r7 802cc7e0 Thanks for any help! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---