I am currently developing a simple sms alarm which plays an alarm whenever a certain number is texting you or when a certain word is showing up in the message.
Now i want to do the same thing, but with notifications.
I want my app to alert me when certain word appears in the notification title or text.
My question is, it is possible to catch all the notifications in a broadcast receiver like i do with the sms?
One possible way, that would not read everything in the notification would be to set up your application as Accessability application that's allowed to listen to (pretty much) everything.
But in 4.3 they have added the NotificationListenerService. Best guideance is probably to look at the docs. There's an another example available: https://github.com/kpbird/NotificationListenerService-Example
Related
My application uses SMSs for data exchange between my android app and a device. The device will have a sim card in it, which will send a lot of regular SMSs to my App(i.e. to my paired sim no).
The issue is, a lot no messages are bothering my App users and they are getting irritated.
I know, from KITKAT 4.4, I can't delete/write a SMS from provider.
But can I just prevent notifications(specially voice), then vibration and then if possible status bar notification.
And I don't want to create an entire SMS application as a default SMS app.
I found a lot of question asking how to remove a SMS, but I just want to prevent it bothering the user by preventing/hiding notifications only.
And if above not possible then can I create a default SMS app that will only read/receive SMS but for other parts like MMS and sending SMS's, will pass that functionality to other apps like default messaging app in device or hangout app etc.
Because what I want is just to prevent notification when SMS comes from specific no, let it then show in default SMS app.
At least can i just stop notification sound(or mute it) for 1-2 seconds?
I have created a app that sends and receives Sms messages and displays some info to the receiver. I want to know if its possible to trigger a class from my app when pressing on New Sms Notification, instead of the default action which is trigger Messaging app. Thanks in advance
No, you cannot change what another app's notifications do, for blindingly obvious security reasons.
You are certainly welcome to display your own Notification, though.
Please take a look at using permissions in your Application to allow you to receive the SMS message (which it sounds like is what your trying to do):
http://developer.android.com/reference/android/Manifest.permission.html#RECEIVE_SMS
If you use this in your application, you can receive the SMS, or even select your app as the default application to receive all SMS messages.
Also, if you would like to send the SMS message as well there is the SEND_SMS:
http://developer.android.com/reference/android/Manifest.permission.html#SEND_SMS
Additionally, once you add this ability you can Create your Notification and provide it to the Notification center the same way hangouts does, you will just have to implement a receiver and send a notification when an SMS is received.
Hello all i will explain my question a little more. I'm not native english speaker. So maybe my question is on the internet but when i search i only found something i already know.
I have a Xperia U with the illumination barre. I use it as a notification for sms. I already know how to receiver SMS and the event of unlock screen
What i will now is 2 thing.
1- Possibility to know if the last sms was read by the user or not(My apllication is just a notification center and not a sms handler so the sms reading is doing by official app or user app like gosms)
2- Possibility to know if phone is already unlock, i will remove notification if it is.
I'm not very clear but i find this difficult to explain if you don't undestand the question say it i will reformulate it.
Possibility to know if the last sms was read by the user or not(My apllication is just a notification center and not a sms handler so the sms reading is doing by official app or user app like gosms)
There is no concept of Read in SMS. You can get a delivery notification for when it reaches the user's device, but you can't tell if the user read it or not.
Possibility to know if phone is already unlock, i will remove notification if it is.
You will need to dynamically register a BroadcastReceiver for ACTION_SCREEN_ON and ACTION_USER_PRESENT broadcasts.
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.
Is it possible to launch a service whenever a phone is booted up?
My question is that, say, I want to have a background service running in the background when the phone is booted up, once it receives a notification, say, a stock price is now above a certain price, then the user will get notified and in the notification center it will launch the actual app if a user chooses to click on it.
My question is, where do I put the tag? In my application manifest? but again, I only want the service to run automatically without user launching my app.
I see here two possibilities for you:
Is the same approach that was proposed by #triad. You can have a broadcast receiver that will start your service.
You can use push notifications. As I understand from the question it is possible in your case. I guess using push notifications will be cheaper (in the context of power) in your case.