本系列教程将分为两部分,第一部分是指导用户使用Mapview控件进行编程,其中包括了如何获得Google Map API,如何使用该API进行简单的开发,如何获得用户当前所在的位置。第二部分则包括如何在地图上,用第三方的组件库,实现气球式显示若干指定位置的功能。

  步骤1 创建新的Android 工程

  首先打开eclipse新建立一个Android 工程,其中相关参数设置如下:

  Project name:MallFinder

  Build Target: Google APIs Platform – 2.1 API Level 7

  Application Name: Mall Finder

  Package Name: com.shawnbe.mallfinder

  Create Activity: MallFinderActivity

  MinimumSDK: 7

  如下图所示:

  步骤2 注册Google Map API key

  由于在使用google map的时候,需要使用google map api的key,因此需要先注册一个开发者key,可以到如下地址进行注册:http://code.google.com/android/add-ons/google-apis/mapkey.html ,其中需要我们先产生开发期间的md5 密纹才能完成注册,因此我们先学习如何生成一个MD5密纹。

  我们需要使用keytool工具,不使用传统的命令行方式下那枯燥的证书签名生成办法,而是直接在eclipse下通过插件进行完成,详细见步骤3

  步骤3 安装keytool插件

  在eclipse的Help菜单中,如下图,选择安装新软件:

  在安装地址中输入如下地址:http://www.keytool.sourceforge.net/update  ,如下图

  接下来会加载相关的安装程序,并显示用户协议,选择接受所有用户协议后进行安装,安装成功后重新启动eclipse即可生效。

  步骤4 产生开发期间的MD5密钥

  在重新启动eclipse后,会发现工具栏多了如下图的keytool菜单

  现在,我们打开debug.keystore,注意其位置回因操作系统不同而有不同

  Windows Vista : C:\Users\\.android\debug.keystore

  Windows XP : C:\Documents and Settings\\.android\debug.keystore

  OS X 和 Linux : ~/.android/debug.keystore

  点keytool菜单中,选择open keystore,根据提示,选择当前系统所在的debug.keystore位置并打开,如下图,

  其中,输入密码默认为android即可,并点Load加载。之后会在eclipse中出现新的keytool的视图,如下图所示:

  双击打开androiddebugkey,复制其md5密纹,然后访问页面

  http://code.google.com/android/maps-api-signup.html ,接受其协议,将md5密纹复制进去,再点Generate API Key,即产生google map的api key,记得保存好这个KEY,在接下来的步骤中要使用。

  步骤5 增加MapView控件

  接下来,我们可以往布局文件中增加MapView控件。我们在main.xml中添加如下代码:

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" > 
    <FrameLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"> 
        <com.google.android.maps.MapView
        android:id="@+id/mapView"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:clickable="true"
        android:apiKey="你的GOOGLE MAP API KEY "/> 
    </FrameLayout> 
</LinearLayout>

  在这个控件中,请注意要在android:apiKey的位置填入刚申请的google map api key。

  步骤6 设置相关的权限

  由于我们的应用需要调用Google Map的数据,以及通过手机的GPS获得相关的其他地理位置数据,因此我们必须在Android的Manifest文件中进行权限的设置。

  我们打开AndroidManifest.xml文件,然后增加如下代码所示的权限设置,注意添加在标签后,但要在标签前。

<uses-feature android:name="android.hardware.location.gps"/> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <uses-permission android:name="android.permission.INTERNET"/>

  在这里,我们分别调用了gps位置服务权限,使用互联网的权限以及使用最佳位置查找的权限(FINE_LOCATION)。在本文中,其实没用到FINE_LOCATION,但只是告诉开发者可以调整使用不同的地理位置提供者(providers)以提供准确的位置服务,如果要有比较精确的地理位置服务,那么可以设置android.permisson.ACCESS_FINE_LOCATION服务。要注意的是在开发中,不要过多引用一些不需要使用的权限设置,否则会给用户带来担忧安全等问题。要是只想调用一般的位置服务,可以使用普通的android.permission.ACCESS_COARSE_LOCATION权限。

  为了在应用中使用Google Map,需要在Manifest文件中包含相关的类库文件,所以加入如下代码:

<uses-library android:required="true" android:name="com.google.android.maps" />

  为了视觉的美观,我们把标题栏也去掉,以便留给地图更大的空间,所以设置为

  android:theme="@android:style/Theme.NoTitleBar"

  下面是完整的Manifest文件代码:

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.shawnbe.mallfinder"
    android:versionCode="1"
    android:versionName="1.0" > 
    <uses-sdk android:minSdkVersion="7" /> 
    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.NoTitleBar"> 
        <activity
            android:label="@string/app_name"
            android:name=".MallFinderActivity" > 
            <intent-filter > 
                <action android:name="android.intent.action.MAIN" /> 
  
                <category android:name="android.intent.category.LAUNCHER" /> 
            </intent-filter> 
        </activity> 
        <uses-library android:required="true" android:name="com.google.android.maps" /> 
    </application> 
    <uses-feature android:name="android.hardware.location.gps"/> 
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> 
    <uses-permission android:name="android.permission.INTERNET"/> 
</manifest>

  步骤7 设置MapView

  下面对主activity程序(MallFinderActivity.java)进行修改,首先让其继承MapActivity类,如下:

  public class MallFinderActivity extends MapActivity {

  由于继承了MapActivity类,因此必须实现isRouteDisplayed方法,这个方法是用来做路线导航用的,这里我们不需要,因此只需要简单返回false即可:

  @Override

  protected boolean isRouteDisplayed() {

  // TODO Auto-generated method stub

  return false;

  }

  接下来我们就可以声明MapController控件,并对其进行相关属性的设置了,首先是声明控件

  private MapController mapController;

  private MapView mapView;

  并在oncreate方法中进行属性设置如下:

mapView = (MapView)findViewById(R.id.mapView); 
mapView.setBuiltInZoomControls(true); 
mapView.setSatellite(false); 
mapView.setStreetView(true); 
mapController = mapView.getController(); 
mapController.setZoom(13);

  在上面的代码中,设置了地图显示的方式为街道模式(通过设置mapview的setStreetView属性值为true),并且通过mapView.setBuiltInZoomControls(true); 使用了系统内置的放大缩小功能,并设置了地图的放大缩小倍数为13。

  这个时候我们就可以选择运行应用,看下是否符合我们的初步预期效果,运行后效果如下图:

  步骤8 获得当前所在位置

  在LBS应用中,十分重要的工作是要获得当前设备所在的位置,这个可以使用locationManager类实现,在获得当前位置的时候是需要花费一些时间的。我们继续声明两个参数变量如下:

  private LocationManager locationManager;

  private GeoPoint currentLocation;

  分别声明了LocationManager类的实例和GeoPoint类的实例(用于下文中的经纬度的计算)。

  再增加如下几个方法:

public void getLastLocation(){ 
    String provider = getBestProvider(); 
    currentLocation = locationManager.getLastKnownLocation(provider); 
    if(currentLocation != null){ 
        setCurrentLocation(currentLocation); 
    } 
    else
    { 
        Toast.makeText(this, "Location not yet acquired", Toast.LENGTH_LONG).show(); 
    } 

  
public void animateToCurrentLocation(){ 
    if(currentPoint!=null){ 
        mapController.animateTo(currentPoint); 
    } 

  
public String getBestProvider(){ 
    locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); 
    Criteria criteria = new Criteria(); 
    criteria.setPowerRequirement(Criteria.NO_REQUIREMENT); 
    criteria.setAccuracy(Criteria.NO_REQUIREMENT); 
    String bestProvider = locationManager.getBestProvider(criteria, true); 
    return bestProvider; 

  
public void setCurrentLocation(Location location){ 
    int currLatitude = (int) (location.getLatitude()*1E6); 
    int currLongitude = (int) (location.getLongitude()*1E6); 
    currentLocation = new GeoPoint(currLatitude,currLongitude); 
  
    currentLocation = new Location(""); 
    currentLocation.setLatitude(currentPoint.getLatitudeE6() / 1e6); 
    currentLocation.setLongitude(currentPoint.getLongitudeE6() / 1e6); 
}

  并且在oncreate方法中,添加对以上方法的调用代码如下:

public void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
    setContentView(R.layout.main); 
    mapView = (MapView)findViewById(R.id.mapView); 
    mapView.setBuiltInZoomControls(true); 
    mapView.setSatellite(false); 
    mapView.setStreetView(true); 
    mapController = mapView.getController(); 
    mapController.setZoom(13); 
    getLastLocation(); 
    animateToCurrentLocation(); 
}

  首先,在getLastLocation这个方法中,创建了locationManager类的实例并且根据设置的条件返回一个合适的地理位置提供方法。在这里,我们并没有指定对地理位置提供者的查询条件,在实际应用中,开发者可以通过设置criteria.setAccuracy()和criteria.setPowerRequirement()方法进行查找。如果要使用最精确的provider的话,可以设置使用ACCURACY_FINE方法进行搜索,如下代码所示:

  criteria.setAccuracy(Criteria.ACCURACY_FINE);

  在本文中之所以不选择使用最准确的位置provider主要是因为是没在室外进行测试,都是在室内调试程序,建议开发完后换成GPS模式provider到室外进行调试那样将看到很好的效果。

  接下来代码中使用 currentLocation = locationManager.getLastKnownLocation(provider); 一句,获得最新的位置信息,并且在setCurrentLocation方法中,对通过prodiver获得的地理位置信息Location对象进行经纬度的转换为GeoPoint对象。然后调用animateToCurrentLocation方法,将地图的中心点定位到我们当前的位置上去。

  此外,由于我们的位置是会发生变化的,所以需要使用location 监听器去检测我们的位置变化,这时需要实现locationListener接口,如下所示:

  public class MallFinderActivity extends MapActivity implements LocationListener{

  同时我们需要实现LocationListener类的以下几个方法:

@Override
public void onLocationChanged(Location arg0) { 
    // TODO Auto-generated method stub 

  
@Override
public void onProviderDisabled(String arg0) { 
    // TODO Auto-generated method stub 

  
@Override
public void onProviderEnabled(String arg0) { 
    // TODO Auto-generated method stub 

  
@Override
public void onStatusChanged(String arg0, int arg1, Bundle arg2) { 
    // TODO Auto-generated method stub 
}

  其中这里我们关心的是需要实现onLocationChanged方法,这里我们调用之前编写好的setlocation方法,获得当前的最新位置,如下:

@Override
public void onLocationChanged(Location newLocation) { 
    // TODO Auto-generated method stub 
    setCurrentLocation(newLocation); 
}

  为了完善程序,在程序处在onResume及onPause状态下都能及时更新地理位置信息以及取消更新,加上如下代码:

@Override
protected void onResume() { 
    super.onResume(); 
    locationManager.requestLocationUpdates(getBestProvider(), 1000, 1, this); 

  
@Override
protected void onPause() { 
    super.onPause(); 
    locationManager.removeUpdates(this); 
}

  小结

  在本系列的第一讲中,分步讲解了如何注册Google API KEY以及Mapview控件基本方法的使用,还有让读者了解到使用google map的初步步骤,在下一讲中,将指导读者如何对地图上的位置进行标注。

本系列教程将分为两部分,第一部分是指导用户使用Mapview控件进行编程,其中包括了如何获得Google Map API,如何使用该API进行简单的开发,如何获得用户当前所在的位置。第二部分则包括如何在地图上,用第三方的组件库,实现气球式显示若干指定位置的功能。

  步骤1 创建新的Android 工程

  首先打开eclipse新建立一个Android 工程,其中相关参数设置如下:

  Project name:MallFinder

  Build Target: Google APIs Platform – 2.1 API Level 7

  Application Name: Mall Finder

  Package Name: com.shawnbe.mallfinder

  Create Activity: MallFinderActivity

  MinimumSDK: 7

  如下图所示:

  步骤2 注册Google Map API key

  由于在使用google map的时候,需要使用google map api的key,因此需要先注册一个开发者key,可以到如下地址进行注册:http://code.google.com/android/add-ons/google-apis/mapkey.html ,其中需要我们先产生开发期间的md5 密纹才能完成注册,因此我们先学习如何生成一个MD5密纹。

  我们需要使用keytool工具,不使用传统的命令行方式下那枯燥的证书签名生成办法,而是直接在eclipse下通过插件进行完成,详细见步骤3

  步骤3 安装keytool插件

  在eclipse的Help菜单中,如下图,选择安装新软件:

  在安装地址中输入如下地址:http://www.keytool.sourceforge.net/update  ,如下图

  接下来会加载相关的安装程序,并显示用户协议,选择接受所有用户协议后进行安装,安装成功后重新启动eclipse即可生效。

  步骤4 产生开发期间的MD5密钥

  在重新启动eclipse后,会发现工具栏多了如下图的keytool菜单

  现在,我们打开debug.keystore,注意其位置回因操作系统不同而有不同

  Windows Vista : C:\Users\\.android\debug.keystore

  Windows XP : C:\Documents and Settings\\.android\debug.keystore

  OS X 和 Linux : ~/.android/debug.keystore

  点keytool菜单中,选择open keystore,根据提示,选择当前系统所在的debug.keystore位置并打开,如下图,

  其中,输入密码默认为android即可,并点Load加载。之后会在eclipse中出现新的keytool的视图,如下图所示:

  双击打开androiddebugkey,复制其md5密纹,然后访问页面

  http://code.google.com/android/maps-api-signup.html ,接受其协议,将md5密纹复制进去,再点Generate API Key,即产生google map的api key,记得保存好这个KEY,在接下来的步骤中要使用。

  步骤5 增加MapView控件

  接下来,我们可以往布局文件中增加MapView控件。我们在main.xml中添加如下代码:

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" > 
    <FrameLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"> 
        <com.google.android.maps.MapView
        android:id="@+id/mapView"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:clickable="true"
        android:apiKey="你的GOOGLE MAP API KEY "/> 
    </FrameLayout> 
</LinearLayout>

  在这个控件中,请注意要在android:apiKey的位置填入刚申请的google map api key。

  步骤6 设置相关的权限

  由于我们的应用需要调用Google Map的数据,以及通过手机的GPS获得相关的其他地理位置数据,因此我们必须在Android的Manifest文件中进行权限的设置。

  我们打开AndroidManifest.xml文件,然后增加如下代码所示的权限设置,注意添加在标签后,但要在标签前。

<uses-feature android:name="android.hardware.location.gps"/> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <uses-permission android:name="android.permission.INTERNET"/>

  在这里,我们分别调用了gps位置服务权限,使用互联网的权限以及使用最佳位置查找的权限(FINE_LOCATION)。在本文中,其实没用到FINE_LOCATION,但只是告诉开发者可以调整使用不同的地理位置提供者(providers)以提供准确的位置服务,如果要有比较精确的地理位置服务,那么可以设置android.permisson.ACCESS_FINE_LOCATION服务。要注意的是在开发中,不要过多引用一些不需要使用的权限设置,否则会给用户带来担忧安全等问题。要是只想调用一般的位置服务,可以使用普通的android.permission.ACCESS_COARSE_LOCATION权限。

  为了在应用中使用Google Map,需要在Manifest文件中包含相关的类库文件,所以加入如下代码:

<uses-library android:required="true" android:name="com.google.android.maps" />

  为了视觉的美观,我们把标题栏也去掉,以便留给地图更大的空间,所以设置为

  android:theme="@android:style/Theme.NoTitleBar"

  下面是完整的Manifest文件代码:

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.shawnbe.mallfinder"
    android:versionCode="1"
    android:versionName="1.0" > 
    <uses-sdk android:minSdkVersion="7" /> 
    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.NoTitleBar"> 
        <activity
            android:label="@string/app_name"
            android:name=".MallFinderActivity" > 
            <intent-filter > 
                <action android:name="android.intent.action.MAIN" /> 
  
                <category android:name="android.intent.category.LAUNCHER" /> 
            </intent-filter> 
        </activity> 
        <uses-library android:required="true" android:name="com.google.android.maps" /> 
    </application> 
    <uses-feature android:name="android.hardware.location.gps"/> 
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> 
    <uses-permission android:name="android.permission.INTERNET"/> 
</manifest>

  步骤7 设置MapView

  下面对主activity程序(MallFinderActivity.java)进行修改,首先让其继承MapActivity类,如下:

  public class MallFinderActivity extends MapActivity {

  由于继承了MapActivity类,因此必须实现isRouteDisplayed方法,这个方法是用来做路线导航用的,这里我们不需要,因此只需要简单返回false即可:

  @Override

  protected boolean isRouteDisplayed() {

  // TODO Auto-generated method stub

  return false;

  }

  接下来我们就可以声明MapController控件,并对其进行相关属性的设置了,首先是声明控件

  private MapController mapController;

  private MapView mapView;

  并在oncreate方法中进行属性设置如下:

mapView = (MapView)findViewById(R.id.mapView); 
mapView.setBuiltInZoomControls(true); 
mapView.setSatellite(false); 
mapView.setStreetView(true); 
mapController = mapView.getController(); 
mapController.setZoom(13);

  在上面的代码中,设置了地图显示的方式为街道模式(通过设置mapview的setStreetView属性值为true),并且通过mapView.setBuiltInZoomControls(true); 使用了系统内置的放大缩小功能,并设置了地图的放大缩小倍数为13。

  这个时候我们就可以选择运行应用,看下是否符合我们的初步预期效果,运行后效果如下图:

  步骤8 获得当前所在位置

  在LBS应用中,十分重要的工作是要获得当前设备所在的位置,这个可以使用locationManager类实现,在获得当前位置的时候是需要花费一些时间的。我们继续声明两个参数变量如下:

  private LocationManager locationManager;

  private GeoPoint currentLocation;

  分别声明了LocationManager类的实例和GeoPoint类的实例(用于下文中的经纬度的计算)。

  再增加如下几个方法:

public void getLastLocation(){ 
    String provider = getBestProvider(); 
    currentLocation = locationManager.getLastKnownLocation(provider); 
    if(currentLocation != null){ 
        setCurrentLocation(currentLocation); 
    } 
    else
    { 
        Toast.makeText(this, "Location not yet acquired", Toast.LENGTH_LONG).show(); 
    } 

  
public void animateToCurrentLocation(){ 
    if(currentPoint!=null){ 
        mapController.animateTo(currentPoint); 
    } 

  
public String getBestProvider(){ 
    locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); 
    Criteria criteria = new Criteria(); 
    criteria.setPowerRequirement(Criteria.NO_REQUIREMENT); 
    criteria.setAccuracy(Criteria.NO_REQUIREMENT); 
    String bestProvider = locationManager.getBestProvider(criteria, true); 
    return bestProvider; 

  
public void setCurrentLocation(Location location){ 
    int currLatitude = (int) (location.getLatitude()*1E6); 
    int currLongitude = (int) (location.getLongitude()*1E6); 
    currentLocation = new GeoPoint(currLatitude,currLongitude); 
  
    currentLocation = new Location(""); 
    currentLocation.setLatitude(currentPoint.getLatitudeE6() / 1e6); 
    currentLocation.setLongitude(currentPoint.getLongitudeE6() / 1e6); 
}

  并且在oncreate方法中,添加对以上方法的调用代码如下:

public void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
    setContentView(R.layout.main); 
    mapView = (MapView)findViewById(R.id.mapView); 
    mapView.setBuiltInZoomControls(true); 
    mapView.setSatellite(false); 
    mapView.setStreetView(true); 
    mapController = mapView.getController(); 
    mapController.setZoom(13); 
    getLastLocation(); 
    animateToCurrentLocation(); 
}

  首先,在getLastLocation这个方法中,创建了locationManager类的实例并且根据设置的条件返回一个合适的地理位置提供方法。在这里,我们并没有指定对地理位置提供者的查询条件,在实际应用中,开发者可以通过设置criteria.setAccuracy()和criteria.setPowerRequirement()方法进行查找。如果要使用最精确的provider的话,可以设置使用ACCURACY_FINE方法进行搜索,如下代码所示:

  criteria.setAccuracy(Criteria.ACCURACY_FINE);

  在本文中之所以不选择使用最准确的位置provider主要是因为是没在室外进行测试,都是在室内调试程序,建议开发完后换成GPS模式provider到室外进行调试那样将看到很好的效果。

  接下来代码中使用 currentLocation = locationManager.getLastKnownLocation(provider); 一句,获得最新的位置信息,并且在setCurrentLocation方法中,对通过prodiver获得的地理位置信息Location对象进行经纬度的转换为GeoPoint对象。然后调用animateToCurrentLocation方法,将地图的中心点定位到我们当前的位置上去。

  此外,由于我们的位置是会发生变化的,所以需要使用location 监听器去检测我们的位置变化,这时需要实现locationListener接口,如下所示:

  public class MallFinderActivity extends MapActivity implements LocationListener{

  同时我们需要实现LocationListener类的以下几个方法:

@Override
public void onLocationChanged(Location arg0) { 
    // TODO Auto-generated method stub 

  
@Override
public void onProviderDisabled(String arg0) { 
    // TODO Auto-generated method stub 

  
@Override
public void onProviderEnabled(String arg0) { 
    // TODO Auto-generated method stub 

  
@Override
public void onStatusChanged(String arg0, int arg1, Bundle arg2) { 
    // TODO Auto-generated method stub 
}

  其中这里我们关心的是需要实现onLocationChanged方法,这里我们调用之前编写好的setlocation方法,获得当前的最新位置,如下:

@Override
public void onLocationChanged(Location newLocation) { 
    // TODO Auto-generated method stub 
    setCurrentLocation(newLocation); 
}

  为了完善程序,在程序处在onResume及onPause状态下都能及时更新地理位置信息以及取消更新,加上如下代码:

@Override
protected void onResume() { 
    super.onResume(); 
    locationManager.requestLocationUpdates(getBestProvider(), 1000, 1, this); 

  
@Override
protected void onPause() { 
    super.onPause(); 
    locationManager.removeUpdates(this); 
}

  小结

  在本系列的第一讲中,分步讲解了如何注册Google API KEY以及Mapview控件基本方法的使用,还有让读者了解到使用google map的初步步骤,在下一讲中,将指导读者如何对地图上的位置进行标注。

Android Google Map API使用的八个步骤的更多相关文章

  1. 如何使用Google Map API开发Android地图应用

    两年前开发过的GoogleMap已经大变样,最近有项目要用到GoogleMap,重新来配置Android GoogleMap开发环境,还真是踩了不少坑. 一.下载Android SDK Manager ...

  2. Android中Google地图路径导航,使用mapfragment地图上画出线路(google map api v2)详解

    在这篇里我们只聊怎么在android中google map api v2地图上画出路径导航,用mapfragment而不是mapview,至于怎么去申请key,manifest.xml中加入的权限,系 ...

  3. Google Map API 使用总结

    Google Map API (一):显示一个最基本的地图 1 实现一个地图:<head>中引用: <script type="text/javascript" ...

  4. google map api v2的使用详细过程,图文并茂(原创)

    上一篇中说到怎么获取key,下面来介绍怎么使用key来显示google地图 步骤1:eclipse上打开android SDK Manager,安装google play services. 步骤2: ...

  5. Google Map API key 获取方法

    要想使用google map api 必须从google网站上获取key之后才有权限使用,但是要想申请key必须要有证明书,也就是所谓的MD5.下面一步一步来说明: 步骤1: 如果你使用的是eclip ...

  6. Google Map API v2 步步为营(一) ----- 初见地图

    官方文档:https://developers.google.com/maps/documentation/android/start?hl=zh-CN 先谷歌后百度.使用google的api基本上按 ...

  7. (6)Xamarin.android google map v2

    原文 Xamarin.android google map v2 Google Map v1已经在2013年的3月开始停止支持了,目前若要在你的Android手机上使用到Google Map,就必须要 ...

  8. Android Google Map v2具体解释:开发环境配置

    Android Google Map v2具体解释:开发环境配置                                       --转载请注明出处:coder-pig 说在前面: 说到地 ...

  9. android google map v1 v2 v3 参考

    V1,V2已经不被推荐使用,谷歌强烈推荐使用V3. 本人在选择时着实纠结了良久,现在总结如下: 对于V1,现在已经申请不到API KEY了,所以不要使用这个版本.这个是网址:https://devel ...

随机推荐

  1. httpd服务相关实验

    实验环境: CentOS6.8 1.连接测试: 在/etc/httpd/conf/httpd.conf telnet 172.16.252.242 80 GET /index.html HTTP/1. ...

  2. 南阳oj水题集合,语言的灵活运用

    a+b 输入 输入两个数,a,b 输出 输出a+b的值 样例输入 2 3 样例输出 5 c/c++ #include<iostream> using namespace std; int ...

  3. jvm虚拟机androidy移植-编译篇

    有这个必要吗?都过时的东西了,android上的Dalvik效率不够高吗,不够逼格吗? 是的但有总东西是不是我们这些码农能决定的,领导和项目需求才是你要关心的,毕竟工作要向领导汇报,项目要去挣钱钱,但 ...

  4. [PE182]RSA encryption

    https://projecteuler.net/problem=182 题意: 找出满足下列条件的所有$e$ 的和, - $1 < e < \varphi \left( {1009,36 ...

  5. InnoSetup自动检测并安装.Net Framework

    InnoSetup可在在脚本中插入[Code]代码段,其中的代码可以通过事件驱动,支持的主要事件如下: function InitializeSetup(): Boolean; ——安装程序初始化,返 ...

  6. state estimation for robotics-1

    概率论是探讨SLAM的一个重要的工具,概率密度函数的概率意义在于它能够描述一个随机变量位于任意区间的概率. p(x<=x<=x+dx)≍p(x).dx(由拉格朗日中值定理)

  7. JAVA学习笔记——(三)

    今日内容介绍 1.引用类型变量的创建及使用 2.流程控制语句之选择语句 3.流程控制语句之循环语句 4.循环高级 01创建引用类型变量公式 * A: 创建引用类型变量公式 * a: 我们要学的Scan ...

  8. gitHub上传代码

    首先进入github官网注册一个帐号 00.png 注册完帐号之后创建一个项目 01.png 设置创建项目的信息 02.png 创建项目完之后复制项目的地址,以供后面下载项目使用 03.png 在桌面 ...

  9. rpm 软件包

    rpm 软件包   Linux 中有安装软件方式有两种,源码安装以及软件包安装: 压缩包:源码包,编译后安装 rpm(redhat package manager 红帽软件包管理):需要编译,直接安装 ...

  10. 2014-10-6 NOIP模拟赛

    1. 锻炼计划(exercise.pas) 身体是革命的本钱,OIers不要因为紧张的学习和整天在电脑前而忽视了健康问题.小x设计了自己的锻炼计划,但他不知道这个计划是否可行,换句话说如果计划不当可能 ...