Deleting an SMS or changing its status from unread - android

I know that in newer android api levels its not possible to abort received sms broadcast or delete received or sent sms.Even when we send sms from SmsManager it is saved in inbox.
My first question is.Is there any way to delete sms in android 6.0 or atleast change received sms status to already read.
Second is there anyway to send sms silently which does not save itself in inbox.

Is there any way to delete sms in android 6.0 or atleast change received sms status to already read.
No. Its not possible unles you make your app default SMS. Starting from Andriod Kitkat only SMS default app has capability to Write data to the provider
Second is there anyway to send sms silently which does not save itself in inbox.
You can send Binary SMS which won't be visible in the Inbox/Sent box

Related

Make the android app as the only sms receiving (inbox and notification) app for a specific sender/originating address

My aim is to show notification and the sms message in inbox of app only from a specific broadcast sender. But using broadcast reciever with Telephony.SMS_RECEIVED receives the sms in the app as well as the main android phone's inbox. So the result is redundant message notifications and backups in phone default inbox as well as app inbox.
Following link shows how to create default sms app for android 4.4 and above for all the senders.
https://android-developers.googleblog.com/2013/10/getting-your-sms-apps-ready-for-kitkat.html
Also, for older versions, abortBroadcast() was used for receiving the sms into a specific app only.
But I want to make an application that notifies and saves the messages only from a particular sender as it is only application specific. Also the message must not go to any other sms inbox apart from app
Is there anyway to do the same ? Or can data sms with specific port number help ?
Usecase: The message to be notified by the app is a user specific message or a broadcast sms. The app has to notify the user of the message even when app is not open,

How can I send SMS without save in inbox or sent folders - Android

How can I send sms without save in inbox or sent folders in android?
when I using this code, the message save in sent folder:
SmsManager smsManager = SmsManager.getDefault();
smsManager.sendTextMessage(phoneNumber, null, messageBody, null, null);
but I want to send message in background.
Is your app running in android 4.4 and above?
Starting from Android 4.4, you cannot send the sms without showing in the sentbox.
Outlined at https://developer.android.com/about/versions/android-4.4.html#SMS you can see the changes.
SMS Provider The Telephony content provider (the "SMS Provider") allows apps to read and write SMS and MMS messages on the device. It includes tables for SMS and MMS messages received, drafted, sent, pending, and more.
Beginning with Android 4.4, the system settings allow users to select a "default SMS app." Once selected, only the default SMS app is able to write to the SMS Provider and only the default SMS app receives the SMS_DELIVER_ACTION broadcast when the user receives an SMS or the WAP_PUSH_DELIVER_ACTION broadcast when the user receives an MMS. The default SMS app is responsible for writing details to the SMS Provider when it receives or sends a new message.
Other apps that are not selected as the default SMS app can only read the SMS Provider, but may also be notified when a new SMS arrives by listening for the SMS_RECEIVED_ACTION broadcast, which is a non-abortable broadcast that may be delivered to multiple apps. This broadcast is intended for apps that---while not selected as the default SMS app---need to read special incoming messages such as to perform phone number verification.
For more information, read the blog post, Getting Your SMS Apps Ready for KitKat.http://android-developers.blogspot.my/2013/10/getting-your-sms-apps-ready-for-kitkat.html

SMS message is not present in inbox after receiving in Kitkat

I'm creating little sms app, and after receiving it with my Broadcast receiver it is supposed to be present in inbox and it should be accessible to other sms apps as well, but it is not. It looks like no message was received at all. This issue occurs only when my app is default SMS app. Do I need to manually add received SMS to inbox after receiving it?
Do I need to manually add received SMS to inbox after receiving it?
Yes. The default SMS app is responsible for writing incoming messages to the Provider.
Reference

Abort SMS Intent on Android KitKat

I'm currently developing an application that needs to deal with SMS only if it is an SMS expected by the application (same behaviour as Whatsapp on registration).
I would like to abort the SMS Intent as it is not expected to appear in the SMS box.
My question is : I know that Google changed a lot about SMS behaviour in KitKat, and now, even if my SMS is well parsed by my application, the SMS also appear in SMSBox, even if I call this.abortBroadcast(); in my SMS broadcast receiver. So is there a way to avoid those SMS appearing in SMS box without having to develop a complete SMS application ?
For information, the priority is yet to 1000 (and I tried also with MAX Integer) in Manifest file for this Broadcast Receiver.
Hangouts uses the maximum possible priority (999 per the Intent-Filter docs) and therefore you cannot abort it on <4.4 releases. On 4.4+, only the default SMS app (blog post with details) can make changes to the SMS Provider (i.e., automatically delete the SMS).
You can't stop a message from showing in Default SMS application in kitkat. Checkout following links for details:
https://code.google.com/p/android/issues/detail?id=61684
http://android-developers.blogspot.co.uk/2013/10/getting-your-sms-apps-ready-for-kitkat.html
You can block SMS on Android 4.4 - 4.4.4 using
1)
Using AppsOpps setting
WRITE_SMS permission
Sms will be deleted in 10 seconds with notification about this sms.
As option you can block sound on receiving unwanted sms.
2) Set up your app as default sms app.

Android and consume SMS

I write application which will get data from received SMS. This is data only for application and I dont want to user can read this message. Is possible to consume SMS just after get data from them to prevent user from reading this SMS? Thanks for any help.
You will need a sms receiver see http://davanum.wordpress.com/2007/12/15/android-listen-for-incoming-sms-messages/
Maybe you need also to delete the received sms.
Yes, this is easy to do. See my answer here for how to do this:
SMS receive with no notification
Once you've confirmed that the SMS is one of your special ones, you just need to call abortBroadcast() to stop it going into the user's inbox:
// Stop it being passed to the main Messaging inbox
abortBroadcast();
You should also be aware that the SMS receiver will not intercept SMS messages sent to the user's Google Voice number, as by default those messages will be downloaded over the data connection and displayed by the Google Voice app. If their Google Voice number is configured to forward the SMSs to the phone then those will be handled fine by the SMS receiver.

Categories

Resources