Android: automatically choose debug/release Maps api key?

There is a new way to determine is it a debug build or release one in SDK Tools, Revision 17. An excerpt from new features overview: Builds now generate a class called BuildConfig containing a DEBUG constant that is automatically set according to your build type. You can check the (BuildConfig.DEBUG) constant in your code … Read more

Shared library missing in android.

As CommonsWare said, your emulator is missing the library. The Google Maps Library’s documentation’s Overview page has info on how to create the right kind of virtual device for the emulator. The gist is: Launch the AVD Manager by using the android command without any options. If you are developing in Eclipse/ADT, you can also … Read more

How can I handle map move end using Google Maps for Android V2?

Check out new maps api. @Override public void onMapReady(GoogleMap map) { mMap = map; mMap.setOnCameraIdleListener(this); mMap.setOnCameraMoveStartedListener(this); mMap.setOnCameraMoveListener(this); mMap.setOnCameraMoveCanceledListener(this); // Show Sydney on the map. mMap.moveCamera(CameraUpdateFactory .newLatLngZoom(new LatLng(-33.87365, 151.20689), 10)); } @Override public void onCameraMoveStarted(int reason) { if (reason == OnCameraMoveStartedListener.REASON_GESTURE) { Toast.makeText(this, “The user gestured on the map.”, Toast.LENGTH_SHORT).show(); } else if (reason == OnCameraMoveStartedListener … Read more

Capture screen shot of GoogleMap Android API V2

Update – Google has added a snapshot method**!: The feature request for a method to take a screen shot of the Android Google Map API V2 OpenGL layer has been fulfilled. To take a screenshot, simply implement the following interface: public abstract void onSnapshotReady (Bitmap snapshot) and call: public final void snapshot (GoogleMap.SnapshotReadyCallback callback) Example … Read more

Should I use MapView or MapFragment

First of all, soon the MapView and Google Maps API V1 will stop being supported and won’t receive any new updates. And soon all the support will go away. Secondly, MapFragment may be a little bit less flexible right now, but the map presented, manipulated a looks much better. And I guess that it’s functionality … Read more

Android MapView -setting zoom automatically until all ItemizedOverlay’s are visible

Kinda like this int minLat = Integer.MAX_VALUE; int maxLat = Integer.MIN_VALUE; int minLon = Integer.MAX_VALUE; int maxLon = Integer.MIN_VALUE; for (GeoPoint item : items) { int lat = item.getLatitudeE6(); int lon = item.getLongitudeE6(); maxLat = Math.max(lat, maxLat); minLat = Math.min(lat, minLat); maxLon = Math.max(lon, maxLon); minLon = Math.min(lon, minLon); } mapController.zoomToSpan(Math.abs(maxLat – minLat), Math.abs(maxLon – … Read more

MapFragment in ScrollView

Applying a transparent image over the mapview fragment seems to resolve the issue. It’s not the prettiest, but it seems to work. Here’s an XML snippet that shows this: <RelativeLayout android:id=”@+id/relativeLayout1″ android:layout_width=”match_parent” android:layout_height=”300dp” > <fragment android:id=”@+id/map” android:name=”com.google.android.gms.maps.MapFragment” android:layout_width=”fill_parent” android:layout_height=”fill_parent”/> <ImageView android:id=”@+id/imageView123″ android:layout_width=”match_parent” android:layout_height=”match_parent” android:src=”https://stackoverflow.com/questions/13746351/@drawable/temp_transparent” /> </RelativeLayout>

Android: How do I set the zoom level of map view to 1 km radius around my current location?

although this answer is logical and i find it working but the results are not accurate i dont know why but i tired this approach and this technique is far more accurate. 1) Make a circle on object with desired radius Circle circle = mGoogleMap.addCircle(new CircleOptions().center(new LatLng(latitude, longitude)).radius(getRadiusInMeters()).strokeColor(Color.RED)); circle.setVisible(true); getZoomLevel(circle); 2) Pass that object to … Read more

Using ItemizedOverlay and OverlayItem In Android Beta 0.9

For the sake of completeness I’ll repeat the discussion on Reto’s post over at the Android Groups here. It seems that if you set the bounds on your drawable it does the trick: Drawable defaultMarker = r.getDrawable(R.drawable.icon); // You HAVE to specify the bounds! It seems like the markers are drawn // through Drawable.draw(Canvas) and … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)