Closed GoogleCodeExporter closed 8 years ago
Initially, we planned just to use reflection for checking for APIs e.g.
MapView. However, it seems that we need to explicitly declare a dependency
against a library (Google Maps in this case), so this turns into a major
problem. Here is the comment I added to the code:
The entire Google API code below is commented out temporarily.
In order to use a library we must declare uses-library in the manifest
I tried it but couldn't make it work event on Google 2.2 AVD. Also,
they say that the app won't install unless you have the library installed
on the device as well, which will be a huge blocker (though needs to be
verified)
Alternative to this, as I see it currently, is to have a separate apk being
installed and uninstalled at runtime with user consent, but this would hinder
the end user experience a lot. Ideas welcome!
Original comment by s.dju...@gmail.com
on 16 Sep 2010 at 11:42
What about asking the PackageManager whether intent VIEW/geo: or a component of
Google Maps can be resolved and then inspect the list of returned activities.
If Google Maps is installed one can concluded that the lib is installed.
However, the other way round does not work. If the library is installed and
Google Maps has been uninstalled the Plugin would return false. The result
would be good enough though as I assume that the installation of lib implies
phe reinstallment of Google Maps due to licensing terms.
Original comment by friedger@gmail.com
on 16 Sep 2010 at 1:15
Friedger, thanks for the hint!
I've changed to it check for "PackageManager.getActivityInfo(new
ComponentName("com.google.android.apps.maps",
"com.google.android.maps.MapsActivity"))", and I've also changed the key node
from "com.google.android.maps" to "Google Maps Application", since this is what
we are really checking for. Whether or not the library is installed is TBD, but
it is very likely that if you have the Maps app you will have the library as
well
Original comment by s.dju...@gmail.com
on 30 Sep 2010 at 8:56
Original issue reported on code.google.com by
friedger@gmail.com
on 8 Sep 2010 at 8:28