-3

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.

2
  • 1
    androidexample.com/… Sep 15, 2014 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, 2014 at 13:20

2 Answers 2

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

0

Write a service application. This service will run in background. You can check receiving sms' and start your application.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.