I am new for android, I have done one android application using phonegap, but in this application I am going to implement a new concept. That is nothing but this application want to open automatically when an sms receiving with particular port.
So how to implement this concept? Actually after login the app form that username sent to backend and reply via the same port. If entered username is correct, the reply message is true otherwise false will return.
In our apps when receiving that particular message take the response and check if it is true, redirect to the home form else displaying the login form again with error message. This is the concept.
Now my Activity class is as follows, but I don’t know how to change my activity class for getting this concept.
So any body help me how to implements this concept…thanks in advance.
import android.os.Bundle;
import org.apache.cordova.*;
import android.view.Menu;
public class SMSActivity extends DroidGap
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sms);
//super.setIntegerProperty("splashscreen", R.drawable.logo);
super.loadUrl("file:///android_asset/www/index.html");
}
@Override
public boolean onCreateOptionsMenu(Menu menu)
{
getMenuInflater().inflate(R.menu.activity_sms, menu);
return true;
}
}
You can use BroadcastReceiver for SMS_RECEIVED. Please refer this tutorial this may help you.
1) SMS messaging
2) React on incoming message