2011-10-27 137 views

回答

1

使用CellID.A CellID是一個與特定單元(手機連接到的無線電塔)相關聯的數字。在大多數情況下,這是距離您所在位置最近的塔。所以通過了解這個塔的位置,你就可以知道手機在哪裏。

爲了更好的主意,看看這裏

Adding location to a non GPS phone: introducing CellID

現在,如果你知道你的朋友CELLID那麼你就可以知道他們的location.Another方式

Developing Location Based Services: Introducing the Location API for J2ME

+0

但android自帶gps技術,所以我們不能有任何基於gps的技術可以幫助我,因爲cell id會給最近的塔的位置而不是實際的位置,所以如果兩個朋友來到同一個塔的範圍內,它們的位置將是相同的但是實際上並非如此。所以請推薦一些其他技術? –

+0

在J2ME中,我使用Location API。J2ME規範的Location API定義了一個可選包javax.microedition.location,它使開發人員能夠爲資源受限設備(如手機)編寫基於位置的無線應用程序和服務,並且可以可以用任何常見的定位方法來實施。 http://developers.sun.com/mobility/apis/articles/location/ –

6

你永遠無法得到某人僅僅從移動號碼中刪除位置,就像跟蹤。

Google提供了一項名爲Latitude的服務,這是一個更好,合法的方法。


否則,如果兩種用途具有相同的應用程序,他們應該把他們的位置(從小區ID或GPS獲得)到Web服務器(你將處理)。然後您可以使用您的網絡服務交換位置座標。作爲參考,看看在表1 over here


代碼以檢測SMS消息

public class IncomingSmsCapture extends BroadcastReceiver { 
@Override 
public void onReceive(Context context, Intent intent) { 
Bundle bundle = intent.getExtras();  
SmsMessage[] msgs = null; 
String data = "";   
if (bundle != null) 
{ 
    Object[] pdus = (Object[]) bundle.get("pdus"); 
    msgs = new SmsMessage[pdus.length];   
    for (int i=0; i<msgs.length; i++){ 
    msgs[i] = SmsMessage.createFromPdu((byte[])pdus[i]);    
    String sender = msgs[i].getOriginatingAddress();  
    data = msgs[i].getMessageBody().toString(); 
    // parse the data and extract the location, then convert to an Address using the GeoCoder. 
} } } } 
+1

是絕對正確@Reno –

+0

是的,谷歌縱橫是非常好的,但我需要找到我的應用程序中的朋友的位置。可以解釋第二種方法(哪個需要Web服務器)? –

+0

[Google Latitude has api's](http://code.google.com/apis/latitude/v1/getting_started.html),您可以在應用程序中使用它。對於網絡服務器:我已經更新了現有的參考。 – Reno