user1398267
user1398267

Reputation: 31

Do I need to have a google map app pre-installed on the device to be able to run an app using the google API?

I am creating an app that uses the google API. I would like to know if i install that app on a mobile phone, will it require a gooogle map app pre-installed in the device to be able to use the map or it uses the internet to get the map from google or any other methods?

This my main.java:

package com.map.testing;

import android.os.Bundle;

import com.google.android.maps.GeoPoint; import com.google.android.maps.MapActivity; import com.google.android.maps.MapController; import com.google.android.maps.MapView;

public class main extends MapActivity { /** Called when the activity is first created. */ MapController mControl; GeoPoint GeoP; MapView mapV; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mapV = (MapView) findViewById(R.id.mapView); mapV.displayZoomControls(true); mapV.setBuiltInZoomControls(true);

double lat =  23.1;
double longi = 113.3;

GeoP = new GeoPoint((int)(lat*1E6), (int)(longi*1E6));

mControl = mapV.getController();
mControl.animateTo(GeoP);
mControl.setZoom(12);

}

@Override 
protected boolean isRouteDisplayed() {        
// TODO Auto-generated method stub 
return false; 
}

}


This my main.xml:

<com.google.android.maps.MapView
             android:id="@+id/mapView"
             android:layout_width="fill_parent"
             android:layout_height="fill_parent"
             android:enabled="true"
             android:clickable="true"
             android:apiKey="00_sJY0o9guZejQwsJOr8PPDHtMpnEB6LWFspjA"
             />
</LinearLayout>

my manifest:

<uses-sdk android:minSdkVersion="8" />

<uses-permission android:name="android.permission.INTERNET" />

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >
    <uses-library android:name="com.google.android.maps" />

    <activity
        android:name=".main"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

Upvotes: 0

Views: 275

Answers (1)

Dheeresh Singh
Dheeresh Singh

Reputation: 15701

But you can handle id the api is not on phone by

android:required="false" in

How to detect an android device whether it supports google maps API

Upvotes: 0

Related Questions