android:implementing push notification - android

I am making an app in which i want to recieve notification(PUSH Notification) on recieve of incoming sms like gmail in the way that as we recieve any mail there is notification on launcher icon.Any help will be appreciated.
Thanks.

I guess you don't really need Push notification (in the sense what C2D means). What you need is to get notified if a SMS is received.
For C2D you would need a Cloud (as the name suggests) that receives your SMS and then notifies you. But if you just want to be notified on SMS reception that wouldn't be the solution.
For this, the solution would be the BroadcastReceiver. Simply register your own Broadcast receiver and check for SMS.
This Topic could help
After you have been notified by the BroadcastReceiver, you should notify the user using the Notification Manager

yup
https://github.com/commonsguy/cw-advandroid/tree/master/Push/C2DM/
this is one of the most basic example which helped me a lot while implementing c2dm.have a try
vote up and accept answer if you find it useful
comment if u need further assistance

Have a look at the Android Cloud to Device Messaging Framework or this tutorial.
EDIT:
Another tutorial

Related

About Notification for Missed Call in android

I am using voip sip for calling processing calls when Push-Notification received. I want to create top bar notification for missed call . I am already processing calls when Push-Notification receives. I already searched lot of things but nothing helped me.
My question is, i'm making calls after receiving Push-Notification, so likewise i want to display notification after receiving Push Notification, so for that how do I differentiate for which i am receiving Push-Notification.
The notification you are receiving it always contains extra information, all you have to do in compare both notification packets and identify the key using which you can differentiate both of notification. If you are not able to find such key ask API developer to provide it.
You can get something unique in notification response for deffrentiate means notifications you are getting extra data please check in notification response or check in voip sip's documentation (if not getting this extra information ask api developer to provide it) using it you can identify whether you are receiving missed call notification or call notification.
Hope this may helps you.
https://developer.android.com/reference/android/provider/CallLog.Calls.html#DURATION
Call duration == 0, so call was missed

Sending an SMS and waiting for response before sending another SMS

I am trying to make an android application which sends SMS messages automatically.
I want to send the first message and after my Broadcast Receiver receives confirmation that the service was sent, I want to send the next one and so on.
Can anyone tell me how can I achieve this? I tried to create an AsynkTask to send the SMS but I cannot register a broadcast receiver. What approach should I use to accomplish this?
Thanks.
Basically you cannot. Only if your application is accepted as default messaging application by the user then only you can send SMS.
Please refer here and here.
UPDATE:
If you are sending SMS and the version of android is supporting SMS sending, follow this link, it has the answer.

Push notification after onDestroy

I have learnt how to send a push notification, it works well but I need to send a notification to the user even after the app has been closed. So far I know how to send it while the application is running. How do you send a notification when app is in the background or when its even closed, on Android?
There are many answers to this, you could use a Service in background and through that you could do, that service would be running at all times.
If you want your notification to be popped up at some specific point of time, you can specifically use BROADCAST RECEIVER. And with the help of PENDING INTENT, you can easily achieve this task.
About all the above keywords stated, you can easily find in the documentation of Android online.
Hoping that I was helpful...
In case of any more queries... Do ask and clarify.
Thank you...

Can we perform an ACTION programmatically on a Notification from Notification Listener Service?

Is it possible to invoke an ACTION programatically on a Notification from a NotificationListenerService?
I have written a Notification Listener service that reads out all the incoming notifications and dismisses when done. But I'm not sure if we can perform any ACTIONs on the incoming notifications.
For eg: On a WhatsApp message notification I can read the package name, sender and message details but is there a way to send a reply back to the sender?
Currently Android Wear is doing this so I'm wondering if it is following a generic approach of acting upon a Notification or it has a specific API to WhatsApp service.
When ever a whatsapp notification is received via notification listerner service there is one another notification thats received (hidden) which has a tag value something like this XXXXXXX#s.whatsapp.net (xxxxxxx being the phonenumber), I think this somehow holds the key to sending a reply to this user.
I am working on other app logic, which does not require you to send back replies but I found this interesting but could not get enough time to check it myself.
Yes, you can do it by this function:
sbn.notification.actions[0].actionIntent.send()
Yes, we can perform actions on notifications. Pushbullet app on Android has an ability to reply to WhatsApp, Hangouts, Facebook messenger etc when user enters the message form desktop which means that there is a way. I am still trying to figure out how to do it.

Android program - reacts when skype message received?

I am making an android program that needs to do something when I receive a message from the Skype app. My Skype will be logged in, and it will be a service or activity waiting for someone to message me, and when it does it will play a song. Does anyone know how, code-wise, I can tell if I have received a message from the Skype app?
If there is no way to do this, how can I have a service scan the notification bar for a notification that contains the text "skype" and react right when it's received?
Thanks for any help.
If skype broadcasts intent upon message reception ( look into decumentation of skype if there is one ) you may just receive it ( via broadcast receiver ) in your application and do something. Incase it does not, there may be still workauround to snoop into status bar:
Detect a new Android notification
for skype notifications
In general "no". There's no way to do that on non-modified system.
You cant intervene other app's events and/or processing directly. It is only possible if Skype itself has provided an open interface (like Service Binding, Broadcast, etc.) to allow third-party integration. But as per my knowledge, I don't think its possible with Skype's own app.
However, if you use Skype's SDK and offer your own implementation of messenger service, then of course you'll be the in-charge.
According to this post in the Skype Developer Forum, the app does not send broadcast events (which would be the usual way to be programmatically notified of incoming messages).

Categories

Resources