2016-04-30 34 views
0

我基本上要提取的纬度和经度坐标通过GSM模块发送短信到Android智能手机短信坐标...提取纬度和经度使用应用发明

我写了一个简单的应用程序这需要纬度和经度作为使用应用发明

App Inventor code blocks enter image description here

欲基本上自动上复制所提取的纬度和经度的La在地图上输入并显示T和我的Android应用程序的长字段当过我收到一条短信从一个特定的号码

我怎样才能达到这个家伙....

+0

任何方法,任何教程链接将真的有帮助 –

+0

示例SMS文本是什么样子?纬度和经度之间是否有分隔符?使用[文本块](http://appinventor.mit.edu/explore/ai2/support/blocks/text.html)提取纬度和经度,并在该分隔符处分割。 – Taifun

+0

学习App Inventor的一个非常好的方法是在AI2免费在线电子书http://www.appinventor.org/book2中阅读免费的Inventor手册。这些链接位于网页的底部。这本书'教'用户如何编程AI2块。 这里有一个免费的编程课程http://www.appinventor.org/content/CourseInABox/Intro和书中项目的aia文件在这里:http://www.appinventor.org/bookFiles 如何使用App Inventor做很多基本的事情在这里描述:http://www.appinventor.org/content/howDoYou/eventHandling。 – Taifun

回答

0

所以你要听由GSM模块发送接收到的SMS。 基本上你需要一个BroadcastReceiver类来监听传入的消息。并提取经度和纬度。 Check this Link希望这有助于

public class SmsListener extends BroadcastReceiver{ 

private SharedPreferences preferences; 

@Override 
public void onReceive(Context context, Intent intent) { 
    // TODO Auto-generated method stub 

    if(intent.getAction().equals("android.provider.Telephony.SMS_RECEIVED")){ 
     Bundle bundle = intent.getExtras();   
     if (bundle != null){ 
      //retrieve the SMS message received 
     } 
    } 
} 
    } 
+0

先生,我正在使用应用发明者... –

+0

我不知道如何应用此代码 –