Coding simple sms Listener problem!!


Last Updated:

  1. card3r

    card3r New Member This Topic's Starter

    Joined:
    Jun 1, 2010
    Messages:
    1
    Likes Received:
    0
    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:


    Advertisement
  2. whitey

    whitey New Member

    Joined:
    Jun 1, 2010
    Messages:
    2
    Likes Received:
    0
    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
     
  3. ganeshpisal

    ganeshpisal Member

    Joined:
    Jun 2, 2010
    Messages:
    14
    Likes Received:
    0

Share This Page

Loading...