+ 3

Any advice on how to make the sending and receiving of json data to and from android studio faster?

I'm currently developing an app that requires sending and receiving of data from android studio going to MySQL and then data coming from MySQL will be saved from the SQLite. I need advice on how to make the process faster. Right now I'm inserting 80,000 + rows of data coming from MySQL and then saving it to SQLite and that process lasts around 25-30 minutes.

22nd Feb 2019, 3:26 AM
ariamossar
ariamossar - avatar
5 Réponses
+ 4
Are the 80.000 rows different every time? Are you saving the data in sqlite or dropping it every time? Are you sure you need to store them locally, instead of consuming just specific partial results (queries) from MySQL? If the full download is unavoidable at least one time, then the next time you may want to only download the delta (the changes made since last download) which could be based on a timestamp.
22nd Feb 2019, 11:33 AM
Tibor Santa
Tibor Santa - avatar
+ 2
I am just curious, what is the 'other function of the application' that needs to use 80.000 rows? It is a bit difficult to suggest ways of optimization without actually seeing your code or at least understanding what it is supposed to do.
22nd Feb 2019, 12:42 PM
Tibor Santa
Tibor Santa - avatar
+ 2
But the user of the application, I suppose, is not working with all 80.000 rows of data at the same time. If he is, then most likely he is first looking at the data at a more aggregate level. At that point I would only pull the aggtegates from MySQL, e.g. Group by product category. When he starts drilling down maybe only query small portions of data at each time, that is relevant for the user.
22nd Feb 2019, 1:24 PM
Tibor Santa
Tibor Santa - avatar
0
The 80,000 rows are different and it is actually already partial. The total rows from that table in MySQL is around 100,000. It needs to be stored locally because the data will be used in other function of the application. I think the my problem is the way I saved it in the SQLite, I'm already using transaction but it's not working,but it still could be the in the MySQL.
22nd Feb 2019, 11:44 AM
ariamossar
ariamossar - avatar
0
The application is an inventory system. The rows I'm getting from the MySQL is a table of products and it's brand and it will be used during saving of how many those products were sold , returned etc.
22nd Feb 2019, 1:19 PM
ariamossar
ariamossar - avatar