This is a demo of how to build a basic image loading app that keeps track of the number of times each image is loaded using SQLite. This app is a useful demo of the following topics:
- Perform networking with
HttpURLConnection
to load remote images intoBitmap
objects - Create a database using
SQLiteOpenHelper
and create the database schema - Query and update data from tables within a database using a
Cursor
You can review the following key files below:
- ImageLinksCount - Model representing the table storing links and open counts.
- ImageLinksCountDatabase - The
SQLiteOpenHelper
that enables a database connection. - ImageLoaderLibrary - Simple image loader library built on top of
HttpURLConnection
- MainActivity - The activity which brings this whole app together.
Check the following Android guides for more details:
Walkthrough: