if you please I just want to know how can I replay to sms automatic to a message received on the mobile in my application I could received the sms only but i could not auto replay the sms.in android
Asked
Active
Viewed 375 times
1 Answers
0
Well, you create a class that extends the BroadCastReciever
class. In this class, override the onReceive
method to intercept received messages. It will be in this method that you will have to send your automatic reply.
This you can do by using intents and starting the activity to send your sms. You can refer to the following links for details on the same:
Send SMS in android
http://mobiforge.com/developing/story/sms-messaging-android
The second link explains in detail what ive tried to explain above.
Hope this helps.
-
thank you but when I use the onReceive method it invoke automatic and i could not control it and i want to control to use the auto reply or not by a toggle button – Tota Oct 14 '11 at 06:51
-
for that you can use the state of your toggle button to register and unregister your broadcast receiver. Check these questions on how to register and unregister broadcast receiver programatically--http://stackoverflow.com/questions/4805269/programmatically-register-a-broadcast-receiver & http://stackoverflow.com/questions/7439041/how-to-unregister-broadcastreceiver & http://stackoverflow.com/questions/3096246/set-broadcastreceiver-to-be-inactive The last one is exactly what you want. Tell me if this worked :) – Urban Oct 14 '11 at 13:03
-
I did the code like this and it does not work and did on the onRecivce method only toast to try it – Tota Oct 14 '11 at 21:39
-
I did 2 methods onResume and onPause and called them in the onclicklistener in if condition ischecked of the togglebutton and else and did only a Toast in on the onReceive methoud in after i put a bundle and for loop – Tota Oct 14 '11 at 21:59
-
do i have to add the action of the intent filter in the manifest file in the activity tag – Tota Oct 18 '11 at 08:32