Update ListView content via JSON response without the use of service

KaHeL

I'm thinking about this for a while now. Well I have some ideas about this but I know it won't work. Now what I wanted to achieve is for the adapter for listView to be updated automatically while the webservice that gives a response in JSON format works on the background.

Okay to give more idea I just wonder how does the facebook app pulls the updates without using the pull to refresh? I'm thinking of 1 way: they use service which runs let's say every 15 seconds and get's the updates. But can this be done on a more real time way just like on how an AJAX works?

Hope someone can give an ideas on this cause I really wanted to create an app which runs on a realtime updates but doesn't require that much of a memory on the device end.

Augustus Francis

Use Google Cloud Messaging.

enter image description here

Google Cloud Messaging for Android (GCM) is a free service that helps developers send data from servers to their Android applications on Android devices, and upstream messages from the user's device back to the cloud. This could be a lightweight message telling the Android application that there is new data to be fetched from the server (for instance, a "new email" notification informing the application that it is out of sync with the back end), or it could be a message containing up to 4kb of payload data (so apps like instant messaging can consume the message directly). The GCM service handles all aspects of queueing of messages and delivery to the target Android application running on the target device.

Here are the primary characteristics of Google Cloud Messaging (GCM):

  1. It allows 3rd-party application servers to send messages to their Android applications.
  2. Using the GCM Cloud Connection Server, you can receive upstream messages from the user's device.
  3. An Android application on an Android device doesn't need to be running to receive messages. The system will wake up the Android application via Intent broadcast when the message arrives, as long as the application is set up with the proper broadcast receiver and permissions.
  4. It does not provide any built-in user interface or other handling for message data. GCM simply passes raw message data received straight to the Android application, which has full control of how to handle it. For example, the application might post a notification, display a custom user interface, or silently sync data.
  5. It requires devices running Android 2.2 or higher that also have the Google Play Store application installed, or or an emulator running Android 2.2 with Google APIs. However, you are not limited to deploying your Android applications through Google Play Store.
  6. It uses an existing connection for Google services. For pre-3.0 devices, this requires users to set up their Google account on their mobile devices. A Google account is not a requirement on devices running Android 4.0.4 or higher.

    See this webpage for more details

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

json response in ajax is correct, but content doesn't update?

From Dev

could not update a variable in an angular service with ajax response data and use is to filter

From Dev

could not update a variable in an angular service with ajax response data and use is to filter

From Dev

JSON response in a listView

From Dev

Alamofire response contain text before JSON content use it with SwiftyJSON

From Dev

update position listview json

From Dev

Update the response without null value

From Dev

Update the response without null value

From Dev

How can i update div's class and content without reloading the page on JSON update

From Dev

modify content of http response via haproxy

From Dev

REST Service | JSON response format

From Dev

How to use this JSON response?

From Dev

How to use and update NativeScript ListView

From Dev

Wcf rest service with json response and service status

From Dev

How to Update the Ck edior content on each response

From Dev

update listview in my activity from service android

From Dev

How I can update my container image in bluemix, without stop my actual service that use this container?

From Dev

parsing a data from JSON response and populating to listview

From Dev

Update GridView/ListView without re-populating

From Dev

AngularJS: Bind a directive to a Controller via a Service update

From Dev

Get json response without specifying '.json in URL'

From Dev

Display content of JSON response using Knockout

From Dev

Send MySQL blob content as a json response

From Dev

How to put a JSON file's content in a response

From Dev

Display content of JSON response using Knockout

From Dev

Twisted - Update web page content without reloading

From Dev

ModX: how to update database without overriding content

From Dev

Use JSON file to populate a listview

From Dev

Use Json data in Exapndable listview

Related Related

  1. 1

    json response in ajax is correct, but content doesn't update?

  2. 2

    could not update a variable in an angular service with ajax response data and use is to filter

  3. 3

    could not update a variable in an angular service with ajax response data and use is to filter

  4. 4

    JSON response in a listView

  5. 5

    Alamofire response contain text before JSON content use it with SwiftyJSON

  6. 6

    update position listview json

  7. 7

    Update the response without null value

  8. 8

    Update the response without null value

  9. 9

    How can i update div's class and content without reloading the page on JSON update

  10. 10

    modify content of http response via haproxy

  11. 11

    REST Service | JSON response format

  12. 12

    How to use this JSON response?

  13. 13

    How to use and update NativeScript ListView

  14. 14

    Wcf rest service with json response and service status

  15. 15

    How to Update the Ck edior content on each response

  16. 16

    update listview in my activity from service android

  17. 17

    How I can update my container image in bluemix, without stop my actual service that use this container?

  18. 18

    parsing a data from JSON response and populating to listview

  19. 19

    Update GridView/ListView without re-populating

  20. 20

    AngularJS: Bind a directive to a Controller via a Service update

  21. 21

    Get json response without specifying '.json in URL'

  22. 22

    Display content of JSON response using Knockout

  23. 23

    Send MySQL blob content as a json response

  24. 24

    How to put a JSON file's content in a response

  25. 25

    Display content of JSON response using Knockout

  26. 26

    Twisted - Update web page content without reloading

  27. 27

    ModX: how to update database without overriding content

  28. 28

    Use JSON file to populate a listview

  29. 29

    Use Json data in Exapndable listview

HotTag

Archive