Find file History
Failed to load latest commit information.

Mobile app showing the AeroGear Store feature on Android

Author: Daniel Passos (dpassos)
Level: Beginner
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?

System Requirements

Build Application

$ 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:

  1. Install generated apk to device

    $ cd /path/to/carStore
    $ ./gradlew installDebug
  2. 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)

After that the CarStoreActivity will be invoked. The Activity life cycle onResume is called first retriving all data

Collection<Car> cars = storeApplication.getStore().readAll();