How to programatically disable the Android Status Bar? - android

I am trying to make an SMS app in android. There are some messages which contents I want to keep hidden but as soon as I receive a message, android stausbar shows the contents of the message. How can I disable this programatically in my application?

Take a look at this question
Can we delete an SMS in Android before it reaches the inbox?
It shows you how to use a BroadcastReceiver to listen for SMS notifications and cancel them reaching other applications. This will allow your SMS app to display whatever notifications you wish, or don't.

Related

only hide notifications for SMS from specific no or stop notification sound(or mute it) for 1-2 seconds?

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?

Change default action for a Notification

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.

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.

disable system alert boxes in android

In the Android application that I'm developing there is a function that sends sms messages to given numbers automatically when the application is running. That function is working properly but after the messages is sent the cost for that messages prompts on a alert box. Normally when I send a message that alert box prompts. But in my application I want to disable it because it disturbs to my application. How can I achieve that.
But in my application I want to disable it because it disturbs to my application. How can I achieve that.
What you are describing is something unique to your device (or possibly device + carrier). They modified the SMS subsystem (or the SMS client -- I am not sure whether you are using SmsManager or not) to display this dialog. No device that I have ever used has displayed such a dialog when sending an SMS.
You are welcome to contact your device manufacturer to see if there is a way to disable that dialog, though I doubt that it is possible.

How to refresh/notify all sms apps and notification bar?

I write sms messenger and have one problem. When user reads sms from my app and deletes them from my app, other apps and notification bar still show that one or more sms as unread. And when the user try to open sms, for example, from notification, other sms messenger didn't show unread sms beacause it was deleted from base from my app.
Is there any way to refresh sms apps and notification that would not show that sms not read?
Thanks!
I don't think there is a way to do this. Furthermore it shouldn't be you job to care about this, it's the job of the other apps to show always the most current data.
But you can show some advised to the user when he starts your app for the first time. GO SMS for example advises the user to turn off the SMS notification of all other SMS applications on the device. I think the reason for this is similar to your issues.

Categories

Resources