chapter 1 presenting android - kennesaw state...
TRANSCRIPT
Introduction to Android Application Development, Android Essentials,
Fifth Edition
Chapter 1
Presenting Android
Chapter 1 Overview
The Android Open Source Project (AOSP)
The Open Handset Alliance
Android Platform Uniqueness
The Android Platform
Android beyond the OHA and GMS
The Android Open Source Project
(AOSP)
An initiative led by Google
– Makes the source code of the Android OS available for all
• Read, review, and modify the code to your liking
You may make contributions of your own code
– For everyone, if you so desire
The main goals of the AOSP
– Provide a set of compatibility guidelines—for OEMs and
device manufacturers—for porting Android to custom devices
– Build accessories that comply with Android’s open accessory
standard
• Allows OEMs and manufacturers to deliver a standard
experience
The Android Open Source Project
(AOSP)
Anyone is free to fork the Android OS source code.
Maintaining a consistent OS experience is important.
– Making radical changes to that experience
introduces fragmentation in the marketplace and in
competing Android distributions.
To learn more about the AOSP see:
– https://source.android.com/index.html
The Open Handset Alliance
Google Goes Mobile First
What Would It Take to Build a Better Mobile
Phone?
Introducing the Open Handset Alliance (OHA)
– Formed in November 2007
– Business alliance composed of mobile players
• Chip makers
• Handset manufacturers
• Software developers
• Service providers
The Open Handset Alliance
(Cont’d)
Android, Inc.
– Created by Andy Rubin.
– Acquired by Google in 2005.
OHA began developing open standards based on
Android, Inc., technologies.
– The result is the Android project.
Google provided the initial code.
Google provides online documentation, tools,
forums, and SDK.
Joining the Open Handset
Alliance
The AOSP provides the entire source code for the Android OS as
well as instructions for meeting device compatibility requirements.
It does not include the source code for many of Google’s
proprietary suite of applications.
The benefits of joining the Open Handset Alliance include the
ability to license Google Mobile Services (GMS), which include
proprietary Google applications such as Google Play, YouTube,
Google Maps, Gmail, and many other Google branded
applications and services.
GMS is not included in the AOSP and must be licensed directly
from Google.
Becoming part of the OHA allows you to bundle GMS on Android
compatible devices.
Manufacturers: Designing
Android Devices
Samsung
Motorola
Dell
Sony Ericsson
HTC
LG
Amazon
Intel
Texas Instruments
ARM
NVIDIA
Qualcomm
Manufacturers: Designing
Android Devices (Cont’d)
T-Mobile G1 by HTC:
– Released October 2008.
– First to ship Android handset.
By Q4 2010, Android dominated the smartphone
market.
As of May 2015:
– Android devices shipped to more than 130 countries.
– Google Play had more than 1 billion active users.
– Google Play had 50 billion app installs in the previous 12
months.
Mobile Operators: Delivering
the Android Experience
Android adoption drivers
– Device subsidies
– Samsung
• 73.2 million smartphones shipped worldwide in second
quarter of 2015
– Google Nexus branded devices
• Nexus 4 and 5 (LG)
• Nexus 6 (Motorola)
• Nexus 7 and Nexus Player (Asus)
• Nexus 9 (HTC)
• Nexus 10 (Samsung)
– HTC, LG, Asus, and more
Apps Drive Device Sales:
Developing Android Apps
Android’s first killer apps
– Browser
– Google Play store (formerly Android Market)
As of May 2015
– Fifty billion installations in previous 12 months
– Not including other Android marketplaces
– Not including Web applications
Apps Drive Device Sales:
Developing Android Apps
(Cont’d)
The Google Play store has received a significant
redesign.
Games are a growing focus.
– Released Google Play Game Services SDK
Google Play’s focus is on content.
Taking Advantage of All
Android Has to Offer
Android’s open platform has been embraced by much of the mobile
development community. It extends far beyond the members of the OHA.
Many mobile operators and device manufacturers have jumped at the
chance to sell Android devices to their subscribers. This is Especially true
given the cost benefits compared to the older proprietary platforms.
The Android platform’s open standard has resulted in reduced operator
costs in licensing and royalties, and we are now seeing a migration to
more open devices.
The market has cracked wide open and new types of users are able to
consider smartphones for the first time.
Android is well suited to fill this demand.
The Android Marketplace:
Where We Are Now
Competitive hardware and software feature
upgrades
Expansion beyond smartphones
– Tablets
– Watches
– TVs
– Automobile dashboards
– IoT
– Video game consoles
Improved user-facing features
Android Platform Differences
“The first complete, open, and free mobile
platform”
– Complete
• Secure OS
• Robust framework
– Open
• Android provided under open source licensing
– Free
• Applications free to develop
Android: The Code Names
Cupcake (Android 1.5)
Donut (Android 1.6)
Éclair (Android 2.0/2.1)
Froyo (Android 2.2)
Gingerbread (Android 2.3)
Honeycomb (Android 3.0/3.1/3.2)
Ice Cream Sandwich (Android 4.0)
Jelly Bean (Android 4.1/4.2/4.3)
KitKat (Android 4.4)
Lollipop (Android 5.0/5.1)
Marshmallow (Android 6.0)
Nougat (Android 7.0)
Free and Open Source
Developers and device manufacturers pay no
royalties or license fees
Licensed under GNU General Public License
Version 2 (GPLv2)
– Strong “copyleft”
Framework distributed under Apache Software
License (ASL/Apache2)
No need for developers to provide improvements
to the open source community
Familiar and Inexpensive
Development Tools
Software Development Kit available for free
Familiar programming language
Familiar development environment
– Android Studio is the official IDE and is bundled with the
Android SDK tools
Familiar and Inexpensive
Development Tools (Cont’d)
Develop using the following operating systems:
– Windows XP (32-bit)
– Windows 2003
– Windows Vista (32-bit or 64-bit)
– Windows 7 (32-bit or 64-bit)
– Windows 8 (32-bit or 64-bit)
– Mac OS X 10.8.5 (up to 10.9)
– Linux GNOME or KDE desktops
• Tested on Ubuntu Linux 14.04 64-bit
Reasonable Learning Curve for
Developers
Native programming in Java
Traditional programming constructs
– Threads and processes
– Data structures for encapsulation
Familiar class libraries
– java.net, java.text, etc.
Specialty libraries
– OpenGL ES
– SQLite
Enabling Development of
Powerful Applications
No distinction between native and third-party apps
All apps have access to the same APIs
Unprecedented access to the underlying hardware
Ability to extend or replace existing apps
Rich, Secure Application
Integration
One of Android’s compelling features is its well-
designed application integration.
– Developers can leverage core functionality and seamlessly
create new experiences.
– Applications can also become content providers and securely
share their information with other apps.
No Costly Obstacles for
Development
No testing and certification programs required
One-time, low-cost $25 distribution fee using the
Google Play store
No real costs other than time
Requirements
– Computer
– Good idea
– Understanding of Java
– This book
A “Free Market” for
Applications
Developers are
Free to choose the revenue model
Free to create applications for any size
demographic
Free to choose distribution methods
– Google Play store
– Amazon Appstore
– Other third-party stores
– Developers’ own distribution methods
Free to choose payment mechanisms
A Growing Platform
Constant SDK improvements
Continuously evolving Android tools
Great documentation
Stable market
Expanding device support
Some growing pains to be expected
Android’s Underlying
Architecture
Linux Operating System – Handles core system services
– Acts as hardware abstraction layer (HAL)
– Enforcement of application permissions and security
– Low-level memory management
– Process management and threading
– Network stack
– Display, keypad input, camera, Wi-Fi, Flash memory, audio, binder
(IPC), and power-management driver access
Android Runtime (ART) – Each app runs in its own Dalvik virtual machine (VM) in a separate
process
– Dalvik based on the Java VM optimized for mobile
Android’s Underlying
Architecture (Cont’d)
Securities and Permissions
Security measures help to ensure data security
and prevent malware
Applications as operating system users
SELinux Kernel Security Module
Explicitly defined application permissions
Application signing for trust relationships
Multiple users and restricted profiles
Google Play developer registration
Exploring Android Applications
Extensive Android SDK and APIs provided
Android Programming language choices – Java
– C/C++
– WebView (HTML, CSS, JS)
– Adobe AIR
– Scripting Layer for Android (SL4A)
No distinction between native and third-party apps – Provided they have appropriate permissions, all apps have access to
the same code libraries and underlying hardware interfaces.
Commonly Used Packages
UI controls (buttons, spinners, text, input)
UI layouts (tables, tabs, lists)
Integration capabilities (notifications, widgets)
Secure networking and Web browsing (SSL, WebKit)
XML support (DOM, SAX, XML Pull Parser)
Storage and databases (App Preferences, SQLite)
2D and 3D graphics (SGL, OpenGL ES, RenderScript)
Multimedia (MediaPlayer, JetPlayer, SoundPool,
AudioManager)
Media formats (MPEG4, H.264, MP3, AAC, AMR, JPG, PNG)
Hardware (GPS, USB, Wi-Fi, Bluetooth, sensors)
Android Application Framework
Framework key components
– Activities are functions the application performs.
– Fragments are reusable and modular sections of activities.
– Loaders are for loading data asynchronously into fragments or
activities.
– Groups of views define the app’s layout.
– Intents inform the system of an app’s plans.
– Services allow background processing without user
interaction.
– Notifications alert users when something happens.
– Content providers facilitate data transmission among different
apps.
Android Platform Services
Apps interact with the OS and hardware using
managers. – LocationManager
– ViewManager
– WindowManager
– AccessibilityManager
– ClipboardManager
– DownloadManager
– FragmentManager
– AudioManager
There are also other managers.
Google Services
Google APIs for Google Services
– Maps
– Places
– Play Game Services
– Google Sign-In
– In-app Billing and Subscriptions
– Google Cloud Messaging
– Mobile App Analytics SDK
– AdMob ads
Android beyond the OHA and
GMS
One of the primary benefits for device manufacturers becoming
members of the OHA is the ability to license the GMS suite of
Google branded applications such as Google Play.
GMS provides features and capabilities not found on devices
without GMS.
There are other popular versions of Android not associated with
the OHA and therefore they do not have access to GMS without
resorting to aftermarket installations.
Just because a device based on a custom fork of Android is not
part of the OHA and does not include GMS or Google Play, does
not mean you should overlook supporting your applications on
those devices.
The next few slides show some areas of interest that involve
Android’s custom forks.
Amazon Fire OS
Amazon has created its own version of Android named Fire OS.
– Fire OS is a fork of the AOSP that is installed on all Amazon Fire branded
devices, such as the Fire Phone, Fire Tablet, and Fire TV.
– Amazon released the Fire OS 5 developer preview, which is based on Android
Lollipop.
According to a report by Strategy Analytics, Inc., there are close to 4.5 million
Amazon Fire TVs that have shipped since launch.
– http://www.prnewswire.com/news-releases/amazon-fires-to-the-top-of-the-us-
digital-media-streamer-market-says-strategy-analytics-300094475.html
With millions of devices available, supporting your Android applications on
Amazon Fire OS is definitely worth consideration.
You can learn more about the Amazon Fire OS version of Android here:
– https://developer.amazon.com/public/solutions/platforms/android-fireos
Cyanogen OS and
CyanogenMod
Cyanogen OS is based on the CyanogenMod project, which is a
community-driven fork of the Android OS, without GMS.
– There are aftermarket instructions and tools provided by the
user community for installing apps such as Google Play.
The Cyanogen, Inc. blog boasts having over 50 million users in
more than 190 countries who run different versions of
CyanogenMod.
– https://cyngn.com/blog/an-open-future
CyanogenMod is classified as replacement firmware that requires
manual installation by a user to replace the stock firmware that
comes bundled when purchasing a device.
Cyanogen OS and
CyanogenMod
Cyanogen OS is stock firmware that will come preinstalled on
Android devices.
Cyanogen, Inc., the company behind Cyanogen OS, is working to
create an Android ecosystem to compete with that of Google.
Currently, Cyanogen, Inc. has received $80 million in venture
capital financing from investors such as Qualcomm Incorporated,
Twitter Ventures, Rupert Murdoch, Andreesen Horowitz, and
Tencent, to name just a few.
Learn more about CyanogenMod here:
– http://www.cyanogenmod.org
Learn more about Cyanogen OS here:
– https://cyngn.com
Maker Movement and Open
Source Hardware
Another area to keep an eye on is the “Maker Movement.” This is
a community of do-it-yourself technology hobbyists, often referred
to as “Makers.”
A subculture of this community involves projects that are based
on open source hardware.
Similar to the beginnings of the open source software movement,
the hardware industry has been experiencing similar open source
trends among enthusiasts, mainly in the area of electronics and
printed circuit board (PCB) design.
The barriers to entry for designing sophisticated electronic
devices, such as computers, laptops, tablets, or devices for IoT,
seem to be limited to one’s imagination and the desire to
innovate.
Maker Movement and Open
Source Hardware
Major hardware component companies that have traditionally
guarded electronic PCB designs are now realizing the potential
for innovation by open sourcing some designs.
Processor manufacturers such as Intel, as well as other
companies that license and manufacture components based on
the ARM processor, have been releasing open source PCB
designs and providing full PCB schematics with the list of required
components for completing the circuit.
There is an incentive for component manufacturers to provide
working PCB designs to help drive sales of those components.
Maker Movement and Open
Source Hardware
Quite a few companies that manufacture ARM processors have
developed open source PCBs, for devices like tablets, with
Android as the OS.
This makes designing a sophisticated device, such as a tablet
running Android, accessible to anyone capable of working with a
PCB design.
PCB software design tools, such as Altium Designer, are used for
working with PCB designs.
Powerful tools combined with open source PCB designs and the
AOSP, may bring about new generations of devices that we are
not yet capable of envisioning.
The future for Android application development certainly looks
bright and the possibility for developing innovative applications for
Android seem nearly limitless.
Maintaining Awareness
Although this book is about developing Android applications, we
wanted to provide background for the overall Android
ecosystem—as we see it.
We think it is always a good idea to maintain awareness about
what is occurring in the ever-expanding Android ecosystem, as
these events affect everyone involved in development.
Today, there are many exciting advancements for Android
development that are worth following, and hopefully there will be
many more to come.
Chapter 1 Summary
We learned about the history of mobile software
development.
We learned what the Open Handset Alliance is
and why it was formed.
We learned how Android is different from other
platforms.
We also took a first look at the Android
platform.
References and More
Information
Android Development:
– http://d.android.com/index.html
Android Open Source Project:
– https://source.android.com/index.html
Open Handset Alliance:
– http://www.openhandsetalliance.com
Official Android Developers Blog:
– http://android-developers.blogspot.com
This book’s blog:
– http://introductiontoandroid.blogspot.com
Intel Open Source: Android on Intel Platforms
– https://01.org/android-IA
ARM Connected Community: Android Community
– http://community.arm.com/groups/android-community
Altium Designer
– http://www.altium.com/altium-designer/overview
Wikipedia: Maker Culture
– https://en.wikipedia.org/wiki/Maker_culture