Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to open my app through inbox SMS?

Tags:

android

mobile

I have a doubt in opening my app through inbox SMS (came from a particular number), is that possible? Please guide me or give some tips to fix tje problem.

like image 604
Madhu Avatar asked Jan 29 '14 11:01

Madhu


2 Answers

You can open your app from a link contained in the SMS.

Create an intent-filter for your domain like this :

<activity
    android:name="ActivityFromSMS" >
    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <data
            android:host="mydomain.com"
            android:scheme="http" />
    </intent-filter>
</activity>

Then, clicking on a link to http://mydomain.com/... (that can be in an SMS) will prompt the user to open it with your app.

like image 197
minipif Avatar answered Oct 20 '22 21:10

minipif


generally you can listen for incomming sms and then just look for number, it came from or it's content, then you can start your desired activity using intent.

Code should look like here. You will need to change the onReceive method

like image 28
12 revs Avatar answered Oct 20 '22 23:10

12 revs