+ 1
Best way to upload cart items from android to server ?
Hi, I have to upload cart items on the server. So, I have two ideas:- 1.) Upload items one by one using a loop. (in this it may happen that if any other user is also doing checkout( which will of course happen) his items and other people's items may not upload serial wise. But this is not an issue. it doesn't matter if it's not serialized. 2.) create a JSON array of those items in my cart and upload the whole JSON array on the server and parse it there one by one and keep inserting. ( with this method, I can use transactions to make sure every item gets uploaded.) So, which is the best way. if there is any third way. please mention it.
1 ответ
+ 1
The first one is a very bad idea. You will have to make multiple network calls which will be costlier on device side. The 2nd option is what people use generally.