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
Related
Is using google maps for android SDK in China working?
I've been trying by VPN and it's not working.
Is there some SDK setting I'm missing?
Like the javascript api allows change the url to
http://maps.google.cn/
If not, can anyone give me some suggestion?
I've been trying the Skobbler OSM Maps, the speed of randomly loading when loading the world wide map area is so slow.
Does it works by using the webview (Google map javascript API) ?
Our app need to show the global countries map, including China area.
Many Thanks
you can change the google maps to GaoDe (amap).
First because Google maps need the googles services, which are not available on Chinese phones.
Then because if there is a way with JavaScript to get to the Chinese google map ( see the following link: developers.google.com/maps/faq?hl=en#china_ws_access ), for android with java it is still not reliable.
I'm migrating an app from Google Maps Android API v2 to Google Maps Android API for Business following instructions here : https://developers.google.com/maps/documentation/business/mobile/android/config#migrate_an_existing_application
This should be very straightforward but unfortunately after replacing all the com.google.android.gms.maps references to com.google.android.m4b.maps, the app is compiling right but the map is not showing : I get a gray rectangle instead.
One possible reason (and actually one thing I don't understand so far) is that the API key is the exact same as the one I used for Google Maps Android API. Logically, there should be a personal code to enter somewhere, something like the Client ID / Crypto key I've been sent by Google.
Can anyone help me?
From the documentation link below ,
https://developers.google.com/maps/documentation/business/mobile/android/auth
there seems to be a hidden service named "Google Maps Mobile SDK service"
which will be enabled by Google Enterprise Support when you sign up for the Google Map Mobile SDK for Business.
Once we purchase Business licence, enable this service in our project
and generate a Map V2 API key using same procedure for non business version
we should be able to see the tiles loading on Android Device.
Note:This observation is only based on documentation link above and not an experimented one.
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.
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).
Does anybody know any free of charge android maps library that has 3D capabilities?
I know for sure that google maps doesn't support 3d when using the sdk library.
The provider is not a problem. I'm not married with google maps, nor any other.
The following are apps that can be used as example of what i'm trying to accomplish.
Waze
https://play.google.com/store/apps/details?id=com.waze
Route 66
https://play.google.com/store/apps/details?id=com.route66.maps5
Example
I want to mention this solution:
http://www.eegeo.com
It is crossplatform service with 3D modelling, routes tracking, traffic visualizing and a lot of other cool stuff.
I guess this question becomes obsolete now that we have the Google Maps Api V2 is out in the wild. Thanks everyone for taking your time to answer it.
Here's a quick release changelog
The API is now distributed as part of the Google Play services SDK, which you can download with the Android SDK Manager. To learn how to install the package, see Installing the Maps API SDK.
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.
Here's the new API documentation
Here's the Android Developers blog spot announcing the new API
And here's a screenshot of one of the new API early adopters Trulia
If you are looking for a 3D globe visualisation, you can use Gesium. Here is Hello World example.
We do provide one: Nutiteq 3D Maps SDK. This is SDK, not an application.