Recognize/React on incoming SMS

Basic Tutorials concerning: GUI, Views, Activites, XML, Layouts, Intents, ...

Get a launched application on sms reception

Postby bigbang13 » Thu Apr 09, 2009 12:31 pm

Hi all,

First of all, excuse me for my english...
In my application, I've created an sms receiver thanks to this tutorial. It works well.

My problem is to check if my application is launched when I receipt an SMS, and :
If it is launched I want to call a method of my activity to refresh the view.
If not, I want to launch this activity.

I really need help.

I searched solution on forums but didn't found anything maybe due to the wrong keyword.
In advance thanks.
bigbang13
Freshman
Freshman
 
Posts: 2
Joined: Thu Apr 09, 2009 12:16 pm

Top

What about the sms inbox..

Postby ak_ » Thu Apr 16, 2009 2:12 pm

What about the sms inbox? how can i take the received messages?
Software Developer
ak_
Freshman
Freshman
 
Posts: 4
Joined: Tue Apr 14, 2009 7:26 am

Postby Firebear » Wed May 06, 2009 3:35 pm

Gulfam Hassan wrote:Hi,
I don't want to show this sms to user at any cost. is it possible if yes then how?
1: Delete it at interception time??
2: Stop it show user in default INBOX??
3: Discard it at time of interception??
4: any other way???
Help me ragarding this.

Best Regards,
Gulfam


Yes, I think you can.
But I don't know how to do so exactly.
I just found an example, android-smspopup, which can do so.
There is a class in it, named net.everythingandroid.smspopup.SMSPopupUtils, which would be a great start point for you to clarify what you are wondering.
http://code.google.com/p/android-smspop ... Utils.java
The essential way is to use android.content.ContentResolver to access the content model by the URI of the SMS message.
I'm studying it, and will update you as soon as I get it.
User avatar
Firebear
Freshman
Freshman
 
Posts: 8
Joined: Thu Feb 26, 2009 9:24 am
Location: Beijing

problem with android.provider.Telephony

Postby sreelakshmi » Tue Jun 16, 2009 11:35 am

I am not able to import the package android.provider.Telephony. When I type in Eclipse, android.provider. , it doesnt show Telephony in the suggested classes list.

Due to this, I am not able to use Telephony.Sms.Intents.getMessagesFromIntent either. I am using SDK version 1.5.

How to get rid of this problem ?

- Shree
sreelakshmi
Once Poster
Once Poster
 
Posts: 1
Joined: Tue Jun 16, 2009 11:21 am

Postby Markus » Wed Jun 17, 2009 7:35 pm

Is it possible to retrieve the "_id" or "threadid" from messages in an onReceive-function?
Markus
Freshman
Freshman
 
Posts: 6
Joined: Sat Jun 13, 2009 10:24 am

how to create a session in android?

Postby sheshi85 » Tue Jul 07, 2009 10:56 am

my application involves creating a session for 2 emulators where one is authenticated using the data in the other emulator.once done the data is shared between the emulators through messages.after the data is exchanged the session is cancelled.the question is how do i approach this problem in android using sessions?
sheshi85
Junior Developer
Junior Developer
 
Posts: 15
Joined: Mon Jun 08, 2009 11:17 am

Top

Re: problem with android.provider.Telephony

Postby redcbr600 » Wed Jul 08, 2009 7:00 pm

sreelakshmi wrote:I am not able to import the package android.provider.Telephony. When I type in Eclipse, android.provider. , it doesnt show Telephony in the suggested classes list.

Due to this, I am not able to use Telephony.Sms.Intents.getMessagesFromIntent either. I am using SDK version 1.5.

How to get rid of this problem ?

- Shree


Refer to the paragraph: Processing Incoming Messages in this link:

http://www.devx.com/wireless/Article/39495/1954
redcbr600
Freshman
Freshman
 
Posts: 2
Joined: Wed Jul 08, 2009 6:58 pm

how to send long messages?

Postby sheshi85 » Thu Jul 09, 2009 8:40 am

i have an arraylist of strings that which i need to send it through sms .

al=arg1.getStringArrayListExtra("als");
SmsManager sms = SmsManager.getDefault();
Iterator itr=al.iterator();

while(itr.hasNext())
str=str+(String) itr.next();
System.out.println("length of the arraylist:"+str.length());
al=sms.divideMessage(str);

sms.sendMultipartTextMessage("5556", null, al, null, null);

i get junk characters in the emulator on recieving the messages.what should i do to solve the problem?
the whole issue is in sending a long string? ;
Thanks in advance!!!!!!!!!!!!!!!!!!!!!!
Last edited by sheshi85 on Wed Jul 29, 2009 8:29 am, edited 1 time in total.
sheshi85
Junior Developer
Junior Developer
 
Posts: 15
Joined: Mon Jun 08, 2009 11:17 am

Fundamental question...

Postby Vaporx07 » Fri Jul 10, 2009 9:28 pm

Hi +- and Anddev community,

Like many I am new to Android. I just have a question about the fundamentals of an application that maybe one of you can answer for me.

Broadcast Receivers "die" once used correct? Does this mean that if I want to continuously have a phone listen for an incoming SMS and act upon it, that I need to create a service because it runs indefinitely, and have it register a broadcast receiver? That way whenever a SMS comes in my service will always be running and the broadcast receiver can trigger an intent to another service that reacts to an incoming SMS?

I'm just confused on the logic here an before I start writing code, I want to make sure I got the fundamentals of my application down.

Thanks a lot for reading this, I appreciate it regardless of a response. :)
Vaporx07
Once Poster
Once Poster
 
Posts: 1
Joined: Fri Jul 10, 2009 9:15 pm
Location: USA

Re: Fundamental question...

Postby TheChosen » Wed Jul 15, 2009 4:58 pm

Vaporx07 wrote:Broadcast Receivers "die" once used correct? Does this mean that if I want to continuously have a phone listen for an incoming SMS and act upon it, that I need to create a service because it runs indefinitely, and have it register a broadcast receiver?


As far as I know you don't have to create a service since Android sends a broadcast and checks all registered broadcast receivers if there is one that can handle it (in this case: reacting on an incoming SMS). Once a suitable application is found, it is started automatically so your program does not have to run continuously.

Please correct me if I am wrong here.
TheChosen
Experienced Developer
Experienced Developer
 
Posts: 62
Joined: Tue Jan 06, 2009 7:18 pm
Location: Germany

Is it feasible to implement a SMS Firewall app?

Postby Theseus » Mon Jul 20, 2009 7:52 am

I am about to develop a SMS Firewall app during my internship in a company.

SMS Firewall, as the name suggests, prevents users from receiving spam SMS messages, making them totally unaware of the incoming of such messages.

Along the way I meet many technical problems.

#1. I was able delete the SMS message from the message inbox. But the heart of the app is to delete it on the fly, which means before it comes into the inbox.

#2. I figured out when the new message arrives, the native Messaging app which Android provides will immediately post a Notification on the status bar. Is it a way to stop it by my app?

If I can't fix these problems, my SMS firewall

Sorry, I am not a native English speaker, so there must be flaws in my writing. I am trying my best to make them well understood.
User avatar
Theseus
Junior Developer
Junior Developer
 
Posts: 16
Joined: Wed Jul 15, 2009 9:34 am
Location: China

Re: Is it feasible to implement a SMS Firewall app?

Postby Firebear » Mon Jul 20, 2009 2:41 pm

Theseus wrote:I am about to develop a SMS Firewall app during my internship in a company.

SMS Firewall, as the name suggests, prevents users from receiving spam SMS messages, making them totally unaware of the incoming of such messages.

Along the way I meet many technical problems.

#1. I was able delete the SMS message from the message inbox. But the heart of the app is to delete it on the fly, which means before it comes into the inbox.

#2. I figured out when the new message arrives, the native Messaging app which Android provides will immediately post a Notification on the status bar. Is it a way to stop it by my app?

If I can't fix these problems, my SMS firewall

Sorry, I am not a native English speaker, so there must be flaws in my writing. I am trying my best to make them well understood.

#1. I'm afaid you could not prevent the message from being recieved by Android, because until then you could not identify it is a spam. Do not forget that this is a solution working at the client site;
A lazy Chinese bear, Software Engineer
Interested in Android, Mozilla, Badminton and Jades
MSN: dirtybear76@hotmail.com
Blog: http://bear-polka.blogspot.com/
User avatar
Firebear
Freshman
Freshman
 
Posts: 8
Joined: Thu Feb 26, 2009 9:24 am
Location: Beijing

Re: Is it feasible to implement a SMS Firewall app?

Postby TheChosen » Mon Jul 20, 2009 2:53 pm

Firebear wrote:#1. I'm afaid you could not prevent the message from being recieved by Android, because until then you could not identify it is a spam. Do not forget that this is a solution working at the client site;


He does not have to prevent the message from being received. All he wants is to prevent the notification signals (like playback of a sound and a notification in the status bar). If this could be intercepted, it would not be a problem if the message gets still into the inbox where it could then be deleted.
TheChosen
Experienced Developer
Experienced Developer
 
Posts: 62
Joined: Tue Jan 06, 2009 7:18 pm
Location: Germany

Re: Is it feasible to implement a SMS Firewall app?

Postby Theseus » Mon Jul 20, 2009 4:04 pm

Firebear wrote:#1. I'm afaid you could not prevent the message from being recieved by Android, because until then you could not identify it is a spam. Do not forget that this is a solution working at the client site;


Yeah, you are right. I really can't prevent the messages from being received by Android, but can I prevent them from being added to the message inbox? If I can do that, then I am done.

There are SMS firewall in many other mobile platform, such as iPhone. The third-party SMS firewall for iPhone can function as a real firewall, no ringtone, no notification, no sms in the inbox, nothing at all. So there is a solution at the client side!

Anyway, to develop such a firewall violates the spirit of communication.
User avatar
Theseus
Junior Developer
Junior Developer
 
Posts: 16
Joined: Wed Jul 15, 2009 9:34 am
Location: China

Postby desuvinodkumar » Thu Jul 23, 2009 1:59 pm

HI

Is it Possible to Display Animation after recieving the Message if i clcick the image animation it should go tot the specified unread meassage ......

how can i do this ........
how can place the animation file when the message got recieved...

thanks a lot in advance
Vinod...
User avatar
desuvinodkumar
Senior Developer
Senior Developer
 
Posts: 102
Joined: Mon Mar 23, 2009 6:51 am
Location: India

Top
PreviousNext

Return to Novice Tutorials

Who is online

Users browsing this forum: No registered users and 7 guests