Android app to perminantly monitor a database and alert on change - android

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.

Related

what data is sent or received from apps installed on my android?

I am trying to build an android application which will display the user what data was sent from all apps and what data was received on all apps installed on the device.
I have searched but nothing came which could give me a start. Is there any encryption/decryption techniques used(Since i have no idea about the same).
It would be a privilege if i get to know where to start with this project.
I think you are talking more about a background service running all the time, but that's really complicated if you don't have clear idea on how they works.
Start with this: http://developer.android.com/guide/components/services.html

Using sails.js to find out online status of users in Android app

I am developing an Android app that uses a Sails.js server to read and write data to a MongoDB database.
I need a method to tell whether a user is currently online or not on the app.
The definition of 'online' for my app is that the user either has logged in and has the app open on any page/activity within the last 5-10 minutes.
One method I have considered is every so often in the app running a method that updates a "lastOnline" field for the User on the server with the current timestamp, then to check whether a user is online, checking whether each user's lastOnline field is within X minutes.
Another method I have recently considered is webSockets. I am aware that Sails.js has built in Socket.io features, however I am unsure how I would be able to use them for this functionality.
The idea I had regarding sockets would involve, upon logging into the app, connect to the server using websockets. On the servers receipt of this connection, the server would change an "online" boolean field in the User model to true.
However the main question I have with this, is if the app were to close, or become inactive in the background for a few minutes, how would the server then change the online boolean to false;
Thanks for any help or advice you can offer!

Design of website pushing info to the app, or app retrieving from website

I have a design question about Android app and I am not sure if I can ask it here (If not please advise when I can ask).
I want to make an app where it gets information from a website (or actually make the website push locations to the app). Imagine a webform that has 3 fields (3 trucks locations). I want that everytime I put those values and click submit, The android app on the devices will show the location of the trucks on the map. I am familiar with the google maps so I know how to show 3 dots on the map given the location. I also know how to write HTML code that would do POST/GET upon press of a submit button But the communication and how to initiate this trigger on the app is what I am confused about. So it is more of an architecture design question. I need a starting point to know where to start looking. I hope I delivered my point here.
sooo Any help ?:)
Your talking about setting up push notifications, look at http://parse.com/products/push
This may be a use case for using Google Cloud Messaging (GCM). I have not worked with GCM yet but this is one option.
Another idea is to setup an AlarmManager to schedule the fetching for data. One draw back I can think of is if you set the AlarmManager to be frequent (ex: every 10 minutes) then all those network requests are going to drain the battery quickly.
Another alternative and similar to the polling, is to have a button within the application where the user manually presses to get the latest data.

Android GPS Tracking application with online panel

hello i want to develop an GPS Tracking Application with an online panel.
i have been looking and learning this code found here:
http://code.google.com/p/open-gpstracker/source/
But they don't provide any online tracking information, i need to make a GPS application with admin to see online data of the track traces and record like WAY Android application.
And i don't want user to view tracking on mobile, the application only runs in background.
I just need guide, where to start and what stuffs i need to look at.
I know asking here without a source code is waste of time, still i hope you guys can provide me a startup guide to get started with my development.
I think I have exactly what you want:
https://github.com/tananaev/traccar-client-android
The server side code:
https://github.com/tananaev/traccar
and web interface is a separate project:
https://github.com/tananaev/traccar-web
A good start might be checking out this example app: https://github.com/cintric/cintric-android-demo
It uses a free Cintric SDK for battery efficient tracking. It also has a cool web panel which might provide good inspiration for your app.
The SDK provides callbacks for GPS updates which you can then use to send to your server, or you can let cintric manage sending the data and sync in batches via the api.

How to send data from an Android application to a server?

I'm developping an online Chess game in Android. The first player uses the app and the second a webpage in html.
What i want to do is to send the text with the information of every move each player makes in his turns. All the processing and validation parts of the game will be done in the Android application. The second player just receives the text, parses it into html code and then send a very similar text to the application in order to receive the authorisation of the move.
I'm really trying to spend the least possible of internet resources.
I've been searching what's my best option in order to send the messages with Android, but since I'm not very experienced with it, I don't know what to do.
I found these possibilities for sending the messages:
GCM
Android ServerSockets and Sockets
Making Push technology, like long-polling
I have never used any of those technologies, but I would like to know which one could be the best for starting to make a deeper research of.
As you can see a chess game doesn't need a great amount of messaging since I have to send and receive a single message per move and per the authorisation of it by the chess engine in the Android application.
If you know a better solution or links with an example of the technology I should use, I would be very grateful.
On your case it's just matter if the the Android player will need to be with the app running (real time play) or there will be the option to send the play, play turn off the app, and see the next move in a few hours?
If it's a real time just open the connection and use polling or sockets to keep the game running.
If it won't be a real time game, GCM is probably your best approach.
But remind that both options will mean you'll need your own web-server running stuff.

Categories

Resources