Planning update of Android messages

0

My question is the following.

I'm making an android app and I'm going to implement the interface now.

The application works with an online parse where it picks up the data. (I plan to deploy as a service updating a database)

After the updates that the service does in the database, how will I update it in the user interface if new messages arrive while the user is in Activity?

In the case I thought about broadcasting warning of new messages the application.

Does anyone have any other suggestions on how to implement this solution?

    
asked by anonymous 21.07.2014 / 16:01

2 answers

1

The correct would be that, could do a Service that is looking for the data in the server and when it finishes the request sends an intent to Activity informing that it has new data, thus the Activity receives the intent and does the necessary action to update it, la.

    
21.07.2014 / 16:07
0

As you need the service to run independent of the activity you can not create binded services.

Send a broadcast of the service and get on the activity saying that the data has been updated.

From this, create an AsyncTask to interpret the data and update in the UI.

    
20.08.2014 / 17:04