Android: Get all sent sms? (outbox) - android

I'm writing an app to backup all text messages. Been working on it for a while and i just realized the method i'm using to retrieve sms' only gets the ones i got (the inbox).
Is it possible, in any way, to get the outbox?
If it's not in the Android API, is it possible to get it from the default SMS app somehow? Even if not everybody uses it it will work for now, it's kind of urgent.

to get the sent messages you need to read sent-directory
Use this Uri query
Uri.parse("content://sms/sent");

Related

MIT AppInventor: Is there a way to send a Skype message programatically?

I'm using MIT AppInventor. I can't find a way to send a Skype message from my application. I know that there's an intent for automated calling with Data Uri (skype:test_username?call). I'm wondering if that's possible using ActivityStarter. If not, any solution is accepted. Another way I've found (but not used yet) is to "steal" Skype's message history (main.db, SQLite 3 format), and add the message as pending, then replace the original database with the new one. This method uses root (that's ok, I have root), but I still can't find a way to edit the SQLite database. Any ideas?

Calculating the number of messages sent in a period

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.

Allowing my app to send a file to another device via MMS/Email

I'm developing an app and one thing I would like to do it allow users to send/share data from the app with others vi MMS or by email. I have been searching but haven't found anywhere to get started on solving the problem.
Basically, I am going to programatically draw the data from an SQLite DB and put it into a delimited file (similar to a .csv) then I want to allow the user to 'export' or send it via MMS or Email. Does anyone have any tips on how I can get my program to open the messaging application and add the attachment at the users direction? Really just need some beginning info so I have a place to start.
Here is what you are looking for. This should be a good start
launch sms application with an intent

How to access the SMS storage on Android?

Beginner Android dev here.
I'm trying to create an app that will read the SMS messages stored on the device and then give the user statistics about their habits (like who they message often, common words, etc).
But to my knowledge, there doesn't seem to be a way to do this. I've looked around on forums and the most anyone talks about is accessing the inbox where you can find messages the user hasn't read. How then can the default app and third-party (Handcent for example) display the same texts? They don't keep their own database because Handcent will display all texts upon fresh install.
tl;dr: How do I read SMS messages on an Android devices, specifically messages that have been read before.
For a concrete example of accessing the SMS/MMS database, take a look at gTalkSMS.
You are going to need to call the SmsManager class. You are probably going to need to use the STATUS_ON_ICC_READ constant and maybe put what you get there into your apps local db so that you can keep track of what you have already read vs the new stuff for your app to parse through.
BUT bear in mind that you have to declare the use of the class in your manifest, so users will see that you have access to their SMS called out in the permissions dialogue they get when they install. Seeing SMS access is unusual and could put some users off. Good luck.
Here is the link that goes into depth on the Sms Manager
Do the following, download SQLLite Database Browser from here:
Locate your db. file in your phone.
Then, as soon you install the program go to: "Browse Data", you will see all the SMS there!!
You can actually export the data to an excel file or SQL.

Android - Get all sms in phone sent to a peson

I'm new to android programming. just to improve my skills, i started with some project in my mind.
when app starts, it will show a button. on click of it, it will allow me to select a contact from the address book. then i want to retrieve all the sms sent to that contact (if they are stored in sms outbox). Is it possible. Can some one guide me. If there is some tutorial on these topics, can you let me know the URL or source code?
Thanks in Advance.
First, it is not possible. There are many SMS clients for Android, many of whom do not expose an "sms outbox".
Second, even if you limit yourself to the SMS application that ships with "Google Experience" phones, the "sms outbox" is not part of the SDK.
If you wish to create an application that sends SMS messages, there is the SmsManager class you can use.
As folks mentioned, the sms outbox is undocument. If you want to access it, you sholud have some skills first.
trace android source code
learn how to use content provider (learn how to create a content provider is better)
what's the authority
know does the URI matched
how to manipulate the Cursor
write some sample code to test
You can find the SMS/MMS content provider here:
https://android.googlesource.com/platform/packages/providers/TelephonyProvider

Categories

Resources