Implementing a Shopping Cart [closed] Implementing a Shopping Cart [closed] sqlite sqlite

Implementing a Shopping Cart [closed]


Passing the shopping cart items around in extras or using an Application class is too volatile. If your app crashes, the user exits the app, android decides to close your app, .. basically anything that closes your app.. The user will lose the contents of their shopping cart.

SQLite would be a good option for storing data like this.You could also store the shopping cart in an xml file on the user's phone.


Is there any other better way to implement such a thing?

First of all you have to understand that what is Shopping Cart Software? However you may develop shopping cart client (Tutorials) in android.

The shopping cart system has server-application (which you may develop using the RESTful web-services,servlets and filter) and client-application (you may develop a web-client or Android client). The RESTful web-services, which expose Shopping Cart API and you may interact them (Web-services) with Android UI and network API (Apache http client).


One way is to have your shopping cart stored in a public static variables. Since I had to implement the shopping cart for few of my Android apps, I have tried to create a library project for it.

You can check it out here: https://github.com/tonyvu2014/android-shoppingcart and an example on how to use the library is here: https://github.com/tonyvu2014/android-shoppingcart-demo