mlc Active Member Licensed User Longtime User Nov 27, 2012 #1 Following this post http://www.b4x.com/forum/basic4android-updates-questions/11535-there-way-read-emails-gmail-app.html#post64568 It seems that it is impossible retrieve the content of an email from Gmail. Is that true? Because there are apps such as Cloud Print, that do it, even in the case of files, getting the full file name. My Manifest editor Code: Copy AddPermission (com.google.android.gm.permission.READ_GMAIL) and so my AndroidManifest.xml Code: Copy <uses-permission android:name="com.google.android.gm.permission.READ_GMAIL"/> From this intent Code: Copy (Intent) Intent { act=android.intent.action.VIEW dat=content://gmail-ls/messages/[email protected]/542/attachments/0.1/SIMPLE/false typ=image/jpeg flg=0x3880001 cmp=mlc.calendar/.main } I get this error Code: Copy java.lang.SecurityException: Permission Denial: reading com.google.android.gm.provider.MailProvider uri content://gmail-ls/messages/[email protected]/542/attachments/0.1/SIMPLE/false from pid=6324, uid=10089 requires com.google.android.gm.permission.READ_GMAIL I do not give up, for now. Can you help me translate this? Code: Copy InputStream is = context.getContentResolver().openInputStream(uri); This is what I have so far : UriString = content://gmail-ls/messages/[email protected]/542/attachments/0.1/SIMPLE/false Code: Copy Dim Ins As InputStream Dim r As Reflector Dim Uri As Object Uri = r.RunStaticMethod("android.net.Uri", "parse", _ Array As Object(UriString), _ Array As String("java.lang.String")) r.Target = r.GetContext r.Target = r.RunMethod("getContentResolver") Last question It is possible to know the mimetype of the intent? Thanks for your help
Following this post http://www.b4x.com/forum/basic4android-updates-questions/11535-there-way-read-emails-gmail-app.html#post64568 It seems that it is impossible retrieve the content of an email from Gmail. Is that true? Because there are apps such as Cloud Print, that do it, even in the case of files, getting the full file name. My Manifest editor Code: Copy AddPermission (com.google.android.gm.permission.READ_GMAIL) and so my AndroidManifest.xml Code: Copy <uses-permission android:name="com.google.android.gm.permission.READ_GMAIL"/> From this intent Code: Copy (Intent) Intent { act=android.intent.action.VIEW dat=content://gmail-ls/messages/[email protected]/542/attachments/0.1/SIMPLE/false typ=image/jpeg flg=0x3880001 cmp=mlc.calendar/.main } I get this error Code: Copy java.lang.SecurityException: Permission Denial: reading com.google.android.gm.provider.MailProvider uri content://gmail-ls/messages/[email protected]/542/attachments/0.1/SIMPLE/false from pid=6324, uid=10089 requires com.google.android.gm.permission.READ_GMAIL I do not give up, for now. Can you help me translate this? Code: Copy InputStream is = context.getContentResolver().openInputStream(uri); This is what I have so far : UriString = content://gmail-ls/messages/[email protected]/542/attachments/0.1/SIMPLE/false Code: Copy Dim Ins As InputStream Dim r As Reflector Dim Uri As Object Uri = r.RunStaticMethod("android.net.Uri", "parse", _ Array As Object(UriString), _ Array As String("java.lang.String")) r.Target = r.GetContext r.Target = r.RunMethod("getContentResolver") Last question It is possible to know the mimetype of the intent? Thanks for your help
Erel B4X founder Staff member Licensed User Longtime User Nov 28, 2012 #2 See this: android - SecurityException: Permission Denial error - Stack Overflow Upvote 0
mlc Active Member Licensed User Longtime User Nov 28, 2012 #3 ok, Thanks Erel Maybe I misunderstood something of that link, English is not my language, but in my device, the version I have of Gmail is 2.3.6, however CloudPrint can access the contents of Gmail. Upvote 0
ok, Thanks Erel Maybe I misunderstood something of that link, English is not my language, but in my device, the version I have of Gmail is 2.3.6, however CloudPrint can access the contents of Gmail.
Erel B4X founder Staff member Licensed User Longtime User Nov 28, 2012 #4 You can read Gmail mails if you know the user name and password (with the Net library). Upvote 0