Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Android System Programming
Android System Programming

Android System Programming: Porting, customizing, and debugging Android HAL

Arrow left icon
Profile Icon Roger Ye Profile Icon Liu
Arrow right icon
zł39.99 zł158.99
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.7 (3 Ratings)
eBook May 2017 470 pages 1st Edition
eBook
zł39.99 zł158.99
Paperback
zł197.99
Subscription
Free Trial
Arrow left icon
Profile Icon Roger Ye Profile Icon Liu
Arrow right icon
zł39.99 zł158.99
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.7 (3 Ratings)
eBook May 2017 470 pages 1st Edition
eBook
zł39.99 zł158.99
Paperback
zł197.99
Subscription
Free Trial
eBook
zł39.99 zł158.99
Paperback
zł197.99
Subscription
Free Trial

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Android System Programming

Setting Up the Development Environment

After the introduction about system programming in the last chapter, we need to set up a development environment first before we can go further. We need to know how to build and test Android Open Source Project (AOSP) while we explore various Android system programming topics in this book. We will cover the following topics in this chapter:

  • Installing the Android SDK and setting up an Android Virtual Device
  • Setting up the AOSP build environment and building a testing image
  • Creating your own source code repository mirror

Summary of Android versions

Since we will use Android emulator as one of the virtual hardware platforms, we need to use one particular Android version throughout this book. At the time of writing, the latest Android version is Android 7 (Nougat). We will use Android 7 throughout the book. I started work on this book with Android 6, so the source code for Android 6 is also available in my GitHub repository at https://github.com/shugaoye.

From the first release to Android 7, both the development environment and the AOSP source code have been changed a lot. We will have a brief look at various Android versions first before we talk about the development environment setup.

To set up the AOSP build environment, there are two things that you need to pay special attention to the host environment and Java SDK. Even though the recommended host environment is Ubuntu running on Intel architecture, the hardware architecture...

Installing Android SDK and setting up an Android Virtual Device

Ideally, if you have an AOSP build environment, you can build everything including Android SDK from scratch. However, it is much more convenient to have an Android SDK installation to help with virtual device creation or running emulator images.

You can always download the latest Android SDK from the following website:

https://developer.android.com/index.html

The host environment that we use in this book is Ubuntu 14.04. Download the Android SDK for Linux and decompress it to a folder in your Home directory.

The tools in Android SDK have been changed since API level 25. You may use an older version of Android SDK or the latest Android SDK so I gave the instructions for both cases here.

Creating AVD in an older version of SDK

...

The AOSP build environment and the Android emulator build

In order to create our own Android system, we have to set up the AOSP build environment and build our own AOSP target for the Android emulator. Since Android is under rapid development, the build process and environment setup can change from time to time. You can always refer to Google's website for the latest information, https://source.android.com/source/building.html.

While the Google website and other sources can give general guidelines and procedures about the AOSP build, in this section we will look specifically at how to build AOSP for Android emulator image for API level 25.

The AOSP build environment

Since we want to set up a build environment for API level 25, you can refer to the table of AOSP...

Creating your own repository mirror

It usually takes a very long time to download the AOSP source code. After you have downloaded the AOSP source code, you have actually downloaded a specific version of the AOSP source code from the remote repository. You may have to test different configurations or versions in your development work. It is a very time-consuming task to switch to a different version or create a new copy of the AOSP source code.

In this book, we will use the AOSP source code as the base for our development. To reuse some of the existing open source projects that are not included in AOSP, we have to modify the repo manifest from time to time. This involves changing the repo configuration. To work more efficiently, we can use a local mirror. It can save a lot of time to create a local mirror instead of downloading source code from remote repositories for all configuration changes. It may take hours...

Summary

In this chapter, we set up the environment for SDK and AOSP. We built the Android emulator images for AOSP. We also tested and compared the Android images in Android SDK and AOSP. All these steps are necessary before we continue exploring how to create our own Android system later. We also spent some time discussing how to set up our own repo mirror. This tip can help us later, when we start to create projects from multiple open source projects. In the next chapter, we will start to explore the architecture of Android. We will look into the details of layers related to the porting and customization of the Android system.

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Master Android system-level programming by integrating, customizing, and extending popular open source projects
  • Use Android emulators to explore the true potential of your hardware
  • Master key debugging techniques to create a hassle-free development environment

Description

Android system programming involves both hardware and software knowledge to work on system level programming. The developers need to use various techniques to debug the different components in the target devices. With all the challenges, you usually have a deep learning curve to master relevant knowledge in this area. This book will not only give you the key knowledge you need to understand Android system programming, but will also prepare you as you get hands-on with projects and gain debugging skills that you can use in your future projects. You will start by exploring the basic setup of AOSP, and building and testing an emulator image. In the first project, you will learn how to customize and extend the Android emulator. Then you’ll move on to the real challenge—building your own Android system on VirtualBox. You’ll see how to debug the init process, resolve the bootloader issue, and enable various hardware interfaces. When you have a complete system, you will learn how to patch and upgrade it through recovery. Throughout the book, you will get to know useful tips on how to integrate and reuse existing open source projects such as LineageOS (CyanogenMod), Android-x86, Xposed, and GApps in your own system.

Who is this book for?

This book is for Android system programmers and developers who want to use Android and create indigenous projects with it. You should know the important points about the operating system and the C/C++ programming language.

What you will learn

  • Set up the Android development environment and organize source code repositories
  • Get acquainted with the Android system architecture
  • Build the Android emulator from the AOSP source tree
  • Find out how to enable WiFi in the Android emulator
  • Debug the boot up process using a customized Ramdisk
  • Port your Android system to a new platform using VirtualBox
  • Find out what recovery is and see how to enable it in the AOSP build
  • Prepare and test OTA packages

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : May 31, 2017
Length: 470 pages
Edition : 1st
Language : English
ISBN-13 : 9781787120389
Vendor :
Google
Category :
Languages :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : May 31, 2017
Length: 470 pages
Edition : 1st
Language : English
ISBN-13 : 9781787120389
Vendor :
Google
Category :
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just zł20 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just zł20 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 573.97
Android System Programming
zł197.99
Android Things Projects
zł177.99
Expert Android Programming
zł197.99
Total 573.97 Stars icon
Banner background image

Table of Contents

14 Chapters
Introduction to Android System Programming Chevron down icon Chevron up icon
Setting Up the Development Environment Chevron down icon Chevron up icon
Discovering Kernel, HAL, and Virtual Hardware Chevron down icon Chevron up icon
Customizing the Android Emulator Chevron down icon Chevron up icon
Enabling the ARM Translator and Introducing Native Bridge Chevron down icon Chevron up icon
Debugging the Boot Up Process Using a Customized ramdisk Chevron down icon Chevron up icon
Enabling Wi-Fi on the Android Emulator Chevron down icon Chevron up icon
Creating Your Own Device on VirtualBox Chevron down icon Chevron up icon
Booting Up x86vbox Using PXE/NFS Chevron down icon Chevron up icon
Enabling Graphics Chevron down icon Chevron up icon
Enabling VirtualBox-Specific Hardware Interfaces Chevron down icon Chevron up icon
Introducing Recovery Chevron down icon Chevron up icon
Creating OTA Packages Chevron down icon Chevron up icon
Customizing and Debugging Recovery Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.7
(3 Ratings)
5 star 66.7%
4 star 0%
3 star 0%
2 star 0%
1 star 33.3%
SAKET SINHA Jul 02, 2017
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I would like to thank Roger for this fantastic new book.Before this, there was no documentation of Different Layers of AOSP except source code itself which makes this book unique.The best part is how emulator has been used to validate the concepts and code flow, just like his last book.
Amazon Verified review Amazon
manjunath Dec 30, 2017
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Nice book !!!
Amazon Verified review Amazon
Arun SR Dec 29, 2018
Full star icon Empty star icon Empty star icon Empty star icon Empty star icon 1
For advanced users only.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.