This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add the correct dependencies into the build.gradle file: | |
All those answers are wrong, since the release of gradle plugin v0.4.2 the setup of google play services under android studio is straight forward. You don't need to import any jar or add any project library nor add any new module under android studio. What you have to do is to add the correct dependencies into the build.gradle file. Please take a look to those links: Gradle plugin v0.4.2 update, New Build System, and this sample | |
The Correct way to do so is as follows: | |
First of all you have to launch the sdk manager and download and install the following files located under "extras": Android support repository, Google play services, Google repository. | |
Restart android studio and open the build gradle file. You must modify your build.gradle file to look like this under dependencies: | |
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MapView mv; | |
private UserLocationOverlay myLocationOverlay= myLocationOverlay = new UserLocationOverlay(new GpsLocationProvider(this), mv); | |
myLocationOverlay.setDrawAccuracyEnabled(true); | |
myLocationOverlay.enableMyLocation(); | |
LatLng latlong =myLocationOverlay.getMyLocation(); | |
Double myLatitide= latlong.getLatitude(); | |
Double mylongitude = latlong.getLongitude(); | |
Double myAltitude = latlong.getAltitude(); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Marker m; | |
MapView mv; | |
Drawable myIcon = getResources().getDrawable( R.drawable.ic_launcher ); | |
m = new Marker(mv, "hi", "hello", new LatLng(77.0875, 14.42112)); | |
m.setMarker(myIcon); | |
m.setTitle("Hello Android"); | |
m.setDescription("This is Technicise"); | |
mv.addMarker(m); |