I need to start my app when a type of SMS received, but I don't know when my app closed how I can get SMS and do any work.
Asked
Active
Viewed 1,209 times
-3
-
1http://androidexample.com/Incomming_SMS_Broadcast_Receiver_-_Android_Example/index.php?view=article_discription&aid=62&aaid=87 – Pratik Butani Sep 15 '14 at 13:04
-
Mind it your code only will work if there is any Activity in the project. Because after Android 3.0 they have stopped background kind of application. i.e. only SMS receiver broadcast Receiver code will not work any more. – Lucifer Sep 15 '14 at 13:20
2 Answers
1
you need to implement broadcast receiver. which will wait for message to arrive and when your sms will arrive than it will start its onReceive() method in which you have to define your activty which you want to start.
see this article it will help you. => starting an activity from sms broadcast reciever when message from a particular number is received

Community
- 1
- 1

Aiyaz Parmar
- 562
- 6
- 17
0
Write a service application. This service will run in background. You can check receiving sms' and start your application.

Burak
- 478
- 1
- 6
- 18