1. Are you ready for the Galaxy S20? Here is everything we know so far!

Coding simple sms Listener problem!!

Discussion in 'Android Development' started by card3r, Jun 1, 2010.

  1. card3r

    card3r Lurker
    Thread Starter

    Hello there coding folks!!! Recently I bought a HTC Desire phone and I begun coding an Incoming SMS Listener. The main purpose is analizing the contents of an sms; if the text matches the requiered word combination, it would send GPS coordonates to a certain phone number. Unfortunately, the app crashes without error reporting, even if I used those try/catch methods(try...catch...Toast.makeToast(context,exception.toString...)). I would really need some help....
    I'm using android SDK v1.6(Google APIs) and i attached also my work. Need urgent help!!!
     

    Attached Files:



  2. whitey

    whitey Lurker

    Do you understand how to set up an SMS Receiver? In your manifest, within the application pool, you must declare your Receiver
    Code (Text):
    1. <receiver android:name=".SmsReceiver">
    2.             <intent-filter>
    3.                 <action android:name="android.provider.Telephony.SMS_RECEIVED" />
    4.             </intent-filter>
    5.         </receiver>
    The .SmsReceiver is your new class to handle the receiving SMS'

    This will also require a permission
    Code (Text):
    1. <uses-permission android:name="android.permission.RECEIVE_SMS" />
    Now that you've directed your SMS handler to your custom class, it must extend "BroadcastReceiver". You now override the onReceive method to handle the message how you want to. You'll have to iterate through the intent pdus
     
Loading...
Similar Threads - Coding simple sms
  1. hyababa
    Replies:
    2
    Views:
    566
  2. Rob
    Replies:
    4
    Views:
    415
  3. Nacole Amethyst
    Replies:
    3
    Views:
    292
  4. TheOuz
    Replies:
    0
    Views:
    454
  5. frankrodriguez41285
    Replies:
    13
    Views:
    417
  6. jtrevor0470
    Replies:
    4
    Views:
    408
  7. jstuardo
    Replies:
    0
    Views:
    489
  8. App Update
    Replies:
    0
    Views:
    269
  9. Staff
    Replies:
    0
    Views:
    484
  10. IgorFromRussia
    Replies:
    1
    Views:
    617

Share This Page

Loading...