Upgrading to the Google Maps Android API 2 monodroid - android

I have an android application that use Google Maps Android API Version 1 for its map. Now, I want to use Google Maps API Version 2 for on my application (https://developers.google.com/maps/documentation/android/) .
What is more quicker solution to upgrade my projects code to version 2? It looks that all codes changes. I have codes for changing center of map, adding overlays, changing zoomlevel, finding map bound lat/lng and etc.
And Also whether this API Also supports Android versions 2.3 or not?
Thanks

Google Maps v2 is completely different from Google Maps v2, so there probably won't be much code you can save / port over.
Google Maps v2 requires Android 2.2 or higher and Google Play services.
There is a sample for Xamarin.Android up on Github. It targets Android 4.0 and higher but can be easily changed to support Android 2.2 or higher.

The API v2 supports devices from 2.2.
I believe the quickest way to switch to v2 is by removing your MapActivity-based class and all code related to that and creating a new FragmentActivity-based.

Related

Which one to choose as Project build target ? Google APIs or SDK platform

I have been searching but couldn't find the difference between both of these things. I have read other questions in which people have said that we should use Google Apis as build target when we want to integrate Google Maps Api or use other Google apis.
The problem is that i am using maps on projects that were build on simple Android 4.4 not Google API (platform 4.4) and the maps are working just fine on my Galaxy s3.
How are they possibly working?
And if they are working then what is the difference between Google APIs and SDK platform?
Or is the difference only related to emulators?
It is really pointless to use the Google API's now because most if not all things included in that have been deprecated and moved to google play services. Selecting Google API will not do anything except maybe increase the size of your program. The difference being is in addition to the 4.4 SDK you would also get all the Google API stuff with it
You don't need (but it won't hurt you) to use Google APIs if you use Google Maps Android API v2. Google APIs is for when you work with deprecated Google Maps Android API v1 or you program USB.
The google API includes Google Maps and other Google-specific libraries. The Android one only includes core android libraries.
As for which one to choose, I would go with the Android API until you find that you need the Google API; such as when you need Google Maps functionality.
http://code.google.com/android/add-ons/google-apis/index.html is a link to the Google API page.

Android apps targeted at Android 2.2 and Google Maps V1

I'm pretty new to Android dev, not so new to Java. Anyhow I'm in the planning stage of my application which will rely heavily on Google map api.
I wanted to jump in to the code today but came across this dilemma. I won't be using any special UI components or anything so new that I would need to set my targeted version to higher than 2.2.
First thing I would like to display a map via Google map api. Anyhow the problem I have is when visiting https://developers.google.com/maps/documentation/android/v1/ To learn more about the API and how to use it I found out that it's no longer supported and has been replaced with V2. What bugged me was the statement that they are no longer releasing api keys for Google maps V1. And the V2 requires minimal Android API to be 17 which puts my app targeted at phones running Android 4.3+ which does not really cover that much devices.
Does this mean my application is a no-go and I have to deal with it being targeted for Android 4.3+ or can I still use V1 and target my app for Android 2.2+
Thanks in advance
The minSdkVersion of apps using the Google Maps V2 API for Android is not 17, but 8.
What you mean is probably the targetSdkVersion which should always be the highest available.
So you're good to go there.

Use Google Map API v2.0 for lower version of Android

I need to use the Google Map API for my android application, but as we are now aware that API versoin 1 is deprecated, I can not use MAP API v2.0 for the lower versions of Android.
So can you please give me any suggestions what alternative can be used to show google map to the lower versions of Android?
Thanks,
Shubhangi.
The Maps API are bundled with Google Play services and are compatible with Android 2.2 and higher. All devices with Android 8 API level support OpenGL 2.0, so devices with Android 2.1 version can't support Google Maps v2. You can check in the Documentation
Note: Note, though, that not all Android 2.2/2.3 devices have the ability to get the Play Services Framework, particularly those devices that never received the Play Store and are stuck with the old Android Market. Android 3.0+ should be fine

Google maps v2 API on Android API Level 8 (requires fragments?) and Demos

I just installed Google Play Services
However, reading tutorials, maps seem to require fragments? (I only have a basic understanding of those since I am still new to Android)
From what I have read, it should be possible by using support library for fragments to get map v2 working on API level 8...
However, I have problems finding a demo that will actually run and not crash Eclipse/emulator (API level 8) so I am doing something wrong.
(Also the demos I have tried does not use the Google API console key which I do not understand. Everywhere I read it states it is required. But this is probably because it is also a "first" for me using any Google API for Android... Or at all actually)
All I want to do is to show a map centered on a specific address + add some pins
maps seem to require fragments?
No, though that is the recommended approach.
it should be possible by using support library for fragments to get map v2 working on API level 8...
Yes, though not all API Level 8 devices will support OpenGL ES 2.0 or have access to the Play Services Framework.
However, I have problems finding a demo that will actually run and not crash Eclipse/emulator (API level 8) so I am doing something wrong.
Maps V2 is not available on the Android emulator. Please do your Maps V2 development on a device.
Also the demos I have tried does not use the Google API console key which I do not understand.
I feel quite confident that the demos have the <meta-data> element in the manifest for the API key. Certainly all of my demos do.
All I want to do is to show a map centered on a specific address + add some pins
This is the simplest one of my demos for that scenario. It uses ActionBarSherlock and has a chance of running on an API Level 8 device, if that device has OpenGL ES 2.0 and the Play Services Framework. You will need to modify the manifest to put in your own Maps V2 API key, tied to your debug signing key and the app's package name (com.commonsware.android.mapsv2.markers).

Map Problems in Android

I am new in android programming, I had problem in showing Map with getting the location that is touched, could any one help. Here please me code bellow. Thank you in advance.
Note: I took the code from this site, I used displaying the Map and it was working but when I am trying to use the last code in the site for display the touch location, does not work.
After seeing the link you have given for code reference .i have seen that you are developing with the old outdated API V1 for android which will not work now because the new Maps API V2 for android is now applicable.
Find more about the new API HERE on Android Developer Site.
The API is now distributed as part of the Google Play services SDK,
which you can download with the Android SDK Manager.
Maps are now encapsulated in the MapFragment class, an extension of Android's Fragment class.
Now you can add a map as a piece of a larger Activity. With a
MapFragment object, you can show a map by itself on smaller screens,
such as mobile phones, or as a part of a more complex UI on
larger-screen devices, such as tablets.
Because maps are encapsulated in the MapFragment class, you can
implement them by extending the Android standard Activity class,
rather than extending the MapActivity used in version 1.
The Maps API now uses vector tiles. Their data representation is
smaller, so maps appear in your apps faster, and use less bandwidth.
Caching is improved, so users will typically see a map without empty areas.
Maps are now 3D. By moving the user's viewpoint, you can show the map with perspective.
See my blog posts i have tried to summarize all there is needed to build an App with Google Maps API V2 for Android.
Solution to Problems with Maps API V2(using google_play_services_lib).
Creating an Android App with Maps API V2 for minSDK=8 (Android 2.2 Froyo).
Creating an Android App with Maps API V2 for minSDK=11 (Android 3.0 HoneyComb).
I've played with the Google Maps Android Library V2 a bit.
Here is an example I did that works, see if it can help you.
I stripped out my own API key, but i've included many different parts including the need to setup:
http://www.digitalopium.com/android-google-maps-api-tutorial/
-Debug/Retail Certificates and the SHA-1 key
-Google Project and the Android Map API key
-Google Play services via the Android SDK
-Project setup including the manifest file and code snippets.
Google has changed the method of obtainig map keys, previously it was using MD5 fingerprint
Now you can follow the link to integrate the map
Integrating google maps in android applicaiton
This tutorial has a section about getting location from touched position. Hope it will help you. Google Maps Android v2 Tutorial

Categories

Resources