Delete or avoid receiving messages to default message app kitkat+ - android

I'm trying to make a message application, which work along side the default messaging application. My application needs to intercept messages sent from a particular sender and not let default message application receive it. All other messages should be received by default message app.
After some searching I found that this is not possible from Kitkat onwards unless my message app is the default one. Therefore I thought of deleting messages from the particular number in default message app's inbox after receiving. But from kitkat onwards it is not possible unless my app made default.
Isn't there any way to do this?
What I want to do
Receive messages from a user specified number only to my
application while my application is not the default message application.

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,

Stop SMS reaching inbox in Android

I need to filter SMS in Android such that SMS which matches my condition moves to my application inbox and the rest go to native inbox.
But I can't delete/stop SMS reaching native inbox since abortBroadcast() is supported only for default messaging application. So, how can I handle this without making my application as default message application?
As far as I know google now assigns the largest possible integer for the default messaging app in the BroadcastReceiver's priority value. Therefore you can't catch the SMS before the default app to cancel it. (Thats what you have found)
The only method I see is to get the SMS in a lower level and delete it from the messages database using the from and to numbers and the timestamp.

SMS utility on Android 4.4 KitKat

Before KitKat was released I had developed an app which uses pre-defined short codes to perform transactions over SMS. For example, sending
"<PIN> BAL <phone number>"
would get you a reply with your credit balance. The user doesn't see the short codes, but instead picks the required function from a list, inserts his PIN and presses send. The message is formulated and sent by the app. The main point here is that his outgoing SMS (which contains his PIN) is not saved anywhere.
Since KitKat however, as long as my app is not the default SMS app, the outgoing SMS is saved in the default Messaging app. I can't ask users to set my app as default either, because it cant be used for normal messaging.
A solution or a workaround would be a lifesaver.
The main point here is that his outgoing SMS (which contains his PIN) is not saved anywhere. A solution or a workaround would be a lifesaver.
Forget it - there's no clean one. See docs:
Also, the system now allows only the default app to write message
data to the provider, although other apps can read at any time. Apps
that are not the user's default can still send messages — the system
handles writing those messages to the provider on behalf of the app,
so that users can see them in the default app.

How to make my application as default launcher

I've developed and application for sending/receiving SMS messages.
I want to make my application as default for reading messages whenever message is received and is viewed from the notification area.
Thanks in advance.
You can receive the SMS and send it, but you can not stop other apps from receiving SMS. At least not without root.
The user has to choose which SMS-App he is using, and he needs to manually disable notifications from the default SMS-App.
Also you need to implement your own notifications if you want them to be shown on receiving sms.

Putting of default SMS notification

What I am trying to do is developing an SMS notification system for our own application, whenever the sms is received from a specified number the application gets invoked but the problem is that whenever the sms arrives from any other number then also the application gets invoked and that is undesirable. I would be grateful to hear from u all .
Read this question and answers: how to stop the application from opening in android
Basically you need to extract the number from the message and if it is a number you are interested in, then you start your application, otherwise not.

Categories

Resources