I create my JAR myself same with "android.test.runner" or "com.android.im.plugin" Briefly speaking, I add line "include $(BUILD_JAVA_LIBRARY" in Android.mk under directory "com.example.base" to create com.example.base.jar, Then I modify framework/base/data/etc/platform.xml to include my jar in system.img. My example application can use the <uses-library android:name=com.example.base> method to call the method in "com.example.base".
Any clues? Thanks, Jove. On Mar 26, 10:22 am, Jove <jove.c...@gmail.com> wrote: > I create my JAR myself same with "android.test.runner" or > "com.android.im.plugin" > Briefly speaking, I add line "include $(BUILD_JAVA_LIBRARY" in my > "com.example.base" to create com.example.base.jar, Then I modify > framework/base/data/etc/platform.xml to include my jar in system.img. > My example application can use the <uses-library> method to call the > method in "com.example.base". > > Any clues? > Thanks, > Jove. > > On Mar 26, 2:14 am, Mark Murphy <mmur...@commonsware.com> wrote: > > > Jove wrote: > > > Hi guys, > > > I meet an issue. > > > I have two services, both of them lies in separate apk, which run > > > in same process. The two service share same jar file by <uses-library> > > > method. The jar file implement a class, say "test", is a singleton. > > > But I found that two instance of test is created under this case, > > > could anybody give me some tips? I want to ensure it's singleton. > > > If you can explain a bit about how you are using <uses-library> for your > > own JAR files, I might be able to figure out why you are getting two > > instances. I have not seen much use of <uses-library> outside of the > > Google Maps situation. How are you using it in your application? > > > -- > > Mark Murphy (a Commons Guy)http://commonsware.com > > Android App Developer Training:http://commonsware.com/training.html --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---