Tag: google-maps

Android Maps v2 rotate mapView with compass

Im developing an app which needs to rotate the mapView with compass. i know how to rotate the camera but i need to rotate the mapView with compass. the center point should be the current location. i found codes for Maps V1 but i need to do it with Maps V2

Android Google Maps v2: on click listener not responding

I’m trying to put a marker when the user clicks on map. I’m using a SupportMapFragment inside an ActionBarActivity. But the map doesn’t respond, furthermore, a map.setMapType() operation isn’t working. Here’s my code: private GoogleMap map; private Marker marker; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ActionBarActivity activity = (ActionBarActivity) getActivity(); activity.getSupportActionBar().setTitle(R.string.select_location); […]

Google map v2 or v3?

I started an app using Google map.I came to know that api v1 is deprecated.So i used api v2. It is working from android version 12 or higher.It is fine.But after sometime i read in some site api v2 is also deprecated and v3 is there.But when i saw v3, it was related to html […]

how to get the long & lat value of four corners in the mapview in android?

i working on map view. i want to put overlay item on the map view. that overlay items are all depends on currently showing map view and zoom level. how to get current map view’s longitude and latitude of that four corner and how to analyze how many overlay item inside it. also we have […]

Can not import com.google.android.maps.MapActivity

I try to import com.google.android.maps.MapActivity but my program can not recognize it. I also have <uses-library android:name=”com.google.android.maps” /> and set the apiKey in my project. Can anybody explain why I can import the above line? Thanks in advance.

Android Google Map to show as picture

I’ve implemented Google Maps V2 in my android app and now I would like to do something differently. I’m showing a location (longitude, latitude) with a marker. The problem is that this is showing in my activity as a Map. I would like to show it as a ImageView and only if someone clicks on […]

Unexpected namespace prefix “xmlns” found for tag fragment Unexpected namespace prefix “map” found for tag fragment

why Unexpected namespace prefix “xmlns” found for tag fragment Unexpected namespace prefix “map” found for tag fragment? <RelativeLayout xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:tools=”http://schemas.android.com/tools” android:layout_width=”match_parent” android:layout_height=”match_parent” tools:context=”.Main”> <fragment xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:map=”http://schemas.android.com/apk/res-auto” android:id=”@+id/map” android:name=”com.google.android.gms.maps.MapFragment” map:mapType=”satellite”/> </RelativeLayout> why Unexpected namespace prefix “xmlns” found for tag fragment Unexpected namespace prefix “map” found for tag fragment ?

MapFragment return null

mMapFragment = (SupportMapFragment) getSupportFragmentManager() .findFragmentByTag(MAP_FRAGMENT_TAG); // We only create a fragment if it doesn’t already exist. if (mMapFragment == null) { mMapFragment = SupportMapFragment.newInstance(); // Then we add it using a FragmentTransaction. FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction(); fragmentTransaction.add(MapLay.getId(), mMapFragment, MAP_FRAGMENT_TAG); fragmentTransaction.commit(); mMap=mMapFragment.getMap(); By this code map is visible but unable to access the map mMap=mMapFragment.getMap(); show […]

Getting latitude and longitude from latlng object in android

I am trying to get latitude and longitude on the Googlemap v2.. I have set the onclick listener for mapragment object using the code map.setOnMapClickListener(new OnMapClickListener() { @Override public void onMapClick(LatLng latln) { // TODO Auto-generated method stub String s=latln.toString(); Log.w(“dsfdsf”,””+s); } }); It provides be the latitude and longitude coordinates in the format lat/lng: […]

One Google Maps key for all developers?

We are using a Google MapView in our application but on different computers we must use different API keys, otherwise the MapView doesn’t display anything. Is there a way to set one key for all developers?

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.