Phonegap StatusBar notifications on closed Application - android

I am creating a simple app thats only job is to inform the user if something has changed(something in the database). If something is changed the user gets a status bar notification.
I am using this plugin: https://github.com/katzer/cordova-plugin-local-notifications/tree/example.
It works perfectly if lets say I update database something manually from the application. But this wont be the way in the future. Is it possible to achieve this?
For example a user is not using the app at the moment and his wifi is offline. At that time I change something in the database. When the user turns the wifi on, he should get the news that something has been updated. Is this possible to do with phonegap?
Do I need to create some script? But how to execute it if the app is not being used?

Related

How to read notification and not show in status bar when application is closed or killed?

I am creating a demo for android and for that, I want to not show notifications for a specific application like WhatsApp, Facebook, Instagram, etc. And for that, I have added notificationlistner and it worked for me when the application is in the foreground or in the background but not in a killed state. And I want to make it happen in the application killed state.
It would be great if I get help with this.
I have a simpler answer for you- just don't have those apps on the phone you're using to demo. If necessary, buy a cheap used phone for your demo. Far less time and effort than trying hacks to make notifications of other apps disappear.

Android app to perminantly monitor a database and alert on change

I am looking to create an app that monitors an online sql database and alerts the user if records change. In case you're interested, the database is being updated by a computer as to the state of some sensors the computer is monitoring. I have already got the database and monitoring computer working perfectly and have made an app to see the data in a list view. What I want is an app that opens on start up and runs in the background constantly and when changes occur can trigger an alarm and a toast telling me what's going on. I suppose it's similar to all the push notifications your phone gets from facebook and the like but I intend the app to be actively querying the database.
Anyone able to help or point me in the right direction? I've looked around but can't seem to find the info. I'm sure it's there, I must just not be using the right terms.
Thanks for your help.
So basically here is the systems approach to what you're trying to do. You're going to want to establish some sort of websocket on your backend and some sort of NoSQL like Redis to help manage the pub/sub part to your Android App in order to stream live updates from your web/database server. Then when you go to update the record in your database you also send information over the websocket to your Android App.
That's the gist of how that type of thing works.

Do something when app closed in android

when user exit the android app in the normal way (No Hard Exit like Force Close) i want the app to do something
im working on some kind of chat app and i want the app to update user status make it offline when the user close the app.
i try few solutions but nothing worked.
You will need to implement a Service and then bind your Activity to the service so that it is aware of the Activity's state.
http://www.vogella.com/tutorials/AndroidServices/article.html

Screen to show app output inside app in android

I'm writing an android app just to get familiar with the OS and API. I'd like to show what my app is doing to the user in a seperate screen and not via notifications. The reason is that I'd like to show the user exactly what the app is querying and how long it took etc. I saw an example of this in the superuser app which shows what the app is doing when it is updating itself.
Is there a library to do this?
Is it as simple as just showing a text box and then populating it programatically?
I would have done it so..
Just push state changes to your UI thread and display them there.
You can do that via BroadcastReceiver, which is intended to let background services communicate with UI activities, or LocalBroadcastManager which is simpler version of the previous.
Here on StackOverflow you will find dozens of questions describing how to implement it.

Android : How to notify the user when the Application is not running

I am new to Android and have a problem with the Notifications. I know that this topic has been taken up earlier as well but I just wanted to know if there is any other way to go about it.
Problem : In my application I want that the user is notified that he/she has entered in the radius of a particular location. I have the functionality working when the application is alive and in the foreground. I will however want that the user is also notified when the application is not working and not there in the foreground.
In the previous posts I have found out that this can be done by using something called as the C2DM. Altough I am not much aware of it but by using C2DM I would be introducing an extra network trip. My question is that the only way to go about it? Can't this functionality be done any other way round, something locally like something of a daemon thread of sorts?
Also if C2DM is only the way, and as my application is not in my foreground will the C2DM also inform once the user reaches the radius of a particular location?
Will like to thank you all in advance. Please do let me know if any one of you have faced a situation/problem/requirement similar to this before and also if you can highlight the way forward for this?
I have the functionality working when the application is alive and in the foreground. I will however want that the user is also notified when the application is not working and not there in the foreground.
Use addProximityAlert() on LocationManager, and then it will not matter whether your app is in the foreground or not.

Categories

Resources