0% found this document useful (0 votes)
21 views

Introduction To Android Development From Embedded Linux

Uploaded by

nhatnmse61103
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

Introduction To Android Development From Embedded Linux

Uploaded by

nhatnmse61103
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

Introduction to Android development

(from embedded Linux POV)


Purpose
• My first impression with Android in a nutshell:
o Android (platform) development is not a community-driven project, so it’s not widely discussed like Yocto Project

o Many investigation hours without knowing how everything comes together

o Some common tasks has documents…but it’s either poorly or wrongly documented.
o Some tasks has no documentation at all, so I have to investigate source itself
• Let's make beginner-friendly introduction to Android so that:
o You know what and where to look for your task
o Know what it takes to do Android development

o More time to roll out new features, not more time to investigate codebase (though not guarantee, Android is HUGE)
1. Overview of embedded Linux development
2. Overview of Android development
3. Recommendation for Android development
4. Where to go from here?

Agenda
Overview of Embedded Linux development (1)

• Review: What is embedded Linux


o A part (brain) of a bigger system (because it's
embedded!)

o It is more like a high-performance desktop rather


powerful than MCU-based system.
Overview of Embedded Linux development (2)

• What software components to develop in embedded Linux


system?
o Bootloader: initialize board and boot up kernel

o Kernel: to manage system resource and communicate


with hardware

o Entire filesystem: which contain following sub-


components:
▪ Applications that do the main jobs of embedded Linux
system

▪ Other supporting applications + libraries


(a.k.a middleware)
Overview embedded Linux development (3)
• Example: A vision processing application inside embedded Linux system may have this (incomplete) list of components:
o Main vision application that do the real jobs

o The App may use Qt framework for building UI

o The App may use ffmpeg library or other libraries for media codec functionality
o Qt framework use OpenGL, a graphic libraries

o The embedded system might need desktop. Wayland or X.org windows system

o To initialize entire system to working state, it needs System-V init or systemd

o Linux kernel might need additional kernel module relate to do interface with on-chip or off-chip AI accelerator
o ...
Overview of Android development
Overview of Android development (1)

• Android development is just another embedded


Linux development (to a certain degree, of course)
o Majority of embedded Linux can be developed in many
way (Yocto Project, Buildroot, DIY with Linux From
Scratch, 3rd party solution like Ubuntu Core...) and
customize possibility is endless. Driven both by
community and corporate alike

o Android development is limited to Android Open-Source


Project (AOSP) only and you must strictly comply adhere
to AOSP architecture, which is boring to be honest.
Driven by corporate only, community support is a
lot weaker compared to embedded Linux.
Overview of Android development (2)

• So why still consider Android development despite


its horrible development experience?
o Android userbase is HUGE. Thus, the Android future
looks bright
o Android app developer community is HUGE due to HUGE
userbase. No strong evidence, but clearly bigger than Qt-
based GNOME or GTK-based KDE of majority of
Embedded Linux. Therefore, it's a lot easier to find
developers to develop your app

o Google HUGE ecosystem (just look at the number of


apps in Google Play Store). Of course, it's not easy and
free to join this ecosystem
▪ Or you can use alternative Android App Store like
Aptoide
Overview of Android development (3)

• Current state of Android


o Android 15 (developer preview only)
• Supported device type
o Smartphone, Tablet (obviously, their original target
device)

o TV box

o Automotive, especially In-Vehicle Infotainment System.


One example is Volvo
Android development roadmap
Android development roadmap (1)
• What do I need to do in Android development? Two areas:
o Android app development

o Android platform development


• Android app development consists of but not limited to:
o Develop Android app (obviously)

o Customize system apps like Calendar, Camera, Settings...

o Redesign home page


• Android platform development consist of but not limited to:
o Extend Android framework to have vendor-specific API (that vendor system apps will use)

o Implement service backend

o Porting additional third-party native apps & libraries

o Implement new vendor kernel module to work on new platform


Android development roadmap (2) - for App team

• Normal app: Java, Kotlin. Jetpack


Compose, Flutter, React Native, .NET MAUI... The
possibility are endless, but rarely have to familiar
Android Open-Source Project (AOSP)

• System Apps: it's different, however.


o Need to familiar with AOSP
o Need to familiar with internal system API
Android development roadmap (3) - for Platform team

• Baby steps
o Navigate Linux File Hierarchy Structure

o Learn to love Makefile

o Familiar with both Java and C/C++ (yes,


you need Java for extend Android Framework)

o Learn to love using gcc, clang

o Dealing with disk partition

o And learn to love investigating from actual AOSP source


code. It's difficult at first, but pay off really well
• Now you know why I tell you embedded Linux background is
important: you've already familiar baby steps to certain
degree
Android development roadmap (4) - for Platform team

• Adult step
o Extend APIs from existing Android Framework

o Familiar with these core topics of AOSP


▪ AOSP architecture (partitions, services, HAL...)
▪ Understand your working area in AOSP like Audio,
Camera, Connectivity... since every area is different

o Dive into the AOSP codebase because there are a lot of


crucial areas that are not mentioned in AOSP
documentation. For example:
▪ How to build and export SDK
▪ How to use Android Studio or Eclipse IDE to work on
AOSP
▪ ...
Android development roadmap (5) - Kernel

• Need to know Linux kernel development?


o Let's hope you don't have to do that (a lot of
confidential stuff we cannot touch, just like actual
embedded Linux development).
o That means extensive Android support for SoC is
a must

o However, know some of Linux kernel development


is definitely a great help
Where to go from here?
Where to go from here? (1) - further reading
• Additional Android training free and public slides
o "Embedded Android" slide by Opersys

o "Embedded Android" course public slide of Emertxe

o "Android System Development" slide by Bootlin


Where to go from here? (2) - lab time

1. Setting up Android on board Raspberry Pi (recommend


model 4B). Refer to Grapeup Automotive AOSP 13 blog
2. Remember to setup serial console. Then watch
the bootlog and messing with the filesystem. Compare the
filesystem to normal Linux distro like Ubuntu
Thank you!

You might also like