Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

which one is best to use get data fro mWeb service

 
sam liya
Ranch Hand
Posts: 1243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am writing code to get data from database.Data gettng from web service.So i am getting xml file.IT takes some time as it has much data.So which one is good to use from Service or Method to get data from Web service?
 
James Boswell
Bartender
Posts: 1051
5
Chrome Eclipse IDE Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are asking numerous questions here. Let's back up a little and take one question at a time.

So, is it your responsibility to get data from the database? What database are you using? Could you provide an example of the data you are retrieving?
 
sam liya
Ranch Hand
Posts: 1243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no i mean in android we have services for background works.So my question is which one is better to use for getting data from Web service?
 
Maneesh Godbole
Saloon Keeper
Posts: 11329
16
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So which one is good to use from Service or Method to get data from Web service?

Since we don't know anything about the data why don't you try doing it both ways, compare the results, and share your findings back here?
Use System#currentTimeMillis to obtain the start and end time for the call. Difference between these two values will tell you how much time a Service takes and how much time a Method takes
On a side note, did you know the service will use a method to fetch the data?
On another side note check out http://developer.android.com/reference/android/os/AsyncTask.html.
 
sam liya
Ranch Hand
Posts: 1243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Maneesh
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic