自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

在OPhone應(yīng)用程序中使用傳感器和LBS

移動開發(fā)
OPhone是中國移動最新的手機平臺,基于Google Android系統(tǒng)并與Android兼容。在3G時代,基于OPhone的手機應(yīng)用將充分發(fā)揮智能手機的運算能力和無線網(wǎng)絡(luò)功能,為消費者帶來豐富的無線應(yīng)用體驗,同時為開發(fā)者帶來不菲的回報。

OPhone平臺內(nèi)置了非常多的傳感器,通過最新的硬件技術(shù)配合強大的系統(tǒng)API,開發(fā)者可以輕松調(diào)用手機內(nèi)置的傳感器,編寫極具特色的非常適合移動設(shè)備使用的應(yīng)用程序,為用戶帶來更強的移動應(yīng)用體驗。
本文以最常用的重力傳感器和位置傳感器為例,詳細介紹如何在OPhone平臺上開發(fā)基于傳感器的應(yīng)用。
 
搭建OPhone開發(fā)環(huán)境

為了開發(fā)OPhone應(yīng)用程序,我們需要首先搭建OPhone開發(fā)環(huán)境。目前,OPhone開發(fā)平臺支持Windows和Linux,可以參考“RSS Reader實例開發(fā)之搭建OPhone開發(fā)環(huán)境”一文搭建OPhone開發(fā)環(huán)境。

使用重力傳感器

重力傳感器是OPhone應(yīng)用中最常用的一種傳感器,它用于探測手機在各個方向的傾斜角度。重力傳感器一共有X,Y,Z三個方向的傳感數(shù)據(jù),X,Y,Z軸定義如下:

 

當(dāng)手機沿某個軸左右晃動時,傳感器將返回-9.81至+9.81之間的數(shù)值,表示手機的傾斜角度??梢岳斫鉃閷⒁粋€小球放在手機當(dāng)前位置時的重力加速度。當(dāng)手機水平放置時,小球的重力加速度是0:

 

當(dāng)手機垂直放置時,小球的重力加速度是9.81:

 

當(dāng)手機以一定傾斜角放置時,小球的重力加速度介于0和9.81之間:

 


實際的返回值為-9.81至+9.81,使用正負是為了區(qū)分手機的兩種方向的傾斜。通過X、Y、Z三個軸返回的重力加速度,就可以完全確定當(dāng)前手機的旋轉(zhuǎn)位置。
重力傳感器對于開發(fā)感應(yīng)游戲來說至關(guān)重要,由于手機按鍵的限制,使用鍵盤的上下左右鍵控制游戲很不容易,而重力傳感器則能讓玩家通過晃動手機來控制游戲,帶來更好更具特色的游戲體驗。著名的手機游戲“平衡木”就完全依靠重力傳感器來讓玩家控制游戲:

 


下面,我們用一個實際例子來演示如何使用重力傳感器。這個簡化版的“平衡木”例子將在手機屏幕中央繪制一個小球,當(dāng)用戶晃動手機時,小球也將上下左右移動。#t#

我們新建一個OPhone工程,命名為Accelerometer,然后,編輯XML布局。我們在LinearLayout中放置一個TextView,用于顯示重力傳感器返回的數(shù)值,一個FrameLayout,包含一個自定義的BallView,內(nèi)容如下:

  1. xml version="1.0" encoding="utf-8"?>     
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    
  3.     android:orientation="vertical"    
  4.     android:layout_width="fill_parent"    
  5.     android:layout_height="fill_parent"    
  6. >      
  7.     <TextView xmlns:android=  
  8. "http://schemas.android.com/apk/res/android"    
  9.         android:id="@+android:id/ball_prompt"    
  10.         android:layout_width="fill_parent"    
  11.         android:layout_height="wrap_content"    
  12.         android:text="Sensor: 0, 0, 0"    
  13.     />     
  14.     <FrameLayout xmlns:android=  
  15. "http://schemas.android.com/apk/res/android"    
  16.         android:id="@+android:id/ball_container"    
  17.         android:layout_width="fill_parent"    
  18.         android:layout_height="fill_parent"    
  19.     >     
  20.         <org.expressme.wireless.accelerometer.BallView xmlns:android=  
  21. "http://schemas.android.com/apk/res/android"    
  22.             android:id="@+android:id/ball"    
  23.             android:src="@drawable/icon"    
  24.             android:scaleType="center"    
  25.             android:layout_width="wrap_content"    
  26.             android:layout_height="wrap_content"    
  27.         />     
  28.     FrameLayout>     

BallView派生自ImageView,主要通過moveTo(x,y)方法方便地將小球移動到指定的位置:

  1. public class BallView extends ImageView {     
  2.     public BallView(Context context) {     
  3.         super(context);     
  4.     }     
  5.       
  6.     public BallView(Context context, AttributeSet attrs) {     
  7.         super(context, attrs);     
  8.     }     
  9.       
  10.     public BallView(Context context, AttributeSet attrs, int defStyle) {     
  11.         super(context, attrs, defStyle);     
  12.     }     
  13.       
  14.     public void moveTo(int l, int t) {     
  15.         super.setFrame(l, t, l + getWidth(), t + getHeight());     
  16.     }     
  17. }    

下面,我們就需要在MainActivity中編寫主要邏輯,獲得重力傳感器返回的數(shù)值。重力傳感器的API主要是SensorManager和Sensor,在Activity的onCreate()方法中,我們可以獲得系統(tǒng)的SensorManager實例,然后,再獲得對應(yīng)的Sensor實例:

  1. public class MainActivity extends Activity {     
  2.     SensorManager sensorManager = null;     
  3.     Sensor sensor = null;     
  4.       
  5.     @Override    
  6.     public void onCreate(Bundle savedInstanceState) {     
  7.         super.onCreate(savedInstanceState);     
  8.         setContentView(R.layout.main);     
  9.         prompt = (TextView) findViewById(R.id.ball_prompt);     
  10.         sensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);     
  11.         sensor = sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);     
  12.     }     
  13.     ...     
  14. }    

我們編寫一個register()方法,用于向SensorManager注冊SensorEventListener,然后,在SensorEventListener中響應(yīng)onSensorChanged事件,并處理即可。而unregister()方法則取消已注冊的SensorEventListener。
 
SensorEventListener的onSensorChanged事件將返回SensorEvent對象,包含Sensor的最新數(shù)據(jù),通過e.values獲得一個float[]數(shù)組。對于不同的Sensor類型,其數(shù)組包含的元素個數(shù)是不同的,重力傳感器總是返回一個長度為3的數(shù)組,分別代表X、Y和Z方向的數(shù)值。Z軸表示了手機是屏幕朝上還是屏幕朝下,一般不常用,我們主要關(guān)心X軸和Y軸的數(shù)值,以便能通過(x,y)定位小球在屏幕中的位置。通過重力傳感器的X、Y值可以很容易地定位小球的位置:

  1. public class MainActivity extends Activity {     
  2.     private static final float MAX_ACCELEROMETER = 9.81f;     
  3.       
  4.     // x, y is between [-MAX_ACCELEROMETER, MAX_ACCELEROMETER]     
  5.     void moveTo(float x, float y) {     
  6.         int max_x = (container_width - ball_width) / 2;     
  7.         int max_y = (container_height - ball_height) / 2;     
  8.         int pixel_x = (int) (max_x * x / MAX_ACCELEROMETER + 0.5);     
  9.         int pixel_y = (int) (max_y * y / MAX_ACCELEROMETER + 0.5);     
  10.         translate(pixel_x, pixel_y);     
  11.     }     
  12.       
  13.     void translate(int pixelX, int pixelY) {     
  14.         int x = pixelX + container_width / 2 - ball_width / 2;     
  15.         int y = pixelY + container_height / 2 - ball_height / 2;     
  16.         ball.moveTo(x, y);     
  17.     }     
  18. }    

調(diào)用SensorManager的getDefaultSensor()就可以獲得Sensor實例,這里,我們傳入Sensor.TYPE_ACCELEROMETER,表示要獲得重力傳感器的實例。#p#
然后,我們需要向SensorManager對象注冊一個SensorEventListener,這樣,當(dāng)Sensor變化時,我們就能獲得通知:

  1. public class MainActivity extends Activity {     
  2.     SensorEventListener listener = new SensorEventListener() {     
  3.         public void onSensorChanged(SensorEvent e) {     
  4.             if (!init)     
  5.                 return;     
  6.             float x = e.values[SensorManager.DATA_X];     
  7.             float y = e.values[SensorManager.DATA_Y];     
  8.             float z = e.values[SensorManager.DATA_Z];     
  9.             prompt.setText("Sensor: " + x + ", " + y + ", " + z);     
  10.             moveTo(-x, y);     
  11.         }     
  12.       
  13.         public void onAccuracyChanged(Sensor s, int accuracy) {     
  14.         }     
  15.     };     
  16.       
  17.     void register() {     
  18.         sensorManager.registerListener(listener, sensor, SensorManager.SENSOR_DELAY_GAME);     
  19. }     
  20.       
  21.     void unregister() {     
  22.         sensorManager.unregisterListener(listener);     
  23.     }     
  24. }    

需要注意的是,如何獲得小球即BallView的大小,以及其容器FrameLayout的大小。在onCreate()方法中獲取時我們發(fā)現(xiàn),BallView和FrameLayout總是返回0,原因是OPhone系統(tǒng)在首次將UI組件繪制到屏幕之前,無法確定UI組件的具體大小,因此,getWidth()和getHeight()將返回0。那么,我們在何時才能獲取UI組件的實際大小呢?答案仍然是第一次繪制UI組件時。由于第一次繪制UI組件會觸發(fā)Focus事件,因此,我們可以響應(yīng)onWindowFocusChanged()事件,在這里調(diào)用getWidth()和getHeight()能安全地返回UI組件的實際大小,因為此時Activity已繪制到手機屏幕。注意:布爾變量init用來保證僅第一次獲得焦點時進行初始化:

  1. public class MainActivity extends Activity {     
  2.     boolean init = false;     
  3.     int container_width = 0;     
  4.     int container_height = 0;     
  5.     int ball_width = 0;     
  6.     int ball_height = 0;     
  7.       
  8.     @Override    
  9.     public void onWindowFocusChanged(boolean hasFocus) {     
  10.         super.onWindowFocusChanged(hasFocus);     
  11.         if (hasFocus && !init) {     
  12.             init();     
  13.             init = true;     
  14.         }     
  15.     }     
  16.       
  17.     void init() {     
  18.         View container = findViewById(R.id.ball_container);     
  19.         containercontainer_width = container.getWidth();     
  20.         containercontainer_height = container.getHeight();     
  21.         ball = (BallView) findViewById(R.id.ball);     
  22.         ballball_width = ball.getWidth();     
  23.         ballball_height = ball.getHeight();     
  24.         moveTo(0f, 0f);     
  25.     }     
  26. }    

此外,傳感器也是手機的系統(tǒng)資源,在不必要的時候我們應(yīng)當(dāng)及時釋放資源。我們需要在onStart()、onResume()和onRestart()事件中注冊,在onPause()、onStop()和onDestroy()事件中取消注冊:#p#

  1. public class MainActivity extends Activity {     
  2.     @Override    
  3.     protected void onStart() {     
  4.         super.onStart();     
  5.         register();     
  6.     }     
  7.       
  8.     @Override    
  9.     protected void onResume() {     
  10.         super.onResume();     
  11.         register();     
  12.     }     
  13.       
  14.     @Override    
  15.     protected void onRestart() {     
  16.         super.onRestart();     
  17.         register();     
  18.     }     
  19.       
  20.     @Override    
  21.     protected void onPause() {     
  22.         super.onPause();     
  23.         unregister();     
  24.     }     
  25.       
  26.     @Override    
  27.     protected void onStop() {     
  28.         super.onStop();     
  29.         unregister();     
  30.     }     
  31.       
  32.     @Override    
  33.     protected void onDestroy() {     
  34.         super.onDestroy();     
  35.         unregister();     
  36.     }     
  37. }    
  38.  
  39. public class MainActivity extends Activity { @Override protected void onStart() { super.onStart(); register(); } @Override protected void onResume() { super.onResume(); register(); } @Override protected void onRestart() { super.onRestart(); register(); } @Override protected void onPause() { super.onPause(); unregister(); } @Override protected void onStop() { super.onStop(); unregister(); } @Override protected void onDestroy() { super.onDestroy(); unregister(); } }  
  40.    

運行模擬器,運行效果如下:

 

由于模擬器無法模擬重力傳感器,因此,這個應(yīng)用程序需要在真機上才能看到實際效果,感興趣的讀者可以在真機上運行。
 
使用位置服務(wù)
位置服務(wù)是OPhone系統(tǒng)中另一種應(yīng)用非常廣泛的傳感器。通過位置服務(wù),開發(fā)基于位置的手機應(yīng)用將為用戶帶來非常有價值的服務(wù),如地圖導(dǎo)航、餐廳搜索等等。
 
OPhone系統(tǒng)提供的基于位置的Location API可以提供GPS、AGPS和NETWORK三種模式的導(dǎo)航。其中,GPS是使用最廣泛的衛(wèi)星導(dǎo)航,我們可以利用GPS定位,開發(fā)出非常具有特色的手機應(yīng)用。

下面,我們以一個具體的例子來演示如何使用位置服務(wù)。我們利用手機內(nèi)置的GPS定位,通過Google地圖顯示當(dāng)前手機用戶所處的位置。

我們首先新建一個OPhone工程,命名為Location。Location API提供的主要接口是LocationManager和LocationListener。首先,我們需要在Activity的onCreate()事件中獲取LocationManager的實例,并創(chuàng)建LocationListener實例:

  1. public class MainActivity extends Activity {     
  2.     private LocationManager locationManager;     
  3.     private LocationListener locationListener;     
  4.     
  5.     @Override    
  6.     public void onCreate(Bundle savedInstanceState) {     
  7.         super.onCreate(savedInstanceState);     
  8.         setContentView(R.layout.main);     
  9.         locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);     
  10.         locationListener = new LocationListener() {     
  11.             public void onLocationChanged(Location newLocation) {     
  12.                 MainActivity.this.onLocationChanged(newLocation);     
  13.             }     
  14.             public void onProviderDisabled(String provider) {     
  15.             }     
  16.              public void onProviderEnabled(String provider) {     
  17.             }     
  18.             public void onStatusChanged(String provider, int status, Bundle extras) {     
  19.             }     
  20.         };     
  21.     }     
  22.     
  23.     private void onLocationChanged(Location newLocation) {     
  24.     }     
  25. }    

和使用重力傳感器類似,我們需要將LocationListener注冊到LocationManager,因此,在onStart()、onRestart()和onResume()事件中注冊,在onStop()和onDestroy()事件中取消注冊:

  1. public class MainActivity extends Activity {     
  2.     @Override    
  3.     protected void onStart() {     
  4.         super.onStart();     
  5.         register();     
  6.     }     
  7.     
  8.     @Override    
  9.     protected void onRestart() {     
  10.         super.onRestart();     
  11.         register();     
  12.     }     
  13.     
  14.     @Override    
  15.     protected void onResume() {     
  16.         super.onResume();     
  17.         register();     
  18.     }     
  19.     
  20.     @Override    
  21.     protected void onStop() {     
  22.         super.onStop();     
  23.         unregister();     
  24.     }     
  25.     
  26.     @Override    
  27.     protected void onDestroy() {     
  28.         super.onDestroy();     
  29.         unregister();     
  30.     }     
  31.     
  32.     private void register() {     
  33.         locationManager.requestLocationUpdates(     
  34.                 LocationManager.GPS_PROVIDER,     
  35.                 10000L,     
  36.                 0,     
  37.                 locationListener     
  38.         );     
  39.     }     
  40.     
  41.     private void unregister() {     
  42.         locationManager.removeUpdates(locationListener);     
  43.     }     
  44. }    

注冊是通過requestLocationUpdates()方法完成的,第一個參數(shù)指定了位置服務(wù)的提供者,這里是GPS_PROVIDER,第二個和第三個參數(shù)指定了發(fā)送位置更新的最小時間間隔和最小距離間隔。我們指定了發(fā)送位置更新的時間間隔不小于10秒,而最小距離不限。最后一個參數(shù)是LocationListener的實例。注冊后,就可以在onLocationChanged()事件中獲得當(dāng)前的Location。OPhone系統(tǒng)傳入一個Location對象,使用如下代碼即獲得當(dāng)前位置的經(jīng)度和緯度:

  1. double lat = newLocation.getLatitude();     
  2. double lng = newLocation.getLongitude();    

有了經(jīng)度和緯度,我們就可以在Google地圖中做出標記,讓用戶在地圖上看到自己的當(dāng)前位置。

Google API提供了MapView,可以直接顯示Google地圖,并方便地對其進行控制。而OPhone 1.5 SDK并不包含Google API,因此,我們就無法使用MapView了,怎么辦?答案是自己動手,豐衣足食。MapView歸根結(jié)底也是在WebView基礎(chǔ)上封裝而成的,我們完全可以在WebView中顯示Google地圖并對其進行控制。#p#

我們首先在XML布局中添加一個WebView:

  1. xml version="1.0" encoding="utf-8"?>     
  2. <FrameLayout xmlns:android=  
  3. "http://schemas.android.com/apk/res/android"    
  4.     android:layout_width="fill_parent"    
  5.     android:layout_height="fill_parent"    
  6. >      
  7.     <WebView     
  8.         android:id="@+android:id/webview"    
  9.         android:layout_width="fill_parent"    
  10.         android:layout_height="fill_parent"    
  11.     />     
  12. FrameLayout>    

WebView本質(zhì)上就是瀏覽器,它和OPhone系統(tǒng)自帶的瀏覽器完全一樣。既然系統(tǒng)瀏覽器可以直接顯示Google地圖,那么,我們使用WebView也能顯示Google地圖。編寫一個簡單的HTML頁面如下:

  1. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">     
  2. <html xmlns="http://www.w3.org/1999/xhtml">     
  3.     <head>     
  4.         <meta http-equiv="content-type" content="text/html; charset=utf-8"/>     
  5.         <title>Maptitle>     
  6.         <script src="http://ditu.google.cn/maps?hl=zh-CN&file=api&v=2&sensor=true&key=ABQIAAAANv4vRQVBvuMJA6tyhpEVYhT2yXp_ZAY8_ufC3CFXhHIE1NvwkxS5EvCTylQAqE2076RlFUaSV7w-gA" type="text/javascript">script>     
  7.         <script type="text/javascript">     
  8.             var g_map = null;     
  9.             var g_marker = null;     
  10.       
  11.             function getParam(_param) {     
  12.                 var query = location.search.substring(1);     
  13.                 var pairs = query.split("&");     
  14.                 for(var i=0;i<pairs.length;i++) {     
  15.                     var pos = pairs[i].indexOf("=");     
  16.                     if(pos==-1)     
  17.                         continue;     
  18.                     var argname=pairs[i].substring(0,pos);     
  19.                     if(argname==_param) {     
  20.                         var value=pairs[i].substring(pos+1).replace(/\+/g,' ');     
  21.                         return decodeURIComponent(value);     
  22.                     }     
  23.                }     
  24.                 return null;     
  25.             }     
  26.       
  27.             function initialize() {     
  28.                 d = document.getElementById("map_canvas");     
  29.                 sw = getParam("w");     
  30.                 sh = getParam("h");     
  31.                 if (sw!=null && sh!=null) {     
  32.                     w = parseInt(sw);     
  33.                     h = parseInt(sh);     
  34.                     d.style.width = w + "px";     
  35.                     d.style.height = h + "px";     
  36.                 }     
  37.                 lat = parseFloat(getParam("lat"));     
  38.                 lng = parseFloat(getParam("lng"));     
  39.                 map = new GMap2(d);     
  40.                 map.setCenter(new GLatLng(lat, lng), 14);     
  41.                 setMarker(lat, lng);     
  42.             }     
  43.       
  44.             function setMarker(lat, lng) {     
  45.                 if (g_marker!=null)     
  46.                     map.removeOverlay(g_marker);     
  47.                 ll = new GLatLng(lat, lng);     
  48.                 g_marker = new GMarker(ll);     
  49.                 map.addOverlay(g_marker);     
  50.                 map.panTo(ll);     
  51.             }     
  52.         script>     
  53.     head>     
  54.     <body onload="initialize()"      
  55.           onunload="GUnload()"    
  56.           style="margin: 0px; padding: 0px">     
  57.         <div id="map_canvas" style="width: 260px; height: 300px">div>     
  58.     body>     
  59. html>    

其中,導(dǎo)入Google地圖是通過JavaScript完成的:

  1. <script src="http://ditu.google.cn/maps?...">script>  


為了控制地圖標記的顯示,我們編寫了一個JavaScript函數(shù):

  1. function setMarker(lat, lng) { ... }   

稍候我們會講解如何調(diào)用這個JavaScript函數(shù)。
 
由于Google地圖需要開發(fā)者申請一個Key才能使用,盡管申請Key是免費的,但是,不同的域名會對應(yīng)不同的Key,為了簡化應(yīng)用程序的開發(fā),我們直接使用localhost的Key,并通過如下代碼將上面的HTML頁面載入到WebView中,告訴WebView當(dāng)前導(dǎo)航地址是http://localhost/map.html,這樣,應(yīng)用程序就無需再申請Key了:

  1. webView.loadDataWithBaseURL  
  2. ("http://localhost/map.html?lat=0&lng=0&w=" +   
  3. webView.getWidth() + "&h=" + webView.getHeight(), loadHtml(), "text/html", "UTF-8", null);   

從assets中讀取文件內(nèi)容的loadHtml()方法如下:

  1. String loadHtml() {     
  2.     InputStream input = null;     
  3.     try {     
  4.         input = getAssets().open("map.html");     
  5.         ByteArrayOutputStream result = new ByteArrayOutputStream(4096);     
  6.         byte[] buffer = new byte[1024];     
  7.         for (;;) {     
  8.             int n = input.read(buffer);     
  9.             if (n==(-1))     
  10.                 break;     
  11.             result.write(buffer, 0, n);     
  12.         }     
  13.         return result.toString("UTF-8");     
  14.     }     
  15.     catch (IOException e) {     
  16.         return "";     
  17.     }     
  18.     finally {     
  19.         if (input!=null) {     
  20.             try {     
  21.                 input.close();     
  22.             }     
  23.             catch (IOException e) {}     
  24.         }     
  25.     }     
  26. }    

這里需要注意的要點是,更新WebView需要在UI線程中進行,通過Handler.post()方法很容易實現(xiàn),而調(diào)用JavaScript函數(shù)則通過loadUrl("javascript:函數(shù)名(參數(shù))")就完成了,非常簡單。

  1. void onLocationChanged(Location newLocation) {     
  2.     final double lat = newLocation.getLatitude();     
  3.     final double lng = newLocation.getLongitude();     
  4.     handler.post(     
  5.             new Runnable() {     
  6.                 public void run() {     
  7.                     webView.loadUrl  
  8. ("javascript:setMarker(" + lat + "," + lng + ")");     
  9.                 }     
  10.             }     
  11.     );     
  12. }    

運行代碼,我們發(fā)現(xiàn),調(diào)用該JavaScript函數(shù)不起作用,原因是WebView默認狀態(tài)不啟用JavaScript功能,因此,還需要在Activity的onCreate()中添加一點初始化代碼,順便將WebView的滾動條去掉:

  1. @Override    
  2. public void onCreate(Bundle savedInstanceState) {     
  3.     super.onCreate(savedInstanceState);     
  4.     setContentView(R.layout.main);     
  5.     webView = (WebView) findViewById(R.id.webview);     
  6.     webView.getSettings().setJavaScriptEnabled(true);     
  7.     webView.setVerticalScrollBarEnabled(false);     
  8.     webView.setHorizontalScrollBarEnabled(false);     
  9. }    

最后,不要忘記在AndroidManifest.xml中添加權(quán)限聲明,我們需要網(wǎng)絡(luò)訪問權(quán)限和位置訪問權(quán)限:

  1. <uses-permission android:name="android.permission.INTERNET" />     
  2. <uses-permission android:name=  
  3. "android.permission.ACCESS_FINE_LOCATION" /> 

運行模擬器,我們可以通過Emulator Control向模擬器發(fā)送經(jīng)度和緯度數(shù)據(jù),應(yīng)用程序運行效果如下:

 

通過對assets資源的國際化,我們還可以在一個應(yīng)用程序中針對中英文用戶分別顯示中文地圖和英文地圖:

 

在真機上運行該應(yīng)用程序時,隨著用戶的移動,地圖會自動跟蹤并刷新用戶的當(dāng)前位置。感興趣的讀者可以在真機上運行。

責(zé)任編輯:chenqingxiang 來源: ophonesdn
相關(guān)推薦

2009-09-22 12:17:59

ibmdwLotus

2009-06-19 13:45:53

Java應(yīng)用程序Jfreechart

2013-10-09 11:15:49

Ubuntu應(yīng)用程序

2011-05-27 08:48:13

Android HTML

2021-09-07 10:24:36

Vue應(yīng)用程序Web Workers

2025-03-09 08:45:36

2009-11-23 19:52:55

ibmdwFlex

2022-08-30 20:00:37

零信任Linkerd

2023-11-24 09:37:05

Linux數(shù)據(jù)

2010-03-16 10:00:24

無線傳感器

2009-02-17 09:56:00

2023-08-22 20:55:04

AzureLLMTypeChat

2009-08-27 11:22:30

ibmdw云計算

2009-11-20 16:04:40

網(wǎng)絡(luò)路由協(xié)議

2010-03-16 10:27:32

無線傳感器網(wǎng)絡(luò)

2021-08-20 13:32:45

傳感器物聯(lián)網(wǎng)智能音箱

2023-08-28 16:49:08

物聯(lián)網(wǎng)傳感器

2010-04-12 16:28:41

無線通信模塊

2020-03-21 20:18:28

物聯(lián)網(wǎng)Wi-Fi互聯(lián)網(wǎng)

2009-03-30 10:34:03

ASP.NETMySQL
點贊
收藏

51CTO技術(shù)棧公眾號