Phonegap- better way to implement

  • 1
  • Question
  • Updated 5 years ago
  • Doesn't Need an Answer
I am creating an app in phonegap for daily news, I am storing my news details to amozon s3 server.
So in my app home page i am displaying all news list. User can read news in both offline and online mode.
I stored amozon s3 file link in my database. So for fetch the news detail i called the s3 file and get its details.
When my app load i am fetching all news list and store it to my local database(sqllite). For getting all news details i am excuting all list in a loop(one by one) and hit a http request for fetch the every news details.
The problem is that if i have 500 news list, then each time it iterate to 500 time and call the http request 500 time. That decrease my application proformence.(Some time http request failed and i am getting few news list details and then user can not able to read news in offile mode).
Can You please tell me any better solution for it.
Photo of Ankita

Ankita

  • 1 Post
  • 0 Reply Likes

Posted 5 years ago

  • 1
Photo of JesseMonroy650 (Volunteer)

JesseMonroy650 (Volunteer), Champion

  • 3325 Posts
  • 122 Reply Likes
@Ankita,
Welcome to the Cordova/Phonegap world. This forum is primarily for the support *Phonegap Build*, a cloud-based build system. Your question is better asked at the general purpose form in Google Groups. I suggest you post there.
TIA
Jesse
(Volunteer, not a Phonegap Employee)
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
Can You please tell me any better solution for it.
There is no better way, logically spoken. If you really want everything to be available online (regardless whether or not the user reads those articles) then you will have to load them.

However, you may consider this:
- for a News app, is it really necessary to have everything available offline? Would users expect News to be available offline?
I would not trust offline news (as a user) because you never know if the article has been edited meanwhile. In other words: offline news is not new, anymore.
- if you think articles should be available offline, wouldn't it make sense to introduce a 'favorite categories' feature for the user? The user could pick categories of news, and only these articles would be fetched to be stored offline. All other articles can be read, too, but online, only.
That would reduce the amount of articles to be read
- perhaps you could limit the number of articles to be read immediately (say, only the 25 latest articles....or any number, configurable by the user). Add a 'load more...' button for the next 25, or so. That way, the total load would not be less, but the user experience would be nicer, because now (s)he knows what to expect.