PolitcalPreparedness is an example application built to demonstrate core Android Development skills recommended by Google.

Overview

Political Preparedness

PolitcalPreparedness is an example application built to demonstrate core Android Development skills recommended by Google.

This app demonstrates the following views and techniques:

MVVM (repository pattern) + ViewModel + LiveData + Data Binding + Room Database + Koin (dependency injection)

  • Retrofit to make api calls to an HTTP web service.
  • Moshi which handles the deserialization of the returned JSON to Kotlin data objects.
  • Glide to load and cache images by URL.
  • Room for local database storage.
  • Koin a pragmatic lightweight dependency injection framework for Kotlin
  • Motion Layout to create animations and motion

It leverages the following components from the Jetpack library:

Setting up the Repository

To get started with this project, simply pull the repository and import the project into Android Studio. From there, deploy the project to an emulator or device.

  • NOTE: In order for this project to pull data, you will need to add your API Key to the project as a value in the CivicsHttpClient. You can generate an API Key from the Google Developers Console

Android UI/UX

  • Build a navigable interface consisting of multiple screens of functionality and data:
    • Application includes at least three screens with distinct features using either the Android Navigation Controller or Explicit Intents.
    • The Navigation Controller is used for Fragment-based navigation and intents are utilized for Activity-based navigation.
    • An application bundle is built to store data passed between Fragments and Activities.
  • Construct interfaces that adhere to Android standards and display appropriately on screens of different size and resolution.
    • Application UI effectively utilizes ConstraintLayout to arrange UI elements effectively and efficiently across application features, avoiding nesting layouts and maintaining a flat UI structure where possible.
    • Data collections are displayed effectively, taking advantage of visual hierarchy and arrangement to display data in an easily consumable format.
    • Resources are stored appropriately using the internal res directory to store data in appropriate locations including string values, drawables, colors, dimensions, and more.
    • Data collections should be loaded into the application using ViewHolder pattern and appropriate View, such as RecyclerView.
  • Animate UI components to better utilize screen real estate and create engaging content.
    • Application contains at least 1 feature utilizing MotionLayout to adapt UI elements to a given function. This could include animating control elements onto and off screen, displaying and hiding a form, or animation of complex UI transitions.
    • MotionLayout behaviors are defined in a MotionScene using one or more Transition nodes and ConstraintSet blocks.
    • Constraints are defined within the scenes and house all layout params for the animation.

Local and Network data

  • Connect to and consume data from a remote data source such as a RESTful API.
    • The Application connects to at least 1 external data source using Retrofit or other appropriate library/component and retrieves data for use within the application.
    • Data retrieved from the remote source is held in local models with appropriate data types that are readily handled and manipulated within the application source. Helper libraries such as Moshi may be used to assist with this requirement.
    • The application performs work and handles network requests on the appropriate threads to avoid stalling the UI.
  • Load network resources, such as Bitmap Images, dynamically and on-demand.
    • The Application loads remote resources asynchronously using an appropriate library such as Glide or other library/component when needed.
    • Images display placeholder images while being loaded and handle failed network requests gracefully.
    • All requests are performed asynchronously and handled on the appropriate threads..
  • Store data locally on the device for use between application sessions and/or offline use.
    • The application utilizes storage mechanisms that best fit the data stored to store data locally on the device. Example: SharedPreferences for user settings or an internal database for data persistence for application data. Libraries such as Room may be utilized to achieve this functionality.
    • Data stored is accessible across user sessions.
    • Data storage operations are performed on the appropriate threads as to not stall the UI thread.
    • Data is structured with appropriate data types and scope as required by application functionality.

Android system and hardware integration

  • Architect application functionality using MVVM.
    • Application separates responsibilities amongst classes and structures using the MVVM Pattern:
      • Fragments/Activities control the Views
      • Models houses the data structures,
      • ViewModel controls business logic.
    • Application adheres to architecture best practices, such as the observer pattern, to prevent leaking components, such as Activity Contexts, and efficiently utilize system resources.
  • Implement logic to handle and respond to hardware and system events that impact the Android Lifecycle.
    • Beyond MVVM, the application handles system events, such as orientation changes, application switching, notifications, and similar events gracefully including, but not limited to:
      • Storing and restoring state and information
      • Properly handling lifecycle events in regards to behavior and functionality: Implement bundles to restore and save data
      • Handling interaction to and from the application via Intents
      • Handling Android Permissions.
  • Utilize system hardware to provide the user with advanced functionality and features.
    • Application utilizes at least 1 hardware component to provide meaningful functionality to the application as a whole. Suggestion options include:
      • Camera
      • Location
      • Accelerometer
      • Microphone
      • Gesture Capture
      • Notifications
    • Permissions to access hardware features are requested at the time of use for the feature.
    • Behaviors are accessed only after permissions are granted.

Report Issues

Notice any issues with a repository? Please file a github issue in the repository!

You might also like...
ListView Example with custom Adapter Using Kotlin in Android Studio
ListView Example with custom Adapter Using Kotlin in Android Studio

Kotlin-ListView ListView Example with custom Adapter Using Kotlin in Android Studio Steps to follow : Build ListView with Custom Adapter in Kotlin Add

An example to show how a proper plugin for Lambda Client is set up

Lambda Plugin SDK This project in an example to show how a proper plugin for Lambda Client is set up. The advantage of plugins for a utility mod is th

Its a small example with Custom Employee object is sent from one Fragment to another.
Its a small example with Custom Employee object is sent from one Fragment to another.

Kotlin-SafeArgs-Custom-Object Its a small example with Custom Employee object is sent from one Fragment to another. Dependencies used // Navigation

ROOM Database Example with MVVM in Kotlin[Fragments,Navigation]

RoomDatabase_SampleApp Room Database Sample App Overview Of This Room Database Application In this app, we can do operation on room database | Insert,

Spring Native Bookcase Backend Example

Spring Native Bookcase Backend Example Simple example for bookcase backend. Saves bookcases and list them (simple CRUD). set database connection prope

This is the toy app for Lesson 9 of the Android App Development in Kotlin course on Udacity.
This is the toy app for Lesson 9 of the Android App Development in Kotlin course on Udacity.

Behind the Scenes - DevByte Viewer App This is the toy app for Lesson 9 of the Android App Development in Kotlin course on Udacity. DevByte DevByte Vi

Learn How to use Google Map API for Android from Basic to Advance with complete examples.

Complete-Google-Map-API-Tutorial Learn How to use Google Map API for Android from Basic to Advance. Satellite View 3D Building Map and StreetView Lear

A Google coding competitions practice preparing to the hashcode competition
A Google coding competitions practice preparing to the hashcode competition

One Pizza This is a Google coding competitions practice preparing to the hashcode competition.

A libktx game built during a tutorial (see README)

DarkMatter (Clone) Based on a tutorial series by @Quillraven on https://www.youtube.com/watch?v=25_xCStxi9g&list=PLTKHCDn5RKK-8lZmjZoG4rFywN_SLbZR8&in

Owner
Pranav Patel
Pranav Patel
This is an example repository to demonstrate the good practices of using ViewModel and how usage of AndroidViewModel can make things worst in a codebase

ViewModel Good Practices ??‍♂️ This is a example repository to demonstrate the good practices of using ViewModel and how usage of AndroidViewModel can

Shreyas Patil 29 Sep 28, 2022
An example Android Application to test out Kotlin development in Adndroid

AndroidDiceGenerator This is an example Android Application to test out Kotlin development in Adndroid. On pressing a button, the application generate

Fredrick Ojure 0 Oct 28, 2021
A sample app that demonstrate how to build an Android application using the Uncle Bob's Clean Architecture approach

A sample app that demonstrate how to build an Android application using the Uncle Bob's Clean Architecture approach

Ahmed Shaban  Elhdad 2 Apr 8, 2022
This example was built for lecturing proposes, it shows how to consume data from an API.

Android Kotlin NewsMobEDJDCM2122 Example - EDJD 2021/2022 This example was wirten during the Mobile Computing lectures in the course 'Lincentura em En

null 0 Nov 8, 2021
The simple app is to demonstrate how the modern Enterprise Android App Architecture should be

Weather Forecast App The simple app is to demonstrate how the modern Enterprise Android App Architecture should be. Clean Architecture (Mr Uncle Bob)

null 2 Nov 12, 2021
This application is an example of how to create menu on android platform.

HW_Menu This application is an example of how to create menu on android platform. Table of Contents Introduction Screenshots Resources Contact Introdu

Ibrahim Alfaifi 0 Nov 9, 2021
Mobile Application Development

Mobile Application Development Exercise 4 Create a List of 20 User objects in the ListActivity. Randomize the name, descriptions and value of Followed

null 2 Feb 17, 2022
This is an example implementation of android accessibility services with 5 Sample Actions

Android Accessibility Services Example This is an example implementation of android accessibility services with 5 Sample Actions such as: Simulate Pow

Muhammad Fahriansyah 7 Jul 1, 2022
📌This repo contains the kotlin implementation of TensorflowLite Example Android Apps🚀

TensorflowLite Examples Kotlin This repo contains the kotlin implementation of TensorflowLite Example Apps here, which are mostly implemented in java

Sunit Roy 29 Jan 1, 2023
Example Android library project that works with jitpack.io

android-example Example Android library project that works with jitpack.io. See this Tutorial on how to publish an Android Library with JitPack. For m

Denys Denysenko 0 Dec 20, 2021