tags:

views:

35

answers:

1

i intend to develop an app which would speak to the user the message he desires in the inbox. I have successfully created an app where there is a text box and when the user finishes typing in it and presses a speak button, he can hear what he has written, now how do i extend this to the desired app? please could someone please guide me on this?

A: 

I have a Gmail-to-SMS app that read the email from the content provider of the Gmail app. I think it's useful to you.

The cursor helper can get the conversation and message: http://github.com/qrtt1/android-gmail-to-sms/blob/new-input-format/src/googlecode/email/to/sms/CursorHelper.java

You can see the client how to use it: http://github.com/qrtt1/android-gmail-to-sms/blob/new-input-format/src/googlecode/email/to/sms/Email2SMSActivity.java

Finally, don't forget the uses-permission

<uses-permission
        android:name="com.google.android.providers.gmail.permission.READ_GMAIL" />

If you want to see the details in android's source, there is Gmail.java in this path:

./frameworks/base/core/java/android/provider/Gmail.java
qrtt1
thanks for that ,but i was just looking to access the inbox and get access to the messages so as to store the message as a string and then pass it to speak() method of TTS , so is there no way of getting the messages?
pranay
CursorHelper use the getConversationCursorForQuery() mehtod to the all conversations in the inbox. There are one or more messages (the mail) in a conversation with the messageId. You should use the messageId in the getMessageCursorForConversationId() method. Finally, you will get the body of a mail.
qrtt1