0

I have an android app and I would like to implement the search function.

This function shuld access the live server and request all the data containing the searched word.

The problem is that the database is pretty huge and instead of waiting to get all the response an once (very slow), I would like to show results as soon they are availible.

for example, the user is looking for "hello" and in my database I have 10 Strings with hello:

hello1 hello2 hello3 hello4 hello2 hello6 hello7 hello8 hello9 hello10

Instead of waiting all the hello's, i would like to show first hello1, then the hello2 will apear etc.

Do you have an ide how this could be done. Actually, I am using soap requests fo the client-server communication.

Thank you.

Milos Cuculovic
  • 19,631
  • 51
  • 159
  • 265
  • you can first request the server and store the response in localdatabase (sqlite) and then do any operation on that database by query. – user1208720 May 24 '12 at 12:50
  • I know this, but let say that i have 3gb of data on the server, impossible to store all on the phone.Lets say that the search will be done on the server side, the server will took 3sec to make the search atd find some data, then 2 additional sec to send the data, then the app will take 3sec to parse all those data and store them on the local db, then the local db needs to be shown on th sscreen, this is 10sec, if there are not a lot of data found, but if there are a lot of data, this operation can take 1-2 min. Instead of waiting one or 2 min, i would like to show results progressively. – Milos Cuculovic May 24 '12 at 12:58

1 Answers1

0

Ana I think you can try using a content provider. Create a service which will pull the data from the live server and update the table. Start querying the table after some delay and keep on updating the results as and when user starts scrolling. Just a thought never tried though!!!.

Nick
  • 185
  • 1
  • 12
  • Thank you @Nick, but how can I pull the data from the server, i need to do requests each x sec or? Actually, if I need some data from the server, I will make a soap request and once the data are received, I parse them and store on the local db. – Milos Cuculovic May 24 '12 at 12:59