Android Push Notification as an invite - android

I want from my Java server to be able to send an Android notification that will take the form of an invite. I'm currently able to send a basic Android notification, but I want to appear on the screen in form of an invite with options like 'Yes, I accept' or 'No, I refuse' and then send the answer back to the sender. How would you do something like this? I have no clue how should I do it and I can't find anything on the Internet.
Thanks,
Alex

After you receive a pushed message from server, you can launch a new Activity which has a dialog style, then you can do your business in that activity.
the case is very much the same as receiving a sms.

You can create a custom layout for your notification using RemoteViews and manage OnClick events. See Android Notifications, and this question might help you too Create Notification using some controls

Related

Flutter Android Notification not being Shown

I'm developing an app in Flutter and using Firebase to send Push Notifications, the phone is receiving them but the issue is that I wan't to display a little retancle with some text inside such as WhatsApp does when you receive a new message, but mines just go for the top of the notifications bar and doesn't show anything. Does anyone know how to proceed or how is called the component that I need to implement?
Expected result:
Thank you!!

How to create a notification for other apps in android?

I'd like to know if it is possible in Android 4.3+ to have an app which can create a notification of another app.
For example: I develop an app, say myApp, with a button. Every time I tap on that button a new notification from another app, say Telegram, is triggered.
I'm sorry I don't have any code to show you as a start point nor a POC, but I really can't find anything useful on the web.
No it is not possible. Unless you have some communication channel that generates a new notification. For example:
You have developed a messaging app X that when receives a message produces a notification.
You have developed an application Y that sends a message to the application X.
You can pop a noti with whatever info you want. But you want to say, notify of a new mms or gmail, then no

Rich parse messages with push notifications service

I'm using Parse service in an application I'm developing, push notifications are now working, I can send perfectly ...
But I want to implement some actions in determidos cases example: Send url to be opened as soon as the user clicks on the notification, make a call, open the map with a planned route, and more.
I wonder if this is possible, and if we had someone who already knows the way I should go.
Thanks!
You can certainly send additional information to trigger an event inside your app, such as url opens, opening maps, etc.
First, you need to send a payload with your push notification that tells the app what to do. You can learn about that here:
https://parse.com/docs/push_guide#options/Android
Second, you need to create a handler inside your Android app that recognizes your push payload and knows what to do with it. You can find the appropriate start under "Responding with a Custom Activity" here:
https://parse.com/docs/push_guide#receiving-responding/Android

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.

How to send data to another android device

I want that my app will send data (Equation) to another android device and when the other device will get that data he will make calculation with that data (equation).
any idea's how to send data ??
Thanks.
P.s: its similar to this preview question: Send an equation to another android user for solving auto
You can use GCM. it's the Android push notification.
The notifications will arrive to the device regardless if the app is in the background or forground.
About the user noticing it, it's up you. The push notification itself is not showing anything to the user. It enters a callback (OnReceive) and you as the developer decides what to do with it. you can show an alert at the status bar, Send a broadcast to a service, update the DB or in your case do something with an equation etc...
Are you considering Bluetooth as an option?
If so, this lib may help you https://github.com/buddles/AndBT

Categories

Resources