Mobile app showing the AeroGear Store feature on Android
Author: Daniel Passos (dpassos)
Technologies: Java, Android
Summary: A basic example of Store : CRUD
What is it?
The CarStore project demonstrates how to include Store functionality in Android applications.
This simple project consists in CRUD for Android application.
When the application is deployed to an Android device, the application will show all previous data saved
How do I run it?
$ cd /path/to/carStore/ $ ./gradlew clean build
Running the app
To deploy, run and debug the application on an Android device attached to your system, on the command line enter the following:
Install generated apk to device
$ cd /path/to/carStore $ ./gradlew installDebug
- Open app on device
How does it work?
CarStoreActivity is invoked when open the application. The Application life cycle
onStart is called creating and opening the Car Store database instance.
carStore = (SQLStore<Car>) DataManager.config("carStore", SQLStoreConfiguration.class) .withContext(getApplicationContext()) .store(Car.class); carStore.openSync();
After that the
CarStoreActivity will be invoked. The Activity life cycle
onResume is called first retriving all data
Collection<Car> cars = storeApplication.getStore().readAll();