I am working on an app that would have a couple of text views that change based on menu items. I currently have a method for doing this involving socket communication between a constantly running server and the app, but I don't want to have a constantly running server and computer. Is there some way to send an update (without updating the entire app) to send menu changes from a computer to the app? Thanks for any and all help, I will clarify if needed.
Related
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.
In my application (iOS and Android), I have to create sync process in which changes in one device (suppose iOS) reflect the same on other one (suppose Android) I.e. something like real time method callback on other device with data change. Also is it ok if I try to create XMPP server for this?. I know it is use for real time messaging thing but just to reflect changes on other device can we use this? Plus if you are going to suggest third party API then preferably free one.
I am developing an app as follows:
Android APP (As a client)..it will send data to a Server (Java application running on a PC).
I implemented this using socket programming and it is working. I have following issues:
When I click the send button on my app the APP UI freezes for ~7 seconds. It is able to ping and connect to server but during this time frame the UI freezes and if I click any other button on the app I get a message app is stuck (but the app comes back ok after ~ 7 seconds). What is the best way to resolve it.
Once data (strings) is received on the PC, I want to show it in the form of List Box UI so that user can select/double click on the specific string and a message box is open showing that that particular string is selected. What is the best way to develop this UI and how can it be invoked directly as soon as server receives the data from Client (android app) and this UI should show up.
Please let me know. All help is appreciated.
Place all your network-related code into a separate thread, or (easier) and AsyncTask. Otherwise, you would block the UI, as you have noticed, and the app would actually crash on newer Android versions (ICS and JB).
If you search SO and the interwebs, you will find plenty of examples.
Is there a way or an example to use a service or something to auto update any changes made from an app to show on other devices using the same app?
We have a native/local application we use in-house for Android tablets for taking and editing data. More or less a check-in app.
We were needing to:
If a users on one tablet makes a data change in their application, to automatically change the status/data on the other tablets running the same application without having to manually refresh or restart the application.
If a user makes a change to the data and saves it, could we cause a push notification to the other tablets to indicating a change to the data has been made.
if you are working "online" or at least on a network, you could use a REST request to send your changes or a notification to a server (depending on what you need). Then the notification to other devices can be handled through libraries like Signal-R or PushSharp
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.