1

I basically want to extract the latitude and longitude coordinates sent as sms by gsm module to an android smart phone ...

I have written an simple app which takes latitude and longitude as input and displays on the map using App Inventor

App Inventor code blocks enter image description here

I want to basically copy the extracted latitude and longitude automatically on to the lat and long fields of my android app when ever i receive an sms from a particular number

How can I achieve this guys....

Taifun
  • 6,165
  • 17
  • 60
  • 188
don joe
  • 41
  • 1
  • 6
  • any approaches ,, any tutorials links will really be helpful – don joe Apr 30 '16 at 14:56
  • How does an example SMS text look like? Is there a delimiter between latitude and longitude? Use the [text blocks](http://appinventor.mit.edu/explore/ai2/support/blocks/text.html) to extract latitude and longitude and split at that delimiter. – Taifun Apr 30 '16 at 17:29
  • A very good way to learn App Inventor is to read the free Inventor's Manual here in the AI2 free online eBook http://www.appinventor.org/book2 ... the links are at the bottom of the Web page. The book 'teaches' users how to program with AI2 blocks. There is a free programming course here http://www.appinventor.org/content/CourseInABox/Intro and the aia files for the projects in the book are here: http://www.appinventor.org/bookFiles How to do a lot of basic things with App Inventor are described here: http://www.appinventor.org/content/howDoYou/eventHandling . – Taifun Apr 30 '16 at 17:29

1 Answers1

0

so you need to listen for the Incoming SMS sent by GSM Module. Basically you need a BroadcastReceiver class to listen for incoming messages.And Extract the Longitudes and latitudes. Check this Link Hope this helps

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
        }
    }
}
  }
Community
  • 1
  • 1
Naroju
  • 2,637
  • 4
  • 25
  • 44