2011-10-27 78 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