Message Broadcast simulation in Android - android

I am developing a POC Message client in Android. This app mimics a messaging application, there is no server interaction. The application starts a new chat with a random user. I want to use Broadcast receiver & message object ( as in a real application ). As there is no server interaction, I want to create a Broadcast sender part in this app, which should randomly generate some messages; My app receives these messages through Broadcast receiver, process the message & show on UI. So, while demoing, it looks like a real messaging app.
If any one knows a simulator engine app in Android which I can use instead of developing a broadcast sender inside my app, Please let me know.
Or, if any one can suggest some better idea for implementing a mimic messaging application, please advise. Thanks in advance.

You can create a service for your app which will always listen on ACTION/signal/message you want. It will activate your app if it gets specific message. And it will run always in the background so that user will never notice it. Hope this will give you a hint.

Related

Sending Notifications to android app? How to implement server-side (own server, FCM)?

I come from the JavaEE development and I'm totally new to android app developement and I'm a bit confused how to implement my requirements. I have a server, where the user has to authetificate and can perform CRUD-Operations via REST-webservice. When a specific event is triggered server-side I want to send a notification to the app. The user should recive the notification even when the app is not running at the moment.
So now my questions:
What do I need on client side so I can recieve this notifications even when the app is not running? Or do I recieve them even if the app is not running? The data input from the notification needs to be safed app-side.
How do I send a notification from my server if the event is triggered? Do I have to use FCM(/GCM?) or can I directly send notifications from my server to the app?
Any help is appreciated!
Typically, 'instant notifications' are done via websocket severs, for mitigating the process of setting one up yourself, people typically use something like Pusher, which has a library available for java, or you can obviously use FCM/GCM. In conjunction with this document you should be able to keep the service running on the andriod app even when running in the backround so you can still send notifications, just remember you'll have to still attempt to detect if they have internet connection or not when sending out those notifications.

How to send notifications when my app is not running?

I am writing an Android app. I want to send notifications to a device which is not currently running my app. I want to notify what all the new features my app will provide, or when i text something to a person he should be notified about that. How this can be done??
Can we do it with parse.com? If not then what?
Thanx in advance
Yes. You can use Parse Push Notifications for sending messages to devices directly. Another option available would be Google Cloud Messaging. Read more here..
But for all cloud messaging services, you will have to provide a background service which can receive this message and handle it as per requirement. Means, a service will be running in background even when the app is not running in foreground.

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

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).

Android: Infinitely running Service for receiving events?

I have a requirement that my app, can receive events (e.g. messages) from server any time (even if app is not running). So do I need to create an infinitely running service to listen for these events?
This to me seems similar to Email apps in Smartphones, like whenever you receive a new email(event in my case), its able to show notifications and also able to update my list adapter whenever I receive an event.
But I dun know how will I implement this?
You should take a look at C2DM (push-messages):
http://code.google.com/intl/sv-SE/android/c2dm/index.html#intro
it allows a server to send messages to devices at any time.
From the link:
Here are the primary characteristics of Android Cloud to Device
Messaging (C2DM):
It allows third-party application servers to send lightweight messages to their Android applications. The messaging service is not
designed for sending a lot of user content via the messages. Rather,
it should be used to tell the application that there is new data on
the server, so that the application can fetch it.
[...]
An application on an Android device doesn’t need to be running to
receive messages. The system will wake up the application via Intent
broadcast when the the message arrives, as long as the application is
set up with the proper broadcast receiver and permissions.
[...]
Events from server are called "push notifications" and are implemented via "Cloud 2 device messaging" (C2DM). On the mobile side these messages are submitted as broadcast events (see BroadcastReceiver). For a complete example see some tutorials: Google, Vogella or here on Stackoverflow
I think you have to start a Service as soon as the device booted. There is a good tutorial here how to achieve this.

Categories

Resources