• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

which one is best to use get data fro mWeb service

 
Ranch Hand
Posts: 1325
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Bartender
Posts: 1051
5
Hibernate Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
shawn peter
Ranch Hand
Posts: 1325
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
shawn peter
Ranch Hand
Posts: 1325
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Maneesh
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic