Planning to update Android messages

Asked

Viewed 44 times

0

My question is this:.

I’m making an android app and will implement the interface now.

The app works with an online parse where you take the data. ( I think of implementing as a service updating a database )

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

In case I thought of doing broadcast warning of new messages the application.

Does anyone have any other suggestion how to implement this solution ?

2 answers

1

The correct would be that, could make a Service that is searching the data on the server and when finished the request sends an Input for Activity informing that it has new data, so the Activity receives the Input and makes the necessary action to update it.

  • Is there an example of an organized code about something like this ? I say a simple class structure

0

Since you need the Activity independent service you cannot create it coupled (binded services) to Activity.

Send a service broadcast and receive on Activity saying that the data has been updated.

From there create an Asynctask to interpret the data and update in the UI.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.