Android with GoogleMap About mapActivity - android

As we all know, if we want to use google maps api. We can use target:Google apis;
But some rom just my moblie phone that has no google map.
If i use mapActivity it will tell me "class not found".
And it work well in another Phone. (It ensure my code is correct.)
And someone say this problem is with the "framework" missing a file in my Rom.
But when I install Goole map.apk on these phones, the Google maps work fine on them.
I do not know why the google map can run on my phone, but my application will not run on my phone that uses mapAcivity.

try to use Google APIs like a target of your project.

Related

Codes Work in USA but not in China?

I am using A/Studio 2.2
My code unpacks a bundle of LatLng-parameters from a preceeding activity and displays the corresponding G/Map, works well in USA. Loved it. In USA, I used Android 6.
I am in China now, I have downloaded Play Store, Google Maps, Gmail etc and installed them on a local popular low-end phone "vivo-v3m". When I installed G/Maps, a message flashed quickly across Android saying GPS is off and to authorize Google to download something to use Google maps, which I did. In China I am using Android 5.1
G/maps works well after that but my app is still not working.
I strongly suspect I have to include or compile some G/Map APIs into the dependencies in the gradle.
Before I start debugging why the code doesn't work here, I need to know whether it is some Google APIs I have to download to use G/Maps.
Google services is now blocked in China. So Google map is not working in china. use Baidu Maps for china
I was going through the same problem before while developing for a Chinese website and came across Baidu maps. After doing some analysis I found few links that give explanation on Baidu maps in English and steps to implement it. I hope it helps you.
http://www.maplandia.com/china/fujian/fuqing/baidu/
Examples of baidu map api :
http://api.map.baidu.com/library/MarkerClusterer/1.2/examples/simple.htm
Baidu Maps Javascript API Document:
https://qianggan.wordpress.com/2015/04/29/baidu-maps-javascript-api-document/
enter link description here

How to get user's google api version on android?

I'm facing some rare problem. I have a device running on Android API 14. Anytime I try to use MapActivity I get the same error - java.lang.NoClassDefFoundError: android.security.MessageDigest. On other 99% devices it works perfect.
After some digging, I've found root of the problem.
The error is the result of a device manufacturer or ROM creator using
an older maps library with a new version of Android. (more at
What is 'android.security.MessageDigest''?)
The functionality of MapActivity isn't required for application, so I want to check if user has such device.
How can I get user's google api version on android?
Use Google map v2.
You want to use Google map console to register SHA-1 for signing the key in Google api console.
The complete tutorial can be found here.

Google maps API work only on emulator

I wrote a simple google maps application the other day, everything should be fine, but it works only on emulator. when I actually export it and run on the phone, the google maps wont load and all I see is just empty grid. any experiences? thx
You need the developer key. Just follow THIS tutorial to get it. It will work only in your computer, you cannot use the key in another computer.

Does Google Maps in android app works in UK

I have created android application that uses Google Maps, ans it works fine here in Palestine(Middle east). When someone try it on UK either on the emulator or on the real device it doesn't show any map!
What is the possible problem ?
Your UK tester doesn't have an Internet connection, or is using a different APK than the one you tested (and therefore you might have a problem with your signing key and Maps API key), or is testing using a device that does not legitimately have Google Maps on it, or something along those lines.

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