I want to open activity via fcm notification when app is closed and kill from background,ideal state. this time i need to open app. have any solution plz give m suggestion.
thanks in advance
I don't think that is possible with the lates Android versions. Maybe you should check this docu on when an Activity from an App can be started when it's not in the foregrounf.
Related
I've been trying to use this plugin for push notification in my app.
https://github.com/phonegap-build/PushPlugin/
And send push by Node-GCM. Everything works perfectly when the app is in foreground and in background (Background = when user tap home button).
The only problem is Notification is not showing when the app is closed or not running. If user close the app by force stop from Setting > Apps or slip the app away to terminate the app task.
I've been finding the solutions for this. But still can't solve this. Is there anyone here having experience of this and can solve it? I didn't change any code of the plugin and following the example client code from Plugin's Github. Please help me solve this. Thank you very much.
Does your notification have a "message"? Like this: {\"message\":\"Hello World!\",\"sound\":\"beep.wav\"}
That was my problem. I figured it out after reading this article: http://community.phonegap.com/nitobi/topics/_pushplugin_background_notifications_dont_seem_to_work
For what I've been reading, there are 3 running modes.
Foreground: when you are using the application.
Background: when you have the application minimized but not closed and you can restore it where you left it before minimizing.
Back-background: when you have closed your application but there are a service generated by the application that is listening some specific events (i.e. waiting push notifications).
When you are in the modes 1 and 2, your application can receive push notifications because the PushPlugin is running but, when you are in mode 3, the plugin will fail because the application is not running, you have to create the service that will be waiting for notifications or what you want.
This is what Whatsapp application is doing for example.
Here you can see a pluggin for AppGyver that does implements a service:
https://github.com/Red-Folder/bgs-core
I am makin an android application on Emergency communication.I want my application should run all the time and whenever it needs it should be able to run.I want that user should not be able to close it by any means.Like Google Maps application which is restarted again on killing its all activities and even we force close it,it will be restarted.
Seems you are learning app development ... but this is not the way you should pose question here... you should post what you have done and code issues and not ask for an entire class...
But i will try to answer your question are you trying to create an app which when started wont be able to be closed and come back to home screen ???!!!!!
See you are creating an app which will run on android operating system which is similar to linux so you must follow the Activity
LifeCycle
I remember i created an app where there were shortcuts on screen so using that i was directing the user to specific links but you can use for calling etc.. i donno if that is what you are searching for...
You might create a notification bar if you want which cannot be cancelled and you can place the code in the intent which will be called from this...
Also services are there which u can utilized what other users have suggested...
thx
You could use an extra service running in the foreground, but there will be always a notification of this service in the notification bar.
See here: http://developer.android.com/guide/components/services.html#Foreground
I am working in an application implementing an AccesibilityService, to detect when other applications are sending notifications. That is easy to do extending AccesibilityService class.
Now I would like to know, when the user opens the Notification List, but I have not found any documentation about it. The only similar thing is using new NotificationListenerService but I'm not sure if it can help. Also, my app is for 2.2+ devices, and the use of this class is for level 18+ .. (I think).
My question is if there is another way to know from my application if user have opened the notificationlist.
Thank you in advance.
no. you cannot be informed when user pulled down notification area.
I am new to Android programming and I need help. If any of you has a simple example of adding (icon/message) notification on the Phone and when clicked it restores back the application to its state. The purpose is the user could open any other application without exiting my app. Just like AIRDROID do.
I created an application where the user can login and do some tasks. But when I click the HOME it exits the application, and the user will have to login again. (Saving user/pass is not ideal for my project).
Anyone has a link/example/suggestion?
Thanks in advance.
Follow this tutorials,hope it helps :) - http://www.youtube.com/watch?v=e74z0_Z5QWI&feature=relmfu
Do you know if it is possible to launch a service directly after the installation of my application on the phone ?
Thanks
No, this is not possible or supported in Android. You can do it the first time the App is opened.
No this is not possible. But you can check if your application is first started.