Putting of default SMS notification - android

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.

Related

Race issue with reading CallLog from provider

Just a bit of app background, this app allows users to click on a number from the application and redirects it to the phone app.
And once the call is done, it will redirect the user back to the app then it retrieves the call information of this particular number (such as timestamp, duration, etc)
However, I come across a race issue where I don't get the latest call log on some phones; meaning Android writes the call log after the app reads the CallLog provider (I can't be certain for how big this window gap).
To put this in simple technical flow:
User click the phone number on the app
Broadcast receiver is triggered
App start Phone activity
Call ends after some period
Broadcast receiver listen to the event
Get call details
With this in place, is there some steps that I missed? or do you have a better solution to handle this?
Thanks.

Delete or avoid receiving messages to default message app kitkat+

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.

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.

Android: Is there an onSMSSend event?

I've got an idea for an Android Application, however I am unsure if it would work. Essentially what I want to do is "intercept" all text messages sent from any SMS App and make modifications to them.
For example, say I write out the following SMS:
Hi {Name}, how are you today? Can you tell {Boss} I'll be 15 minutes late today.
The onSMSSend function in my application(assuming it is currently running in the background) would then be able to edit the content of the message(Eg. Replacing variables with ones defined in the application), and then send it on to the recipient.
Is Android able to provide this functionality?
No it is not. Android may be able to inform you after an SMS was send. But there is no way to intercept a message that should be sent and apply changes to it on a non rooted phone.
What you could do is to write a new messaging App that allows the user to type a message, choose a number and send the message. Now you have full control over the message that is send but building a replacement for the sms app is a fair amount of work.

Categories

Resources