0

my app is internationalization,so in some country have Fortress mobile phone,which is not have google Mapview,it not use mapactivity,so i cannot install my app to the Fortress mobile phone. so myquestion:

  1. if i can add common map.jar to my app,so i can use the jar to finish my app map effect ,not care mapview in the Fortress mobile phone .i donot know if the seem common map.jar is exist at present

  2. if have other methods to meet my need?

1 Answer 1

1

If I understand the question correctly, you want to determine, at runtime, whether GOogle Maps exists on the device, and take an alternative path if it does not.

  1. you must build your app with Google Maps API, but set the required flag to "false" in your manifest

<uses-library android:name="com.google.android.maps" android:required="false" />

  1. use code like this to determine if the library exists on the device

try {

   mContext.getClassLoader().loadClass("com.google.android.maps.MapView");

   // You have Google Maps

}

catch (ClassNotFoundException e)

{   

 // No Google Maps

}
Sign up to request clarification or add additional context in comments.

1 Comment

this is only my one problem,if not have google mapview, if my app also do other mapview. this increase my app big. if have other methods to compatible

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.