Hello everybody,
I have a question that I think is quite easy for expert people, but not for
me.
I have an application organized as follows:
- *MainActivity*, displaying some feedback to user
- *SmsReceiver* (it is a BroadcastReceiver) that should check SMS for a
specific pattern in SMS text.
At present time the SmsReceiver is configured in the manifest as follows:
*<receiver*
* android:name="org.secure.sms.SmsReceiver"*
* android:exported="true" >*
* <intent-filter android:priority="999" >*
* <action
android:name="android.provider.Telephony.SMS_RECEIVED" />*
* </intent-filter>*
* </receiver>*
my problem is the following one: when the application is in the foreground,
the app works fine, I'm able to receive SMS, to parse them int the
SmsReceiver and to send a broadcast message to MainActivity in order to
display an AlertDialog, but as soon as I minimize the app, it stops working.
I would like to approach the problem by generating a service that can run
in the background even if the MainActivity is not visible, but I don't
understand how to automatically start at startup the required service (I
would like that the monitoring of SMS starts as soon as I start my
cellphone). I found some link that explains how to start a service from an
activity, but how to make is start automatically?
Any idea/link to examples explaining how to meet the desired result will be
appreciated.
Thanks, and have an happy 2013.
Giovanni
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en