On Thu, Oct 1, 2009 at 10:57 PM, Lawrence <[email protected]> wrote: > > I could be wrong here but I think there is something that should be > pointed out about the "added libraries" situation. I also had this > problem: Failure [INSTALL_FAILED_MISSING_SHARED_LIBRARY] and the > threads in this email assisted in solving the problem. > > The "situation" I want to point out is that when building a "standard" > java application in eclipse we include the libraries necessary for the > application to run. They in turn are added to the class path and/or > added to the jar file as part of the application. It seems that the > situation in android is slightly different. The "added" libraries are > not added to the .apk file but included in the environment, i.e., in > the AVD and the developer needs to construct/build it.
Right, you have to consider Maps has a system-level library that can be present or not present on devices. There are 2 parts to making a maps-enabled application: - In ADT or in Ant, compile against the "Google APIs" target. This target gives access to the maps API by adding maps.jar to the classpath at compile time, but does NOT add any extra code in the application APK. - Declare in your manifest that your application requires maps: add the <uses-library> node: <uses-library android:name="com.google.android.maps" /> Now when your application is about to be installed on a device, the package manager will check which library your app requires and will fail to install the application if they are not present. Note that Android Market does the same check pre-installation so that users do not see applications that won't install. > My question: Does this mean that any and every application that needs > a library like "maps.jar" file does not need to duplicate it in their > environment? If one application specifies a need for the maps.jar, > other application will have maps.jar available to them? Maps.jar is never added to your apk. For any other random library that you may add to your apk as 3rd library (ie the code is added to your apk, and there's no need for uses-library), no other applications can access that code. To expose that library to other apps you would have to implement a Service for other applications to talk to. Xav -- Xavier Ducrohet Android SDK Tech Lead Google Inc. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

