INSTALL_FAILED_MISSING_SHARED_LIBRARY - android

I have a map application. I want to install it on a device having no maps library available. Can't I burn in along the app.

No, you can't "burn in along the app", unless you're a pirate. Google Maps is software that is licensed by device manufacturers or is obtained from the Android Market. If a device does not have it, there is nothing you can do about that fact.
There is an undocumented android:required attribute on the <uses-library> element. However, we have been told it is safe to use, that it being missing from the documentation is merely a documentation bug. You can use android:required="false" to allow your app to run on a device that lacks Google Maps. This does not magically add Google Maps, though, and so if you try to start a MapActivity, it will crash. But, using Class.forName(), you can see if MapActivity exists, and if it does not, do something else for your maps (e.g., WebView and Web-based Google Maps, OpenStreetMap).

Related

Use google map on any devices. (without google play )

I am trying to do a feasiblility test on google map in android.
Google Maps Android V1
When using MapView we have to add
<uses-library android:name="com.google.android.maps" />
in androidmenifest.xml. But as far as i know, there are some devices that do not have this library embed. So the application could not even be installed in these devices.
Google Maps Android V2
In V2 the map is supported by the sdk of extra/google_play_services. This approach is better but it still rely on the google play service. If i uninstall the service an alert message will appear like the following sreenshot.
And when i clicked the button, it crashed and throwed an exception.
android.content.ActivityNotFoundException: No Activity found to handle
Intent { act=android.intent.action.VIEW
dat=http://play.google.com/store/apps/details?id=com.google.android.gms
flg=0x80000 pkg=com.android.vending }
It is because that it cannot find google play, which also is uninstalled before the test, to handle the Intent. But the intent could be handled by brower without specifying pkg=com.android.vending.
So.. here is my question.
Is it possible to intercept and handle the above Intent by my own app? So i
can pass it to brower.
If it is not possible, what is the best solution to develop android
app with map. I know there are many android devices that do not have
Google Map or Google Play installed, crash in use cannot be
acceptable.
Actually, the problem relates to Gingerbread and older phones using the wrong URI if they don't already have the Play Store installed. This isn't a safe assumption. Most out-of-the-box Gingerbread phones don't come with it, and Google updates don't necessarily install it. This is a known bug in Google Play services V2. See the discussion on Google Code
A hack to get around it is discussed, but you'd need to intercept the button press to use it.
You need to use google map api to run google map . Create AVD with google api and run your project in that AVD (Emulator).

Can google maps be used on a normal api rather than in google api's?

I want to use a google map to display a persons information only if he wishes to. Otherwise he will be on another screen doing something else but the map updates automatically even when he is not looking at the map?
And also i want the application to run on all versions of android rather than only a phone which has specific google api's . If i create an application using the third party google add-on, will it also run on a normal device with say like android 2.2 or 2.3.3 version?
The first thing sounds, like you want to update the map in the background, while your user is not on the MapActivity. To do so, you can use a Service.
When using the Google APIs, they have to be installed on the targeted device. From the documentation:
The <uses-library> reference is required, because it enables the
build tools to link your application against the Maps external
library. It also ensures that the Android system will not install
your application on a device unless the required library is
available.

Kindle Fire and Google Maps api

We're developing an app with some map features, with
<uses-library android:name="com.google.android.maps" />
in the manifest. It runs well on a Xoom and a Galaxy Tab, as well as several phones. It also runs fine in one of the Google APIs emulators. When installing to the Kindle Fire, we get
[2011-12-20 16:25:04 - android] Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY
[2011-12-20 16:25:04 - android] Please check logcat output for more details.
[2011-12-20 16:25:04 - android] Launch canceled!
with
E/PackageManager( 1385): Package <package> requires unavailable shared library com.google.android.maps; failing!
W/PackageManager( 1385): Package <package> couldn't be installed.
D/AndroidRuntime(12606): Shutting down VM
This post: https://stackoverflow.com/a/4509787/931277 confirms what I was starting to suspect, that the required api is really missing from the device.
Is there any way to include this library with an application, rather than relying on its inclusion in the Android build on the device?
Not only is there no "way to access this api", but what you are suggesting as the alternative ("hunting down a Google Maps apk and installing that onto the Fire") is not only a copyright violation but probably will not work, since the Google Maps app will not supply the system library that other apps would use.
UPDATE based on edit:
Is there any way to include this library with an application, rather than relying on its inclusion in the Android build on the device?
No, sorry. Google licenses Google Maps (app and system library), and there are no distribution options outside of licensing it from Google for use with firmware.
You might consider OSMDroid and OpenStreetMap, or using WebView and the Web-based Google Maps.
deCarta offers a full featured Android API for mapping, geocoding, reverse geocoding, advanced driving directions, and POI search. It runs like a champ on the Kindle Fire and offers both OpenGL or Canvas based map rendering. Check it out:
http://developer.decarta.com/Apis/Android
also: if you register on the site you actually get all the source code for the entire API free. They also have HTML5 APIs that work great on the Kindle browser as well.
Have you tried this http://code.google.com/apis/maps/articles/android_v3.html
Amazon now offers a MAPS API, with two core features:
Interactive Maps. You can embed a Map View in your app for customers to pan, zoom and fling around the world. You have the option to display a user’s current location, switch between standard maps and satellite view, and more.
Custom Overlays. You can display the locations of businesses, landmarks and other points of interest with your own customized markers and pins.
check it out here https://developer.amazon.com/sdk/maps.html

Using MapView on non-"Google Market"/non-"Google featured" phones

Is it possible to use the MapView to build on GMaps-based apps without having Google Market and the other Google tools installed?
Do i need to have a custom ROM on such phones with that Google tools?
Are there some other possibilities to use Maps and a MapView-like-thing?
Especially some Tablet devices like Notion Ink Adam , Advent Vega und Point of View Tegra lack this Google Tools.
If the device does not have Google Maps, you cannot create MapView-related apps.
However, bear in mind that there is a lightly-documented android:required attribute on the <uses-library> tag. If you set that to be false, your app should still load on MapView-less devices. You can use Class.forName() to see if the MapView class exists -- if it does not, you can substitute something else (e.g., WebView with the Web version of Google Maps, OpenStreetMap) or disable the map features entirely.

Android app using Google Maps library, installable everywhere

Is it possible to use Google Maps Android library in my app in a way, that the app can be installed even on phones without Google Maps? On phones without Google Maps, the maps feature would be disabled.
Is it possible to use Google Maps Android library in my app in a way, that the app can be installed even on
phones without Google Maps?
There is an undocumented android:required="false" flag you can put on the <uses-library> element. I am hopeful that they will document this in a future release. With that set to false, you would need to use reflection to see if Google Maps is loaded (e.g., try to find the MapView class) -- if not, disable whatever would lead the user to a map.
If anybody else has the same problem (I do):
On this Android Developer page it says -- as far as I can tell -- that you can reference the Maps API and thus have e.g. a map activity in your app by using Google Play services:
"The Google Maps Android APIs are not included in the Android
platform, but are available on any device with the Google Play Store
running Android 2.2 or higher, through Google Play
services.
To integrate Google Maps into your app, you need to install the Google
Play services libraries for your Android SDK. For more details, read
about Google Play
services."
Apparently it is an actual app (it is installed on my phone) that updates certain Google stuff.
So it seems it is possible, but only for devices running Android 2.2 (API level 8) and above.
I find the explanation on that site a bit unclear, however, and I have not been able to test this on my own.
In my case, I guess I have to live with the fact that not all devices will be able to install my app, since I target an API < 8.

Categories

Resources