Should I use arrary or sqlite database?

  • Replies:3
landysaccount
  • Forum posts: 2

Mar 17, 2017, 11:17:13 PM via Website

Hello.

This is my first post to this forum seeking assistance on a APP I'll trying to create. I don't have no experience with android app development but, I'm studying and practicing.

I'm trying to build an app to record payments from a list of customers and print a receipt when paid. I download a list of customers with pending balance, using json array into android. Now, I'm confused, don't know if I should use arrays or a database to store the list, since I need to update (upload) later to the server. SQLite seems like an option but, I have to download the list every time user is connected to WiFi.

I guess I have to store the payments on an array and flush it once uploaded.

Can you please tell me what would be the best option for the tasks I'm trying to accomplish.

Thanks in advanced for your time and help.

Reply
James Watson
  • Forum posts: 1,584

Mar 18, 2017, 2:42:10 AM via Website

I think it is SQLite DB because you will have to store payment data even if your smart devices power off.

Download size < 0.15 MB. But also accurate enough, ad-free & free.
The minimalist app available on Play Store: https://goo.gl/ws42fN
Blog: https://okblackcafe.blogspot.com Your 5-star is appreciated.

Reply
landysaccount
  • Forum posts: 2

Mar 18, 2017, 2:55:42 AM via Website

Jame_Watson

Thanks for replying. I leaning toward DB, the only thing is I would have to work with two databases (I don't know if that's possible) within the same app. One for the data received, and one for the payments received during the day. Upload and update the server with the new payments, once uploaded, delete the payment and customer DB and reload customer DB with the new updated info from server. This update will only happen if there is WiFi connection.

I don't know if that take too much resources but, sounds like it.

Reply
James Watson
  • Forum posts: 1,584

Mar 19, 2017, 3:42:18 AM via Website

Maybe you just need different tables in a DB. And you may update data records other than upload the whole db file.
Just for your reference.

— modified on Mar 19, 2017, 3:43:01 AM

Download size < 0.15 MB. But also accurate enough, ad-free & free.
The minimalist app available on Play Store: https://goo.gl/ws42fN
Blog: https://okblackcafe.blogspot.com Your 5-star is appreciated.

Reply