I'm developing an app that has a BroadcastReceiver that listens for the WAP_PUSH_RECEIVED_ACTION and then attempts to download the content of the MMS using downloadMultimediaMessage().
However, this only works if the default messaging app (which is not mine) doesn't get to it first, since once the MMS is downloaded, the carrier usually deletes the MMS from its servers.
When this happens, I have to fallback to finding the downloaded MMS in Android's MMS Content Provider. The only reliable piece of information I have to find the MMS I'm looking for, is the Transaction ID I obtained from the WAP_PUSH_RECEIVED_ACTION notification, but for some reason, all Transaction IDs in the content provider are null.
How can I reliably find the MMS in the content provider using only the information I receive in my BroadcastReceiver?
Related
I am trying to get the list of all the sms/mms sent to one particular phone number. I have been able to do this by getting at least one sms/mms from that number and then based on the thread_id, I get the sent sms/mms to that phone number. However, I have not been able to filter Sent SMS/MMS based on the destination number given I am the sender. Any ideas ? I know that Android doesn't support interaction with SMS/MMS officially, at least, not up to API level 18.
You are right, although android doesn't support sms and mms interaction you can query the content provider responsible for the handling of sms and mms data.
Since you can query the content provider related to sms and mms data you can know the sent sms and mms and the destination of that sms and mms message.
I didn't flaged this answer as duplicate because the idea behind it is slightly different from the following link:
You can use this answer to build what you want to achieve:
How to Read MMS Data in Android?
The only difference is that you dont want to query the content provider for unread messages like i did but for sent messages and include the destination number
Using the Messaging API in Android, is it possible to query the number of messages sent during a particular period - say 1 month?
I am not sure if using a BroadcastReceiver for the android.provider.Telephony.SMS_SENT event would be supported from Android 4.4 and up. I think this is the best approach as the first method will not be able to count if the user deletes some messages.
Can anyone give a better solution or if the first one I mentioned is possible?
Access the content provider
There is a content provider for accessing SMS messages, but it's not documented in the public SDK. If you use ContentResolver.query() with a Uri of content://sms you should be able to access these messages.
You can find more information on this Google Groups thread or previous questions on stackoverflow.
I have developed an android application which now I want to extend so as it can send text messages.
Most probably I will be able to find documentation on how to send a text message, but what I am looking for is something I don't know how to do a research on it.
There are two types of text messages you can receive.
One type is from a contact you already know, hence you will see the contact name.
Second type is from a contact you don't know. And, depending on the contact, you will either see a mobile number or a name (eg Google).
My goal is to extend my android application to send a text message in a way that the recipient will see a name as sender (eg Google) and not a mobile number.
I cannot extend my application to use 3G to communicate with a server and send the sms through the server nor I can use an online service which is going to send the sms.
I have to either send the text message from the android application directly or send an sms to an sms service to forward the text message to the recipient.
Is this possible to do?
I'm currently thinking of setting up a picture message import project. Something like this:
Client Mobile Device [picture message] -> our Server Device
Server Device [picture && number -> Server Computer
However I don't know if there's a possible way to do this. I could set up a google voice account and use something like this in order to retrieve messages, however this doesn't allow picture messages...
So I was thinking of perhaps making an android or iPhone application to redirect picture messages. Though I don't know if this is possible. If it is, how would I go about gathering the messages? The networking is simple enough, however I'm not familiar with the android system, nor the message system of the iPhone.
On the other hand, I could make a simple email server to receive messages from the cell phone provider's email system.
Is any of the above viable? The image as well as the origin number are both needed.
This sounds like a typical client/server application actually, except the commands sent to the server contain binary data.
There are many ways to do this, and many protocols you can use. Email (gmail) is just one example.
What I would do is use HTTP to post binary messages to your web server. This is cool because it manages authentication, data transfer, etc, are all available.
Here's a short example: Secure HTTP Post in Android
Just add authentication on top of that and you're in business!
You would have to do some web server development too.
I hope this helps.
Emmanuel
Ok I think this is possible. I'm not sure how it works but I'll do my best.
First you have to be notified when an SMS is received by listening to SMS_RECEIVED events. BroadcastReceiver + SMS_RECEIVED
Second, you have to read the SMS attachment as explained here: Get attachment from unread MMS messages
Does this help?
I want our app to examine incoming SMS and MMS messages, examine their contents, then if they are something we are interested in, log and display them. Then block them from going to the standard messaging app. We've had this working with SMS messages for a while, but I can't find any samples or documentation explaining how to retrieve data content from incoming MMS messages.
All I've found are apps that retrieve MMS contents from the Messaging content provider. I suppose we wait till it gets there then retrieve the content and remove it. But that seems kind of backward.
Check this project
http://code.google.com/p/android-notifier/
It contain MMS parser implementation. But it support only header, so you can get information about type of MMS, sender phone number, etc.
Clone this GIT repository:
https://android.googlesource.com/platform/frameworks/base
And look to this folder core\java\com\google\android\mms\pdu\
Here is MMS header and body parser. If you can see example how to use it download also this GIT repository:
https://android.googlesource.com/platform/packages/apps/Mms