andbook!.pdf - Learning Android Get an anddev.org - Android-Shirt Back to index
anddev.org Header Logo
FAQ Search Top rated articles Browse Feeds anddev.org - Authors Contact Details Register Log in

Recognize/React on incoming SMS

Goto page Previous  1, 2, 3, 4  Next
 
       anddev.org - Android Development Community | Android Tutorials | Index -> Novice Tutorials
Author Message
mjpan
Freshman


Joined: 24 Dec 2007
Posts: 4

PostPosted: Fri Dec 28, 2007 8:00 pm    Post subject: Reply with quote

Hi plusminus,
yup, nothing came through the other side.
i'll add post to GoogleGroups and see what the response is.



plusminus wrote:
Hello mjpan,

did you try the Category-Thing Question

There is no official Bug-Tracking-System yet, but on my Bugs posting them to the GoogleGroups and hoping a moderator would see them was fine ^^.

Regards,
plusminus
Back to top
View user's profile Send private message
Alexey Klokov
Freshman


Joined: 17 Nov 2007
Posts: 3
Location: Nizhniy Novgorod, Russia

PostPosted: Sat Jan 12, 2008 11:16 pm    Post subject: Reply with quote

Hi guys,

May be you know, i have the common question about Android notifications.
For example if i have 2 applications which wants to recieve incoming SMS notification.
What application executed first?

I code we wrote:
Java:
/* Consume this intent, that no other application will notice it. */
               this.abortBroadcast();


How i can be shure that first(for instance) application will get notification instead of second.

Thanks!!!

PS
This question comes from simple example. If i have a phone with default Messaging client, and additionaly download and install alternative Messaging application, which one will work????

_________________
Alexey
Back to top
View user's profile Send private message
plusminus
Site Admin


Joined: 14 Nov 2007
Posts: 1888
Location: Germany

PostPosted: Sun Jan 13, 2008 12:51 am    Post subject: Reply with quote

Hello Alexey,

I had questioned that myself and wrote down what the system does Source here (similar case, when making a DIAL-Replacer).

Basically the system will ask the user which one he/she wants to be started (at this time, the system does not remember the user choice and asks always again).

Hope this helped you.

Regards,
plusminus

_________________

| Android Development Community / Tutorials
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Alexey Klokov
Freshman


Joined: 17 Nov 2007
Posts: 3
Location: Nizhniy Novgorod, Russia

PostPosted: Sun Jan 13, 2008 11:15 am    Post subject: Reply with quote

plusminus,

Thank you! Now i understand how it works.

ragerds
Alexey

_________________
Alexey
Back to top
View user's profile Send private message
GodsMoon
Junior Developer


Joined: 10 Dec 2007
Posts: 22

PostPosted: Tue Jan 29, 2008 9:35 pm    Post subject: System Messages Reply with quote

So has anybody figured out how to pass system messages between phones without spamming the SMS or XMPP inbox?
Back to top
View user's profile Send private message Visit poster's website
Alexey Klokov
Freshman


Joined: 17 Nov 2007
Posts: 3
Location: Nizhniy Novgorod, Russia

PostPosted: Tue Jan 29, 2008 9:52 pm    Post subject: Re: System Messages Reply with quote

GodsMoon wrote:
So has anybody figured out how to pass system messages between phones without spamming the SMS or XMPP inbox?

Hi GodsMoon,
what's mean "system messages"?
U see, any phone has a service(GSM or CDMA or any other). And phones can communicant using SMS messages or though internet connection. Actually you can use another methods - wifi, bluethooth and etc.
But this is just a transport layer for your application. I'm confusing about SYSTEM messages? Could give a details.

_________________
Alexey
Back to top
View user's profile Send private message
GodsMoon
Junior Developer


Joined: 10 Dec 2007
Posts: 22

PostPosted: Wed Jan 30, 2008 2:31 am    Post subject: System Messages Reply with quote

I'm talking about the "P2P Services Using XMPP" section from http://code.google.com/android/toolbox/google-apis.html

apparently you can intercept sms messages so the user doesn't see them, but that usually cost money. (though I'm not sure how to do that). Anyway, I would like to send messages back and forth between phones without alerting the user every time I receive a new message from the other phone. Can you do this with XMPP? The link above doesn't really say...

Has anybody done this without a 3rd party server?

thanks
Back to top
View user's profile Send private message Visit poster's website
Ishtar
Experienced Developer


Joined: 16 Jan 2008
Posts: 50
Location: Netherlands

PostPosted: Thu Jan 31, 2008 4:27 pm    Post subject: Reply with quote

sms-compression app

nice Surprised why didn't i think of that?

Ishtar
Back to top
View user's profile Send private message
plusminus
Site Admin


Joined: 14 Nov 2007
Posts: 1888
Location: Germany

PostPosted: Thu Jan 31, 2008 8:20 pm    Post subject: Reply with quote

Ishtar wrote:
sms-compression app

nice Surprised why didn't i think of that?

Ishtar


its not yet finished at all, because Android does not yet provide a centralized storage for sms' Smile

Regards,
plusminus

_________________

| Android Development Community / Tutorials
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sebi
Freshman


Joined: 06 Jan 2008
Posts: 3

PostPosted: Sat Feb 02, 2008 6:56 pm    Post subject: Reply with quote

plusminus wrote:
Ishtar wrote:
sms-compression app

nice Surprised why didn't i think of that?

Ishtar


its not yet finished at all, because Android does not yet provide a centralized storage for sms' Smile

Regards,
plusminus

Hi plusminus,

Thanks for your tutorial. I have actually successfuly stored incoming sms' using the right content provider . I will post the code but now I'm posting from a computer where i do not have this code . The sms' are correctly stored into the database (I was able to browse the records through the sqlite console in adb). However , retrieving sms' is not possible , as you have told on the google android group. We are facing a bug (Class cast exception with the cursor class). I tried to up the post but no one is reacting on it.

I really need this functionality so i'm about to rewrite an home-made content provider in order to retrieve sms' from the database. Other solution is to write an sqlLite class but not so nice because we are not using a content provider. Last solution, is that this bug will be resolved in the newt release of the SDK.
Back to top
View user's profile Send private message
plusminus
Site Admin


Joined: 14 Nov 2007
Posts: 1888
Location: Germany

PostPosted: Sat Feb 02, 2008 7:52 pm    Post subject: Reply with quote

Hello sebi,

i hope the bug will be fixed with the next SDK-update (we are already waiting 6 weeks for an update Sad ).
Doing sth on our own will/should definitely get replaced later by some code from the Google-Guys, just for compatibility to other apps.

But i would really appreciate you posting your code/halfworkaround to anddev Smile

Best Regards,
plusminus

_________________

| Android Development Community / Tutorials
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sebi
Freshman


Joined: 06 Jan 2008
Posts: 3

PostPosted: Sat Feb 02, 2008 8:39 pm    Post subject: Reply with quote

well, that's the code to store an message into the database. please note that it is incomplete as it only store the body of the message but storing a complete message is just a matter of completing your cotentValue object.

I added this code inside the for loop of the SmsReceiver class :
Java:

ContentValues contentValues = new ContentValues();
                        contentValues.put(android.provider.Telephony.Sms.BODY, currentMessage.getDisplayMessageBody());
                   
 ContentURI uri =context.getContentResolver().insert(android.provider.Telephony.Sms.CONTENT_URI, contentValues);


That's it, quite simple Smile.

I cannot post yet my code for retrieving sms cause for the moment it's only exist in my head Wink and i've to find some time to implement (I will made an highly use of the notepad provider sample)
Back to top
View user's profile Send private message
puyopuy
Junior Developer


Joined: 03 Feb 2008
Posts: 17

PostPosted: Sun Feb 17, 2008 5:54 am    Post subject: Reply with quote

Hello guys,

After I updated to m5-rc14, SMS ReceiveIntent not working any more. I changed android:value to android:name from AndroidManufest.xml.

Java:

        <receiver class=".SMSReceiver">
            <intent-filter>
                <action android:name="android.provider.Telephony.SMS_RECEIVED" />
            </intent-filter>
        </receiver>


Put a break point in onReceiveIntent but nothing happen . Any idea what's wrong?

Thanks
puyopuy
Back to top
View user's profile Send private message
plusminus
Site Admin


Joined: 14 Nov 2007
Posts: 1888
Location: Germany

PostPosted: Sun Feb 17, 2008 1:02 pm    Post subject: Reply with quote

Hello puyopuy,

you also have to change:
XML:
       <receiver class=".SMSReceiver">
<!-- Change to -->
        <receiver android:name=".SMSReceiver">


Your project should not have compiled with the code you wrote.

(untested)

Regards,
plusminus

_________________

| Android Development Community / Tutorials
Back to top
View user's profile Send private message Send e-mail Visit poster's website
puyopuy
Junior Developer


Joined: 03 Feb 2008
Posts: 17

PostPosted: Sun Feb 17, 2008 2:31 pm    Post subject: Reply with quote

Sorry, I must paste the old source code. My actual code already changed and I can compile and running in the emulator.

I also realized I cannot select SMS_RECEIVED from the action attributes drop down. Please see my attached image.

Best Regards,
Puyopuy



attributes.JPG
 Description:
No SMS_RECEIVED attribute
 Filesize:  48.97 KB
 Viewed:  796 Time(s)

attributes.JPG


Back to top
View user's profile Send private message
Display posts from previous:   
       anddev.org - Android Development Community | Android Tutorials | Index -> Novice Tutorials All times are GMT + 1 Hour
Goto page Previous  1, 2, 3, 4  Next
Page 2 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


© 2007, Android Development Community
All rights reserved.
Powered by phpBB.