Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Learning Embedded Android N Programming
Learning Embedded Android N Programming

Learning Embedded Android N Programming: Customize your Android system with the power of embedded programming

Arrow left icon
Profile Icon Morgillo
Arrow right icon
zł39.99 zł158.99
Full star icon Full star icon Half star icon Empty star icon Empty star icon 2.8 (5 Ratings)
eBook Jul 2016 282 pages 1st Edition
eBook
zł39.99 zł158.99
Paperback
zł197.99
Subscription
Free Trial
Arrow left icon
Profile Icon Morgillo
Arrow right icon
zł39.99 zł158.99
Full star icon Full star icon Half star icon Empty star icon Empty star icon 2.8 (5 Ratings)
eBook Jul 2016 282 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

Learning Embedded Android N Programming

Chapter 2. Obtaining the Source Code – Structure and Philosophy

In the previous chapter, we had an overview about the system layer-based architecture and we had our first hands-on experience, testing a real-world device using CTS tools suite.

In this chapter, the user will learn about the philosophy behind the Android and Google development model. We will show how the source code is organized, which are the main branches, and what the workflow is. We will create a step-by-step journey to retrieve the Android Open Source Project (AOSP) source code and prepare the environment by installing all the required tools.

The user will learn how to contribute to the Android Open Source Project, how to use tools such as git, the version-control system, and, repo, the repository manager.

To complete the chapter, we will dig into the AOSP folder structure, analyzing the most important components that create the most popular mobile operating systems of the world.

The Android philosophy

Android is an open source platform created to be compatible with a huge number of different devices, from a hardware point of view to a purpose point of view. The main goal is to provide a freely available software platform for both large enterprise companies and small independent makers or even single developers. Android aims to provide an easy way to create innovative solutions and bring them to market with no effort.

Everything started in 2005, when Google acquired Android Inc., a small company that was developing an operating system for mobile devices. A couple of years later, the Open Handset Alliance was born. In 2007, 84 companies, including mobile operators, handset manufacturers, and semiconductor and software companies, publicly announced their brand new, upcoming mobile operating system.

For one more whole year the project was kept a secret. Google worked hard to bring the project to version 1.0 and in 2008 Android was shown to the world. In the following...

Setting up the environment

The Android build system is officially supported by Ubuntu Linux. Google assures that the system setup, the environment setup, and all the requirements are easily reproducible on this particular Linux distribution. The truth is, nowadays, every Linux distribution can be prepared to perform a proper Android build with little effort.

To be closest to the guidelines and because we think that Ubuntu is the easiest system to set up for the job, in this book we are going to use Ubuntu Linux 15.04 to perform all our building procedures.

If you are working on OS X or Windows and you prefer to stick to these operating systems, we are going to show you how to achieve our goal even using a virtual machine.

Free space

The amount of free space on the hard drive needed by the build system is massive. The Android source code by itself can reach 100 gigabytes of occupied space. When we move to more advanced scenarios, such as building using a caching system, such as ccache, to speed...

Installing the required tools

Even if officially the supported Linux distribution is Ubuntu, the following procedures and commands are equally correct on every Debian-based distribution, if it is actually installed on your computer or is running as a virtual machine.

To be able to acquire the source code, retrieving it from Google git repository, we need to install git. Let's open a Terminal and run:

~$ sudo apt-get install git

Apt will ask for our super user password and will take care of installing git in the system. Once we have git, we need its trusted companion tool—repo. Repo does not need a real installation. It's a Python script, so we just need to download it and place it in a handy folder.

Let's create a bin folder in our home folder and add it to the system path:

~$ mkdir ~/bin
~$ export PATH=~/bin:$PATH

Now that we have a folder, we can download repo using curl:

~$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
~$ chmod a+x ~/bin...

Getting ready

As we already know, Google is the official manager of the entire hardware infrastructure supporting Android—everything is hosted and maintained by Google. The source code repository also provides a web UI to graphically navigate the source code. This source code browser is available at https://android.googlesource.com/.

The following screenshot shows an example of what the page looks like:

Getting ready

Every single item of the list shown in the previous screenshot is a git repository. This can give you a perfect idea of the importance of Google's repo tool—manually managing this many repositories would be pure madness! Using repo, retrieving, downloading, and creating the proper folder structure is a few-lines' task. Let's do it!

First things first—create a working folder. Open a Terminal and create a folder like this:

~$ mkdir WORKING_DIRECTORY
~$ cd WORKING_DIRECTORY

Once in the folder, run:

~/WORKING_DIRECTORY$ repo init -u https://android.googlesource...

A look inside AOSP

At this point, we have our copy of AOSP so we can start looking inside to see what the project consists of.

Before delving inside, we must warn you that, when generating a new build image from scratch, you won't find any of the Google applications that you can find on most of the Android devices. That is because the Google applications are not licensed under Apache 2.0 license, so they are not provided with the public project. We are talking about applications such as Play Store, Gmail, YouTube, Maps, and all other official Google apps.

These applications are provided only to the compatible devices, that is, the devices that pass the Compatibility Test Suite we met in the first chapter.

Being able to distribute an Android device with all Google's app on-board is no easy trip. After confirming that the device is compatible using CTS, it is also necessary to obtain a particular Google Mobile Services (GMS) license by contacting Google directly.

Obviously, you can...

The Android philosophy


Android is an open source platform created to be compatible with a huge number of different devices, from a hardware point of view to a purpose point of view. The main goal is to provide a freely available software platform for both large enterprise companies and small independent makers or even single developers. Android aims to provide an easy way to create innovative solutions and bring them to market with no effort.

Everything started in 2005, when Google acquired Android Inc., a small company that was developing an operating system for mobile devices. A couple of years later, the Open Handset Alliance was born. In 2007, 84 companies, including mobile operators, handset manufacturers, and semiconductor and software companies, publicly announced their brand new, upcoming mobile operating system.

For one more whole year the project was kept a secret. Google worked hard to bring the project to version 1.0 and in 2008 Android was shown to the world. In the following...

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Understand the system architecture and how the source code is organized
  • Explore the power of Android and customize the build system
  • Build a fully customized Android version as per your requirements

Description

Take a deep dive into the Android build system and its customization with Learning Embedded Android Programming, written to help you master the steep learning curve of working with embedded Android. Start by exploring the basics of Android OS, discover Google’s “repo” system, and discover how to retrieve AOSP source code. You'll then find out to set up the build environment and the first AOSP system. Next, learn how to customize the boot sequence with a new animation, and use an Android “kitchen” to “cook” your custom ROM. By the end of the book, you'll be able to build customized Android open source projects by developing your own set of features.

Who is this book for?

If you are a Java programmer who wants to customize, build, and deploy your own Android version using embedded programming, then this book is for you.

What you will learn

  • Master Android architecture and system design
  • Obtain source code and understand the modular organization
  • Customize and build your first system image for the Android emulator
  • Level up and build your own Android system for a real-world device
  • Use Android as a home automation and entertainment system
  • Tailor your system with optimizations and add-ons
  • Reach for the stars: look at the Internet of Things, entertainment, and domotics

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Jul 29, 2016
Length: 282 pages
Edition : 1st
Language : English
ISBN-13 : 9781785283284
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 : Jul 29, 2016
Length: 282 pages
Edition : 1st
Language : English
ISBN-13 : 9781785283284
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 617.97
Asynchronous Android Programming
zł221.99
Learning Embedded Android N Programming
zł197.99
Android System Programming
zł197.99
Total 617.97 Stars icon
Banner background image

Table of Contents

9 Chapters
1. Understanding the Architecture Chevron down icon Chevron up icon
2. Obtaining the Source Code – Structure and Philosophy Chevron down icon Chevron up icon
3. Set up and Build – the Emulator Way Chevron down icon Chevron up icon
4. Moving to Real-World Hardware Chevron down icon Chevron up icon
5. Customizing Kernel and Boot Sequence Chevron down icon Chevron up icon
6. "Cooking" Your First ROM Chevron down icon Chevron up icon
7. Tailoring Your Personal Android System Chevron down icon Chevron up icon
8. Beyond the Smartphone Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Half star icon Empty star icon Empty star icon 2.8
(5 Ratings)
5 star 40%
4 star 0%
3 star 0%
2 star 20%
1 star 40%
Pieces Aug 22, 2016
Full star icon Full star icon Full star icon Full star icon Full star icon 5
If you want to learn how to build and customize android then this book is for you. It will save you from hours of digging through XDA posts and documentation. It gives you easy to follow step by step instructions to get up setup and building the android source quickly.
Amazon Verified review Amazon
Curtis A Stamps Feb 23, 2020
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Everything I need to know
Amazon Verified review Amazon
Amazon Customer Dec 11, 2016
Full star icon Full star icon Empty star icon Empty star icon Empty star icon 2
Not helpful.
Amazon Verified review Amazon
Amazon Customer Aug 25, 2016
Full star icon Empty star icon Empty star icon Empty star icon Empty star icon 1
not worth it.in many pages, super big screenshots are occupied.Description is so bed.I am really disappointed.Considering pricing this book, It is totally junk.
Amazon Verified review Amazon
Vineeth Pillai Nov 15, 2016
Full star icon Empty star icon Empty star icon Empty star icon Empty star icon 1
I bought this product directly from Pakt publishing. I was shocked to see that this book had nothing to do with Android N. This book mentions about Android Lollipop release in 2014. And minimally touches Marshmellow here and there, but doesn't even describe any differences between the android versions.When I talked to pakt publishing, they were not even accepting return even though they are clearly cheating with a misleading title.As some other reviewer noted, they tried to fill in the pages with super big screenshots.Please don't waste time and money buying this.. The book is not worth at all
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.