How to retrieve RCS messages from Android Devices - android

How do i retreive RCS messages in android. I can retreive SMS/MMS using contentproviders, is there any URI for RCS messaging availlable for android?
I found that my device has this contentprovider availlabe so I tried using this :
Uri.parse("content://com.gsma.services.rcs.provider.chat/chatmessage")
but this gives me a Security Exception like This :
java.lang.SecurityException: Permission Denial: opening provider com.sec.internal.ims.servicemodules.tapi.service.provider.ChatProvider from ProcessRecord{31c3db7 9607:com.sol.testsms/u0a403} (pid=9607, uid=10403) requires com.gsma.services.permission.RCS or com.sec.imsservice.WRITE_IMS_PERMISSION
after adding the permissions stated in the error message I still get the error.
Can anyone help with this?

Related

Use of SMS permission groups exception for Anti-Smishing

I try to develop anti-smishing solution, which listen in background and analyze new SMS.
If I'm not default SMS app, I can only read the SMS.
I found information about some exceptions in use of SMS permission group for Anti-Phishing, where I have access not only to read, but also to write.
How does it work? For now I'm not able to write or edit any SMS in Android Studio. When Google accepts my request/form I will have some extra code for exception or something like it?
https://support.google.com/googleplay/android-developer/answer/10208820?hl=en&ref_topic=2364761#zippy=%2Cwyj%C4%85tki

How to get draft SMS in Android 6 Marshmallow

My questions specific only for Android 6 (starting from v23 of SDK). I need to get all SMS, even draft for future processing. Nothing special here, used the following peace of code:
context.getContentResolver().query(Uri.parse("content://sms/"),
new String[] {...}, null, null, null)
And this work perfect for Android 5, meaning that I get all SMS messages including draft. But at all devices with Android 6, I get only sent and received messages and NO DRAFT. Try to make my app default SMS before trying to query SMS – but no luck, at Android 6 i still cannot get draft messages. What the problem?
I've already found some related posts
SMS missing from content provider results on Android Marshmallow
But this do not solve my issue at all.
For Marshmallow you need to add run time permissions to read messages .
Check permission like this
int permissionCheck = ContextCompat.checkSelfPermission(getApplicationContext(), Manifest.permission.READ_SMS);
If permission denied tha ask at run time like that
ActivityCompat.requestPermissions(this, new String[]{{Manifest.permission.READ_SMS}, PERMISSIONS_REQUEST_READMESSAGE);
to access draft this is URI for content provider.
Content provider for draft is
content://sms/draft
Note: dont forget to add permissions
<uses-permission android:name="android.permission.READ_SMS"></uses-permission>
I believe what your looking for is found in this answer. It provides a list of URI's for accessing the different SMS boxes. The one specifically for the draft SMS messages is
content://sms/draft
Query on URI content://sms/draft will return only the draft messages that are stored in SMS provider.
Default android messaging application implementation stores the draft messages within the application and will not add the drafts to SMS provider.
Only the draft messages that are part of SMS provider (can added using SMSManager's hidden API addTextMessageDraft) will be returned as results when query on URI content://sms/draft is performed.

C2D_MESSAGE Permission Pattern issue

According to Google's official document
https://developers.google.com/cloud-messaging/android/client#add-config
Your + ".permission.C2D_MESSAGE" permission to prevent other Android applications from registering and receiving the Android application's messages. The permission name must exactly match this pattern—otherwise the Android application will not receive the messages.
If we declare permission pattern wrong for example: PACKAGE_NAME.gcm.permission.C2D_MESSAGE
our app should not recieve any notifications. But i can receive notifications. How is it possible?
Does system only looks for a permission ends with .C2D_MESSAGE?

how to get email\gmail data to activity?

how to get mail buddy from email by choosing ?
i found some sulotion's here at stackoverflaw but when i finnaly found something that might work i gut permission error and as i understood from user here its blocked by google .
is it realy blocked ?
(java.lang.SecurityException: Permission Denial: opening provider com.google.android.gm.provider.MailProvider from ProcessRecord{4284e9f0 15683:com.example.buylist/10158} (pid=15683, uid=10158) requires com.google.android.gm.permission.READ_GMAIL or com.google.android.gm.permission.WRITE_GMAIL) - > this is the error . i add permission as asked from me and it still wont work .
if so , can u give me simple intenet that open gmail imbox (gmail built in app) .
and in related issue , i did get data from sms but can i do it with whatsup ?
thanks !
can u give me simple intenet that open gmail imbox (gmail built in app) .
No, because that is no longer allowed. Only fools did it in the first place, since it was not part of the OS, was not documented, and was not supported.

Security Exception while implementing global search for Messaging

I am trying to enable global search for messaging application (i.e., messages can be searched from home screen search box). I have followed all the steps given in
http://developer.android.com/reference/android/app/SearchManager.html
I am getting the following exception
04-16 12:49:26.917: ERROR/DatabaseUtils(102): java.lang.SecurityException: Permission Denial: reading com.android.providers.telephony.MmsSmsProvider uri content://mms-sms/search_suggest_query/m?limit=58 from pid=106, uid=10000 requires android.permission.READ_SMS
I have set permission in MmsSmsProvider.java file for read, write sms and global search, but still I get this error.
Can anyone help.
Regards,
Sunil.
You need to have
<uses-permission android:name="android.permission.READ_SMS"></uses-permission>
in you AndroidManifest.xml

Categories

Resources