Project with AIDL, LifecycleService, CustomView

Overview

Digital Speedometer

Project, where speed values are generated in background in the Service (SpeedValuesService). Then values are sent to Activity (MainActivity), that has fullscreen custom digital speedometer view (DigitalSpeedometerView). While app is running, device screen won't turn of.

Project consists of 2 modules:

  • app module with custom view;
  • data-source module with business logic.

This project shows using:

  1. AIDL interfaces (Android Interface Definition Language) for interaction between SpeedValuesService and MainActivity, where service is generating speed values, based on time-dependent periodic function (sum of sinuses).

In SpeedValuesService aidl interface ISpeedValuesBinder's method registerCallback(listener: IOnSpeedChangedListener) register listener that is implemented in MainActivity and send new speed values to it.

In MainActivity implemented IOnSpeedChangedListener that listens to speed values changes from service and shows it on view binding.speedometerView.updateSpeed(newSpeed).

  1. Custom view, that is based on ConstraintLayout, as the digital speedometer.
        android:id="@+id/speedometerView"
        android:layout_width="0dp"
        android:layout_height="0dp"
        app:backgroundDrawable="@drawable/bg_speedometer_view"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:speedTextColor="@android:color/holo_blue_light"
        app:speedUnit="kmh"
        app:unitTextColor="@android:color/holo_blue_light" />
    
    

From .xml you can change some parameters:

  • speedTextColor
  • unitTextColor
  • bgColor
  • speedTextSize
  • unitTextSize
  • speedUnit: choose between "kmh" and "mph"
  • speedValue
  • backgroundDrawable
  • disableBackgroundImage
  • showUnit
  1. SpeedValuesService extends LifecycleService for using lifecycleScope for launching coroutines to calculate and new speed values (using Dispatchers.Default).
You might also like...
A sample project managing the dependencies using Gradle version catalog

playground-gradle-bom-dep-manage A sample project managing the dependencies using Gradle version catalog. Pros/Cons Comparison with dependency managem

Demo Android application using Gradle. Project is written entirely in Kotlin with MVVM architecture
Demo Android application using Gradle. Project is written entirely in Kotlin with MVVM architecture

Demo Android application using Gradle. Project is written entirely in Kotlin with MVVM architecture, Dagger / Hilt Dependency Injection, Room Database and Retrofit API Calls

👨‍💻 A demonstration modern Android development project with Jetpack(Compose, Room, ViewModel, Navigation), Hilt and based on MVVM by using Open Sky API. ✈️ 🌍
👨‍💻 A demonstration modern Android development project with Jetpack(Compose, Room, ViewModel, Navigation), Hilt and based on MVVM by using Open Sky API. ✈️ 🌍

A demonstration modern Android development project with Jetpack(Compose, Room, ViewModel, Navigation), Hilt and based on MVVM by using Open Sky API.

A demonstration modern Android development project with Jetpack(Compose, Room, Flow, ViewModel, Navigation), Hilt and based on MVVM by using Github API.
A demonstration modern Android development project with Jetpack(Compose, Room, Flow, ViewModel, Navigation), Hilt and based on MVVM by using Github API.

A demonstration modern Android development project with Jetpack(Compose, Room, ViewModel, Navigation), Hilt and based on MVVM by using Github API.

Remoter - An alternative to Android AIDL for Android Remote IPC services using plain java interfaces

Remoter Remoter - An alternative to Android AIDL for Android Remote IPC services using plain java interfaces Remoter makes developing android remote s

Demo app to showcase Sensor data using AIDL bound services.
Demo app to showcase Sensor data using AIDL bound services.

AIDLServices Displays data related to TYPE_ROTATION_VECTOR sensor using AIDL Consist of aidlsdk module that expose sensor data Sample app to show the

POC Simulate Backend Biometric Authentication with AIDL (client app/server app)

poc-simulate-bio-auth-aidl POC Simulate Backend Biometric Authentication with AIDL (client app/server app) #How to use Install server app and run Inst

Sample project created to show some of the best Android practices to work in the Android UI Layer. The UI layer of this project has been implemented using MVP or MVVM (without binding engine) to show how this patterns works. This project is used during the talk A Simple Todo app design in Flutter to keep track of your task on daily basis. Its build on BLoC Pattern. You can add a project, labels, and due-date to your task also you can sort your task on the basis of project, label, and dates
A Simple Todo app design in Flutter to keep track of your task on daily basis. Its build on BLoC Pattern. You can add a project, labels, and due-date to your task also you can sort your task on the basis of project, label, and dates

WhatTodo Life can feel overwhelming. But it doesn’t have to. A Simple To-do app design in flutter to keep track of your task on daily basis. You can a

ColoringLoading 4.7 0.0 Java This project provide Coloring Loading View for Android. And this project is not using the image file!
ColoringLoading 4.7 0.0 Java This project provide Coloring Loading View for Android. And this project is not using the image file!

ColoringLoading ![Release](https://img.shields.io/github/release/recruit-lifestyle/ColoringLoading.svg?label=maven version) This project provide Color

This project is an add-on for the excellent J2V8 Project. It allows users to debug JS running in V8 using Chrome DevTools. Uses Stetho for communication with Chrome DevTools.

J2V8-Debugger This project is an add-on for the excellent J2V8 Project. It allows users to debug JS running in V8 using Chrome DevTools. Uses Stetho f

sample project that shows you how you can use Ktor to creat a server for real Project.

Ktor-Sample This is a sample project that shows you how you can use Ktor to creat a server for real Project. What is done Save data to database (Get a

This project was created as a demo project for implementing latest frameworks, Android APIs, tools, and techniques.
This project was created as a demo project for implementing latest frameworks, Android APIs, tools, and techniques.

IWeather Android Application This project was created as a demo project for implementing latest frameworks, Android APIs, tools, and techniques. It fo

Skeleton project for show the architecture of Android project using MVVM, Clean Architecture and Kotlin coroutine Flow
Skeleton project for show the architecture of Android project using MVVM, Clean Architecture and Kotlin coroutine Flow

ClearScoreDemo Skeleton project for showing the architecture of Android project using MVVM, Clean architecture and Kotlin coroutine Flow App Architect

Minimal example of how to safely share a file produced by a task in one project, with a task in another project.

How to share files across Gradle subprojects: A minimal example This is the Gradle project: . ├── producer │ └── build.gradle.kts ├── consumer │ └

Forage-project - This is a project given by Google Android Developers team. It's specifically created for data persistance.

Forage - Starter Code Starter code for the fifth independent project for Android Basics in Kotlin. This project pairs with Unit 5 of Android Basics in

Civihelper-project - This is our first android project .

Civihelper-project Problem-- Time taking and cumbersome conventional way to submit your civil problems. Proposed soln--- A platform to provide the sub

Connect is an Android Application to connect people for a project and can then work on the application to efficiently complete the project
Connect is an Android Application to connect people for a project and can then work on the application to efficiently complete the project

Connect is an Android Application to connect people for a project and can then work on the application to efficiently complete the project

Owner
Melkonian Nataliia
Melkonian Nataliia
Minimal example of how to safely share a file produced by a task in one project, with a task in another project.

How to share files across Gradle subprojects: A minimal example This is the Gradle project: . ├── producer │ └── build.gradle.kts ├── consumer │ └

Rob Moore 2 Dec 17, 2021
Quality-Tools-for-Android 7.5 0.0 L5 Java This is an Android sample app + tests that will be used to work on various project to increase the quality of the Android platform.

Quality Tools for Android This is an Android sample app + tests that will be used to work on various project to increase the quality of the Android pl

Stéphane Nicolas 1.3k Dec 27, 2022
Sample Project for Android Support Library 23.2

SnapShot: Contains features Vector Drawable Animated Vector Drawable AppCompat DayNight theme Bottom Sheets Using BottomSheetDialog in day-night mode.

Huqiu Liao 779 Nov 24, 2022
A project which demonstrate how to develop a custom client on android for dribbble.com

##What is this? This is a project with custom client app on android for https://dribbble.com, which you can browse the popular icon and animation, lik

ZhangLei 599 Nov 14, 2022
This project is focused on the sample using the API's new preview version of Android-L, use of transitions, shadows etc...

Android L preview example Description This project is focused on the sample using the API's new preview version of Android-L, use of transitions, shad

Saul Molinero 165 Nov 10, 2022
The example Android project of animated menu items in toolbar

Android Animated Menu Items The example Android project of animated menu items in toolbar. Thanks Srikant Shetty for idea of this animation. Cut: Copy

Ilya Fomenko 922 Nov 23, 2022
This project is focused on the sample using the API's new preview version of Android-L, use of transitions, shadows etc...

Android L preview example Description This project is focused on the sample using the API's new preview version of Android-L, use of transitions, shad

Saul Molinero 165 Nov 10, 2022
Eutamin-C Sample Project

here-is-my-card About Eutamin-C Sample Project This is an android application using Euphony library "here-is-my-card" makes it easy to share business

Euphony 5 Sep 1, 2021
Playground Android project to test jacoco-report github action

jacoco-android-playground Playground Android project to test jacoco-report github action Running Code Coverage at Module level The app module has mult

Saravana 18 Dec 20, 2022