I need to get 10 pushed emails using gmail android app. I start sending 10 emails and force android sync to check inbox. After that I get notification about incoming mail. How can I get the number of incoming emails, gmail API provides only NUM_UNREAD_CONVERSATIONS not the number of unread emails in conversation. Maybe there is another way to query gmail content resolver?
So I finally found possible solution, this worked for me:
turn off message threading
Now NUM_UNREAD_CONVERSATIONS flag gives me the number of unread emails
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
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?
Sorry for any mistake!
I am developing an App in android in which I am access unread message from the mobile with the help of Content Resolver & Sending those message on Email automatically. I am using TimerTask for this which repeate my Application with in a specific Time which I have set. Now it again Pickup those message which I have send On Email. Now problem is that How to recognise which message i have send in android?
Any help will be appreciated.
Thanks & Regards,
Deepanker Chaudhary
There are a few solutions to this:
Store the timestamp/id of the last SMS successfully forwarded through the email in a SharedPreferences value.
Maintain a database internal to your application and store all the messages forwarded to email along with their sending status in this database, so that you can resend the message in case of error in sending the email. You may have to perform housekeeping of this database to occasionally clear out past entries.
I am trying to develop an app, where one of the requirement is to send email or SMS to the contact which the user picks. When the user needs to send message, they can pick the contact from the contact list. If the user selects the "phone number" of the contact, I need to start SMS application and insert my message contact. If the user selects the contact email address from the contact list, I need to open the EMail application with my content in Subject and body.
How do the application know about the user input??
I am not an expert on this topic but it is interesting to me so I have done some reading about it.
You have the action of selecting a phone number or email address right? So if the user selects a phone number you can use SmsManager for that (here is an article about it http://mobiforge.com/developing/story/sms-messaging-android ). And a related Stack Overflow article discusses sending emails on the Android platform and one user gives a very nice Java example of doing this. Here is the article: Sending Email in Android using JavaMail API without using the default/built-in app
I hope these might be of some help!
How to send sms to multiple contacts and get the result code for each of them in android?
I asked the same question in the below links but couldn't find a solution:
How to send sms to multiple contacts and get the result code for each of them in android
How to get delivery report for a specific contact number while sending sms to multiple contacts in android?