On Sat, Nov 13, 2010 at 11:03 AM, Premier <a.grum...@gmail.com> wrote: > in Android Market exists Apps category named "Software library", what > is it? is it an apk in which i can put my application common code and > use it in other apps?
As far as the Android Market is concerned, it is a label. Frankly, I'm not sure why it is there. > For example i create software library to parse xml from my server, i > called this software library "common.apk". > Now i want to create an application with UI that uses code from > common.apk, how i can do solve this? First, you should seriously think about this strategy. There is no dependency system in Android. If users download the "application with UI" without downloading "common.apk", your "application with UI" will not work. You will need to have a framework for detecting this case and arranging to have the user download and install "common.apk", and the user may or may not like this. IMHO, while there are scenarios in which this strategy is justified, perhaps even a good idea, a "software library to parse xml from my server" would not seem to qualify. All that being said, you can implement a service in "common.apk", perhaps with an AIDL-defined remote interface, and have "application with UI" use it. > I want to create a separate application modules (UI and logic) so i > can create several applications with different UI but same core. That sounds like a better fit for an Android library project, or perhaps a simple JAR. > I > can't put common code in jar because i'd like to update common.apk to > upgrade all applications that are using it. Harming the user experience (forcing users to download multiple APKs) would seem to be a rather high cost to pay simply to ease your update process, especially when you may be making your update process worse. Please understand that you are creating for yourself the possibility of "dependency hell": -- What if the user elects not to update your "common.apk", but does update "application with UI"? -- What if you need to change the API exposed by "common.apk"? Now either you have to work out the mechanisms in "common.apk" to support both APIs, or you and your users are in for some serious pain. -- What if the user uninstalls "common.apk"? -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android Training in London: http://bit.ly/smand1 and http://bit.ly/smand2 -- 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