WEB开发网
开发学院手机开发Android 开发 Android 打开 GPS 导航并获取位置信息 阅读

Android 打开 GPS 导航并获取位置信息

 2010-10-19 17:18:28 来源:WEB开发网   
核心提示::name="android.permission.ACCESS_FINE_LOCATION"></uses-permission><uses-permission android:name="android.permission.ACCESS_MOCK_LOCAT
:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION"></uses-permission>
<uses-permission android:name="android.permission.UPDATE_DEVICE_STATS"></uses-permission>
 

 1 import android.app.Activity;
 2 import android.content.Context;
 3 import android.location.Criteria;
 4 import android.location.Location;
 5 import android.location.LocationListener;
 6 import android.location.LocationManager;
 7 import android.os.Bundle;
 8 import android.util.Log;
 9
10 public class audio extends Activity
11 {
12
13   /** Called when the activity is first created. */
14   LocationManager locationManager;
15   LocationListener llistener;
16   String provider;
17
18   public void onCreate(Bundle savedInstanceState)
19   {
20     super.onCreate(savedInstanceState);
21     setContentView(R.layout.main);
22
23     Criteria criteria = new Criteria();
24     criteria.setAccuracy(Criteria.ACCURACY_FINE);
25     criteria.setAltitudeRequired(false);
26     criteria.setBearingRequired(false);
27     criteria.setCostAllowed(true);
28     criteria.setPowerRequirement(Criteria.POWER_LOW);

上一页  1 2 3 4  下一页

Tags:Android GPS 导航

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接