SlideShare a Scribd company logo
1 of 26
Download to read offline
Building and Distributing
SDK Add-ons
Dave Smith
NewCircle, Inc.
@devunwired
+DaveSmithDev
–The Pointy Haired Boss
How do we connect developers with the
additional features and functionality we have
built into our Android-based device?
DISTRIBUTION VERSIONING
DOCUMENTATION VALIDATION
SDK Add-On
SDK Add-On
Library Package
Java stubs Java docs Meta
System Image Package
System Data Ramdisk Kernel Meta
SDK Repository
SDK Add-On
Library Package
Java stubs Java docs Meta
System Image Package
System Data Ramdisk Kernel Meta
Repo XML Meta
SDK Repository
SDK Add-On
Library Package
Java stubs Java docs Meta
System Image Package
System Data Ramdisk Kernel Meta
Repo XML Meta
SOLVED
Get The Tools!
$ repo init -u https://android.googlesource.com/platform/manifest 
-b android-5.0.1_r1 
-g all
$ repo sync
<manifest>

…

<project path="tools/adt/eclipse" name="platform/tools/adt/eclipse" groups="notdefault,tools" />

<project path="tools/adt/idea" name="platform/tools/adt/idea" groups="notdefault,tools" />

<project path="tools/base" name="platform/tools/base" groups="notdefault,tools" />

…

</manifest>
platform/manifest/default.xml
Android Shared Libraries
• Exposed from the /system/framework for use by applications.
• Applications reference via <uses-library> in the AndroidManifest.xml
• Library is appended to application's classpath
• No copy necessary in application's APK
• Exposed via XML definition in /system/etc/permissions
<?xml version="1.0" encoding="utf-8"?>
<permissions>
<library name="com.example.library1"
file="/system/framework/com.example.library1.jar"/>
</permissions>
/system/etc/permissions/com.example.library1.xml
Exposing Your Libs
# Build the library
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := com.example.library1
LOCAL_SRC_FILES := $(call all-java-files-under,.)
include $(BUILD_JAVA_LIBRARY)
# Copy XML to /system/etc/permissions/
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := com.example.library1.xml
LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/permissions
LOCAL_SRC_FILES := $(LOCAL_MODULE)
include $(BUILD_PREBUILT)
Android.mk
Documentation
• Javadoc parser wrapper
• Generated HTML from class/method comments
• Accessible to developers through the IDE
• Don't include in the system image packages list.
# Build the documentation
include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(call all-subdir-java-files) $(call all-
subdir-html-files)
LOCAL_MODULE:= com.example.library1_doc
LOCAL_DROIDDOC_OPTIONS := com.example.library1
LOCAL_MODULE_CLASS := JAVA_LIBRARIES
LOCAL_DROIDDOC_USE_STANDARD_DOCLET := true
include $(BUILD_DROIDDOC)
Android.mk
Hook Into This…
…Developers Understand This
Inform SDK Manager
#Identify the component
name=SDK Add-On
name-id=addon
#Identify yourself
vendor=NewCircle
vendor-id=newcircle
#Identify the base target
api=21
#What did you add?
libraries=com.example.library1;com.example.library2
com.example.library1=com.example.library1.jar;Example Library
com.example.library2=com.example.library2.jar;Example Service
manifest.ini
Stubs!
SDK Package System Image
Internal Classes
Public ClassesPublic Classes
Stubs!
+com.example.library1.*
-com.example.library1.internal.*
+com.example.library2.*
-com.example.library2.internal.*
addon_stub_defs.txt
SDK Package System Image
Internal Classes
Public Classes
Public Classes
System Image Metadata
Addon.VendorDisplay=NewCircle
Addon.VendorId=newcircle
AndroidVersion.ApiLevel=${PLATFORM_SDK_VERSION}
Pkg.Desc=NewCircle SDK Platform ${PLATFORM_VERSION}
Pkg.Revision=1
SystemImage.Abi=${TARGET_CPU_ABI}
#Link this image to your add-on via the tag
SystemImage.TagDisplay=SDK Add-On
SystemImage.TagId=addon
source.prop_template
PRODUCT_PACKAGES += …
PRODUCT_SDK_ADDON_NAME := device_sdk_addon
PRODUCT_SDK_ADDON_COPY_FILES := manifest.ini:manifest.ini
# Use this to copy your library modules
PRODUCT_SDK_ADDON_COPY_MODULES := 
com.example.library1:libs/com.example.library1.jar 
com.example.library2:libs/com.example.library2.jar
PRODUCT_SDK_ADDON_STUB_DEFS := addon_stub_defs.txt
# New on Lollipop+, system images are built as a separate package
PRODUCT_SDK_ADDON_SYS_IMG_SOURCE_PROP := source.prop_template
PRODUCT_SDK_ADDON_DOC_MODULES := com.example.library1_doc
# This add-on extends the default sdk product.
$(call inherit-product, $(SRC_TARGET_DIR)/product/sdk.mk)
PRODUCT_NAME := device_sdk_addon
PRODUCT_DEVICE := device
PRODUCT_MODEL := SDK Add-on For My Device
device_sdk_addon.mk
Add to Existing Target…
# Your existing product makefiles
PRODUCT_MAKEFILES := $(LOCAL_DIR)/full_device.mk
# Append your SDK add-on
PRODUCT_MAKEFILES += $(LOCAL_DIR)/device_sdk_addon.mk
AndroidProducts.mk
$ make PRODUCT-device_sdk_addon-sdk_addon
Repositories<sdk:sdk-sys-img xmlns:sdk="http://schemas.android.com/sdk/android/sys-img/3"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<sdk:license type="text" id="addon-license"> … </sdk:license>

<sdk:system-image>

<sdk:revision>1</sdk:revision>

<sdk:description>NewCircle SDK Platform 5.0.1</sdk:description>

<sdk:api-level>21</sdk:api-level>

<sdk:abi>x86</sdk:abi>

<sdk:archives>

<sdk:archive>

<sdk:size>187303276</sdk:size>

<sdk:checksum
type="sha1">33f9a1d41f16cb6f5b8099752131b8f01d5f53c3
</sdk:checksum>

<sdk:url>alpha_sdk_img_r1.zip</sdk:url>

</sdk:archive>

</sdk:archives>

<sdk:uses-license ref="addon-license"/>

<!-- Link this system image to our add-on library -->

<sdk:add-on>

<sdk:vendor-id>newcircle</sdk:vendor-id>

<sdk:vendor-display>NewCircle</sdk:vendor-display>

</sdk:add-on>

<sdk:tag-id>addon</sdk:tag-id>

</sdk:system-image>

</sdk:sdk-sys-img>
<?xml version="1.0" encoding="utf-8"?>

<sdk:sdk-addon xmlns:sdk="http://schemas.android.com/sdk/android/addon/7"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<sdk:license type="text" id="addon-license"> … </sdk:license>

<sdk:add-on>

<sdk:vendor-id>newcircle</sdk:vendor-id>

<sdk:vendor-display>NewCircle</sdk:vendor-display>

<sdk:name-id>addon</sdk:name-id>

<sdk:name-display>SDK Add-On</sdk:name-display>

<sdk:api-level>21</sdk:api-level>

<sdk:revision>1</sdk:revision>

<sdk:description>NewCircle SDK Add-On</sdk:description>

<sdk:desc-url>http://thenewcircle.com/</sdk:desc-url>

<sdk:uses-license ref="addon-license"/>

<sdk:archives>

<sdk:archive>

<sdk:size>104797</sdk:size>

<sdk:checksum
type="sha1">7418c038e40bdd82ebc8533183ab9404ad6860ec
</sdk:checksum>

<sdk:url>addon_r1.zip</sdk:url>

</sdk:archive>

</sdk:archives>

<!-- Note the extra libraries present in the add-on -->

<sdk:libs>

<sdk:lib>

<sdk:name>com.example.library1</sdk:name>

<sdk:description>Example Library</sdk:description>

</sdk:lib>

<sdk:lib>

<sdk:name>com.example.library2</sdk:name>

<sdk:description>Example Service</sdk:description>

</sdk:lib>

</sdk:libs>

</sdk:add-on>

</sdk:sdk-addon>
Tips & Tricks
• Archive SHA: sha1sum archive.zip | cut -d " " -f 1
• Archive Size: stat -c %s archive.zip
• Repository Schema Files
• $AOSP/prebuilts/devtools/repository/*.xsd
• xmllint --schema sdk-addon-07.xsd repository.xml
• Repository XML Generator Script
• $AOSP/development/build/tools/mk_sdk_repo_xml.sh
• Parses manifest.ini or source.properties for metadata
Learn More
Android Internals Public Class
Private On-Site Training Also Available
http://thenewcircle.com/training/android
Device Target + SDK Sample:
http://github.com/thenewcircle/alpha

More Related Content

What's hot

prosocial behaviour cognitive model in hindi
prosocial behaviour cognitive model in hindiprosocial behaviour cognitive model in hindi
prosocial behaviour cognitive model in hindiRajesh Verma
 
Voice of Bihar | Amazing Facts of Bihar | Know the actual Bihar and Biharis
Voice of Bihar | Amazing Facts of Bihar | Know the actual Bihar and BiharisVoice of Bihar | Amazing Facts of Bihar | Know the actual Bihar and Biharis
Voice of Bihar | Amazing Facts of Bihar | Know the actual Bihar and BiharisDeepak Poddar
 
Pench Pational Park
Pench Pational ParkPench Pational Park
Pench Pational ParkNilesh Raut
 
Biology forest and wildlife project
Biology forest and wildlife projectBiology forest and wildlife project
Biology forest and wildlife projectCredMaster1
 
Kerala Tourist Destinations
Kerala Tourist DestinationsKerala Tourist Destinations
Kerala Tourist DestinationsSomitra Upadhyay
 
The Beautiful City Chandigarh
The Beautiful City ChandigarhThe Beautiful City Chandigarh
The Beautiful City ChandigarhThe Other Home
 
Water Conservation ppt presentation
Water Conservation ppt presentationWater Conservation ppt presentation
Water Conservation ppt presentationMitesh Jagawat
 
Man animal conflict management in Anamalai Tiger Reserve avichal
Man animal conflict management in Anamalai Tiger Reserve avichal Man animal conflict management in Anamalai Tiger Reserve avichal
Man animal conflict management in Anamalai Tiger Reserve avichal anshu1907
 
Water ppt presentation
Water ppt presentationWater ppt presentation
Water ppt presentationsanmita
 
Wildlife presentation
Wildlife presentationWildlife presentation
Wildlife presentationRajat Nainwal
 
Uttar-Pradesh-04092012.ppt
Uttar-Pradesh-04092012.pptUttar-Pradesh-04092012.ppt
Uttar-Pradesh-04092012.pptPrakhar Pandey
 
New microsoft word document
New microsoft word documentNew microsoft word document
New microsoft word documentSayan Mondal
 

What's hot (20)

uttarakhand
uttarakhand uttarakhand
uttarakhand
 
prosocial behaviour cognitive model in hindi
prosocial behaviour cognitive model in hindiprosocial behaviour cognitive model in hindi
prosocial behaviour cognitive model in hindi
 
Water supply
Water supplyWater supply
Water supply
 
Kolkata PPT Slideshare
Kolkata PPT SlideshareKolkata PPT Slideshare
Kolkata PPT Slideshare
 
Voice of Bihar | Amazing Facts of Bihar | Know the actual Bihar and Biharis
Voice of Bihar | Amazing Facts of Bihar | Know the actual Bihar and BiharisVoice of Bihar | Amazing Facts of Bihar | Know the actual Bihar and Biharis
Voice of Bihar | Amazing Facts of Bihar | Know the actual Bihar and Biharis
 
Pench Pational Park
Pench Pational ParkPench Pational Park
Pench Pational Park
 
Madhya pradesh
Madhya pradeshMadhya pradesh
Madhya pradesh
 
Kerala
Kerala Kerala
Kerala
 
Biology forest and wildlife project
Biology forest and wildlife projectBiology forest and wildlife project
Biology forest and wildlife project
 
Kerala Tourist Destinations
Kerala Tourist DestinationsKerala Tourist Destinations
Kerala Tourist Destinations
 
Haryana Agricultural Productivity Solutions
Haryana Agricultural Productivity SolutionsHaryana Agricultural Productivity Solutions
Haryana Agricultural Productivity Solutions
 
The Beautiful City Chandigarh
The Beautiful City ChandigarhThe Beautiful City Chandigarh
The Beautiful City Chandigarh
 
NANDAN KANAN
NANDAN KANAN NANDAN KANAN
NANDAN KANAN
 
Water Conservation ppt presentation
Water Conservation ppt presentationWater Conservation ppt presentation
Water Conservation ppt presentation
 
Man animal conflict management in Anamalai Tiger Reserve avichal
Man animal conflict management in Anamalai Tiger Reserve avichal Man animal conflict management in Anamalai Tiger Reserve avichal
Man animal conflict management in Anamalai Tiger Reserve avichal
 
Uttarakhand
UttarakhandUttarakhand
Uttarakhand
 
Water ppt presentation
Water ppt presentationWater ppt presentation
Water ppt presentation
 
Wildlife presentation
Wildlife presentationWildlife presentation
Wildlife presentation
 
Uttar-Pradesh-04092012.ppt
Uttar-Pradesh-04092012.pptUttar-Pradesh-04092012.ppt
Uttar-Pradesh-04092012.ppt
 
New microsoft word document
New microsoft word documentNew microsoft word document
New microsoft word document
 

Viewers also liked

Mastering RecyclerView Layouts
Mastering RecyclerView LayoutsMastering RecyclerView Layouts
Mastering RecyclerView LayoutsDave Smith
 
ExtraLayoutSpace of RecyclerView
ExtraLayoutSpace of RecyclerViewExtraLayoutSpace of RecyclerView
ExtraLayoutSpace of RecyclerViewMima Yuki
 
Master of RecyclerView
Master of RecyclerViewMaster of RecyclerView
Master of RecyclerViewYuki Anzai
 
The Tale of a Smooth RecyclerView
The Tale of a Smooth RecyclerViewThe Tale of a Smooth RecyclerView
The Tale of a Smooth RecyclerViewSimek Adam
 
[React Native Tutorial] Lecture 7: Navigation - Scene Transition - ListView
[React Native Tutorial] Lecture 7: Navigation - Scene Transition - ListView[React Native Tutorial] Lecture 7: Navigation - Scene Transition - ListView
[React Native Tutorial] Lecture 7: Navigation - Scene Transition - ListViewKobkrit Viriyayudhakorn
 

Viewers also liked (6)

Mastering RecyclerView Layouts
Mastering RecyclerView LayoutsMastering RecyclerView Layouts
Mastering RecyclerView Layouts
 
ExtraLayoutSpace of RecyclerView
ExtraLayoutSpace of RecyclerViewExtraLayoutSpace of RecyclerView
ExtraLayoutSpace of RecyclerView
 
Master of RecyclerView
Master of RecyclerViewMaster of RecyclerView
Master of RecyclerView
 
The Tale of a Smooth RecyclerView
The Tale of a Smooth RecyclerViewThe Tale of a Smooth RecyclerView
The Tale of a Smooth RecyclerView
 
Recyclerview in action
Recyclerview in action Recyclerview in action
Recyclerview in action
 
[React Native Tutorial] Lecture 7: Navigation - Scene Transition - ListView
[React Native Tutorial] Lecture 7: Navigation - Scene Transition - ListView[React Native Tutorial] Lecture 7: Navigation - Scene Transition - ListView
[React Native Tutorial] Lecture 7: Navigation - Scene Transition - ListView
 

Similar to Build and Distributing SDK Add-Ons

MuleSoft Surat Live Demonstration Virtual Meetup#3 - Building JWT OAuth 2.0 C...
MuleSoft Surat Live Demonstration Virtual Meetup#3 - Building JWT OAuth 2.0 C...MuleSoft Surat Live Demonstration Virtual Meetup#3 - Building JWT OAuth 2.0 C...
MuleSoft Surat Live Demonstration Virtual Meetup#3 - Building JWT OAuth 2.0 C...Jitendra Bafna
 
Hello, Android Studio 3.2 & Android App Bundle @ I/O Extended Bangkok 2018
Hello, Android Studio 3.2 & Android App Bundle @ I/O Extended Bangkok 2018Hello, Android Studio 3.2 & Android App Bundle @ I/O Extended Bangkok 2018
Hello, Android Studio 3.2 & Android App Bundle @ I/O Extended Bangkok 2018Somkiat Khitwongwattana
 
Application Deployment with Zend Server 5.5 beta
Application Deployment with Zend Server 5.5 betaApplication Deployment with Zend Server 5.5 beta
Application Deployment with Zend Server 5.5 beta10n Software, LLC
 
Operator SDK for K8s using Go
Operator SDK for K8s using GoOperator SDK for K8s using Go
Operator SDK for K8s using GoCloudOps2005
 
Let's build Developer Portal with Backstage
Let's build Developer Portal with BackstageLet's build Developer Portal with Backstage
Let's build Developer Portal with BackstageOpsta
 
Intro to Eclipse Che, by Tyler Jewell
Intro to Eclipse Che, by Tyler JewellIntro to Eclipse Che, by Tyler Jewell
Intro to Eclipse Che, by Tyler Jewelljwi11iams
 
Spring Cloud Function & Project riff #jsug
Spring Cloud Function & Project riff #jsugSpring Cloud Function & Project riff #jsug
Spring Cloud Function & Project riff #jsugToshiaki Maki
 
Salesforce Developer eXperience (SFDX)
Salesforce Developer eXperience (SFDX)Salesforce Developer eXperience (SFDX)
Salesforce Developer eXperience (SFDX)Bohdan Dovhań
 
Accelerate Your Automation Testing Effort using TestProject & Docker | Docker...
Accelerate Your Automation Testing Effort using TestProject & Docker | Docker...Accelerate Your Automation Testing Effort using TestProject & Docker | Docker...
Accelerate Your Automation Testing Effort using TestProject & Docker | Docker...Ajeet Singh Raina
 
Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...
Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...
Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...Patrick Chanezon
 
Red Hat OpenShift Operators - Operators ABC
Red Hat OpenShift Operators - Operators ABCRed Hat OpenShift Operators - Operators ABC
Red Hat OpenShift Operators - Operators ABCRobert Bohne
 
DevOps Interview Questions and Answers 2019 | DevOps Tutorial | Edureka
DevOps Interview Questions and Answers 2019 | DevOps Tutorial | EdurekaDevOps Interview Questions and Answers 2019 | DevOps Tutorial | Edureka
DevOps Interview Questions and Answers 2019 | DevOps Tutorial | EdurekaEdureka!
 
Understanding and extending p2 for fun and profit
Understanding and extending p2 for fun and profitUnderstanding and extending p2 for fun and profit
Understanding and extending p2 for fun and profitPascal Rapicault
 
Titanium Studio [Updated - 18/12/2011]
Titanium Studio [Updated - 18/12/2011]Titanium Studio [Updated - 18/12/2011]
Titanium Studio [Updated - 18/12/2011]Sentinel Solutions Ltd
 
Light-up-your-out-of-the-box LightSwitch Application
Light-up-your-out-of-the-box LightSwitch ApplicationLight-up-your-out-of-the-box LightSwitch Application
Light-up-your-out-of-the-box LightSwitch ApplicationBoulos Dib
 
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)mfrancis
 

Similar to Build and Distributing SDK Add-Ons (20)

SFDX Presentation
SFDX PresentationSFDX Presentation
SFDX Presentation
 
MuleSoft Surat Live Demonstration Virtual Meetup#3 - Building JWT OAuth 2.0 C...
MuleSoft Surat Live Demonstration Virtual Meetup#3 - Building JWT OAuth 2.0 C...MuleSoft Surat Live Demonstration Virtual Meetup#3 - Building JWT OAuth 2.0 C...
MuleSoft Surat Live Demonstration Virtual Meetup#3 - Building JWT OAuth 2.0 C...
 
Apache DeltaSpike: The CDI Toolbox
Apache DeltaSpike: The CDI ToolboxApache DeltaSpike: The CDI Toolbox
Apache DeltaSpike: The CDI Toolbox
 
Apache DeltaSpike the CDI toolbox
Apache DeltaSpike the CDI toolboxApache DeltaSpike the CDI toolbox
Apache DeltaSpike the CDI toolbox
 
Hello, Android Studio 3.2 & Android App Bundle @ I/O Extended Bangkok 2018
Hello, Android Studio 3.2 & Android App Bundle @ I/O Extended Bangkok 2018Hello, Android Studio 3.2 & Android App Bundle @ I/O Extended Bangkok 2018
Hello, Android Studio 3.2 & Android App Bundle @ I/O Extended Bangkok 2018
 
Application Deployment with Zend Server 5.5 beta
Application Deployment with Zend Server 5.5 betaApplication Deployment with Zend Server 5.5 beta
Application Deployment with Zend Server 5.5 beta
 
Operator SDK for K8s using Go
Operator SDK for K8s using GoOperator SDK for K8s using Go
Operator SDK for K8s using Go
 
Let's build Developer Portal with Backstage
Let's build Developer Portal with BackstageLet's build Developer Portal with Backstage
Let's build Developer Portal with Backstage
 
Intro to Eclipse Che, by Tyler Jewell
Intro to Eclipse Che, by Tyler JewellIntro to Eclipse Che, by Tyler Jewell
Intro to Eclipse Che, by Tyler Jewell
 
Spring Cloud Function & Project riff #jsug
Spring Cloud Function & Project riff #jsugSpring Cloud Function & Project riff #jsug
Spring Cloud Function & Project riff #jsug
 
Salesforce Developer eXperience (SFDX)
Salesforce Developer eXperience (SFDX)Salesforce Developer eXperience (SFDX)
Salesforce Developer eXperience (SFDX)
 
Accelerate Your Automation Testing Effort using TestProject & Docker | Docker...
Accelerate Your Automation Testing Effort using TestProject & Docker | Docker...Accelerate Your Automation Testing Effort using TestProject & Docker | Docker...
Accelerate Your Automation Testing Effort using TestProject & Docker | Docker...
 
Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...
Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...
Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...
 
Red Hat OpenShift Operators - Operators ABC
Red Hat OpenShift Operators - Operators ABCRed Hat OpenShift Operators - Operators ABC
Red Hat OpenShift Operators - Operators ABC
 
DevOps Interview Questions and Answers 2019 | DevOps Tutorial | Edureka
DevOps Interview Questions and Answers 2019 | DevOps Tutorial | EdurekaDevOps Interview Questions and Answers 2019 | DevOps Tutorial | Edureka
DevOps Interview Questions and Answers 2019 | DevOps Tutorial | Edureka
 
Understanding and extending p2 for fun and profit
Understanding and extending p2 for fun and profitUnderstanding and extending p2 for fun and profit
Understanding and extending p2 for fun and profit
 
Titanium Studio [Updated - 18/12/2011]
Titanium Studio [Updated - 18/12/2011]Titanium Studio [Updated - 18/12/2011]
Titanium Studio [Updated - 18/12/2011]
 
Light-up-your-out-of-the-box LightSwitch Application
Light-up-your-out-of-the-box LightSwitch ApplicationLight-up-your-out-of-the-box LightSwitch Application
Light-up-your-out-of-the-box LightSwitch Application
 
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
 
GradleFX
GradleFXGradleFX
GradleFX
 

Recently uploaded

(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 

Recently uploaded (20)

(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 

Build and Distributing SDK Add-Ons

  • 1. Building and Distributing SDK Add-ons Dave Smith NewCircle, Inc. @devunwired +DaveSmithDev
  • 2. –The Pointy Haired Boss How do we connect developers with the additional features and functionality we have built into our Android-based device?
  • 3.
  • 6. SDK Add-On Library Package Java stubs Java docs Meta System Image Package System Data Ramdisk Kernel Meta
  • 7. SDK Repository SDK Add-On Library Package Java stubs Java docs Meta System Image Package System Data Ramdisk Kernel Meta Repo XML Meta
  • 8. SDK Repository SDK Add-On Library Package Java stubs Java docs Meta System Image Package System Data Ramdisk Kernel Meta Repo XML Meta SOLVED
  • 9. Get The Tools! $ repo init -u https://android.googlesource.com/platform/manifest -b android-5.0.1_r1 -g all $ repo sync <manifest>
 …
 <project path="tools/adt/eclipse" name="platform/tools/adt/eclipse" groups="notdefault,tools" />
 <project path="tools/adt/idea" name="platform/tools/adt/idea" groups="notdefault,tools" />
 <project path="tools/base" name="platform/tools/base" groups="notdefault,tools" />
 …
 </manifest> platform/manifest/default.xml
  • 10. Android Shared Libraries • Exposed from the /system/framework for use by applications. • Applications reference via <uses-library> in the AndroidManifest.xml • Library is appended to application's classpath • No copy necessary in application's APK • Exposed via XML definition in /system/etc/permissions <?xml version="1.0" encoding="utf-8"?> <permissions> <library name="com.example.library1" file="/system/framework/com.example.library1.jar"/> </permissions> /system/etc/permissions/com.example.library1.xml
  • 11. Exposing Your Libs # Build the library include $(CLEAR_VARS) LOCAL_MODULE_TAGS := optional LOCAL_MODULE := com.example.library1 LOCAL_SRC_FILES := $(call all-java-files-under,.) include $(BUILD_JAVA_LIBRARY) # Copy XML to /system/etc/permissions/ include $(CLEAR_VARS) LOCAL_MODULE_TAGS := optional LOCAL_MODULE := com.example.library1.xml LOCAL_MODULE_CLASS := ETC LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/permissions LOCAL_SRC_FILES := $(LOCAL_MODULE) include $(BUILD_PREBUILT) Android.mk
  • 12. Documentation • Javadoc parser wrapper • Generated HTML from class/method comments • Accessible to developers through the IDE • Don't include in the system image packages list. # Build the documentation include $(CLEAR_VARS) LOCAL_SRC_FILES := $(call all-subdir-java-files) $(call all- subdir-html-files) LOCAL_MODULE:= com.example.library1_doc LOCAL_DROIDDOC_OPTIONS := com.example.library1 LOCAL_MODULE_CLASS := JAVA_LIBRARIES LOCAL_DROIDDOC_USE_STANDARD_DOCLET := true include $(BUILD_DROIDDOC) Android.mk
  • 14. Inform SDK Manager #Identify the component name=SDK Add-On name-id=addon #Identify yourself vendor=NewCircle vendor-id=newcircle #Identify the base target api=21 #What did you add? libraries=com.example.library1;com.example.library2 com.example.library1=com.example.library1.jar;Example Library com.example.library2=com.example.library2.jar;Example Service manifest.ini
  • 15. Stubs! SDK Package System Image Internal Classes Public ClassesPublic Classes
  • 17. System Image Metadata Addon.VendorDisplay=NewCircle Addon.VendorId=newcircle AndroidVersion.ApiLevel=${PLATFORM_SDK_VERSION} Pkg.Desc=NewCircle SDK Platform ${PLATFORM_VERSION} Pkg.Revision=1 SystemImage.Abi=${TARGET_CPU_ABI} #Link this image to your add-on via the tag SystemImage.TagDisplay=SDK Add-On SystemImage.TagId=addon source.prop_template
  • 18. PRODUCT_PACKAGES += … PRODUCT_SDK_ADDON_NAME := device_sdk_addon PRODUCT_SDK_ADDON_COPY_FILES := manifest.ini:manifest.ini # Use this to copy your library modules PRODUCT_SDK_ADDON_COPY_MODULES := com.example.library1:libs/com.example.library1.jar com.example.library2:libs/com.example.library2.jar PRODUCT_SDK_ADDON_STUB_DEFS := addon_stub_defs.txt # New on Lollipop+, system images are built as a separate package PRODUCT_SDK_ADDON_SYS_IMG_SOURCE_PROP := source.prop_template PRODUCT_SDK_ADDON_DOC_MODULES := com.example.library1_doc # This add-on extends the default sdk product. $(call inherit-product, $(SRC_TARGET_DIR)/product/sdk.mk) PRODUCT_NAME := device_sdk_addon PRODUCT_DEVICE := device PRODUCT_MODEL := SDK Add-on For My Device device_sdk_addon.mk
  • 19. Add to Existing Target… # Your existing product makefiles PRODUCT_MAKEFILES := $(LOCAL_DIR)/full_device.mk # Append your SDK add-on PRODUCT_MAKEFILES += $(LOCAL_DIR)/device_sdk_addon.mk AndroidProducts.mk
  • 21.
  • 22.
  • 23. Repositories<sdk:sdk-sys-img xmlns:sdk="http://schemas.android.com/sdk/android/sys-img/3"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <sdk:license type="text" id="addon-license"> … </sdk:license>
 <sdk:system-image>
 <sdk:revision>1</sdk:revision>
 <sdk:description>NewCircle SDK Platform 5.0.1</sdk:description>
 <sdk:api-level>21</sdk:api-level>
 <sdk:abi>x86</sdk:abi>
 <sdk:archives>
 <sdk:archive>
 <sdk:size>187303276</sdk:size>
 <sdk:checksum type="sha1">33f9a1d41f16cb6f5b8099752131b8f01d5f53c3 </sdk:checksum>
 <sdk:url>alpha_sdk_img_r1.zip</sdk:url>
 </sdk:archive>
 </sdk:archives>
 <sdk:uses-license ref="addon-license"/>
 <!-- Link this system image to our add-on library -->
 <sdk:add-on>
 <sdk:vendor-id>newcircle</sdk:vendor-id>
 <sdk:vendor-display>NewCircle</sdk:vendor-display>
 </sdk:add-on>
 <sdk:tag-id>addon</sdk:tag-id>
 </sdk:system-image>
 </sdk:sdk-sys-img>
  • 24. <?xml version="1.0" encoding="utf-8"?>
 <sdk:sdk-addon xmlns:sdk="http://schemas.android.com/sdk/android/addon/7"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <sdk:license type="text" id="addon-license"> … </sdk:license>
 <sdk:add-on>
 <sdk:vendor-id>newcircle</sdk:vendor-id>
 <sdk:vendor-display>NewCircle</sdk:vendor-display>
 <sdk:name-id>addon</sdk:name-id>
 <sdk:name-display>SDK Add-On</sdk:name-display>
 <sdk:api-level>21</sdk:api-level>
 <sdk:revision>1</sdk:revision>
 <sdk:description>NewCircle SDK Add-On</sdk:description>
 <sdk:desc-url>http://thenewcircle.com/</sdk:desc-url>
 <sdk:uses-license ref="addon-license"/>
 <sdk:archives>
 <sdk:archive>
 <sdk:size>104797</sdk:size>
 <sdk:checksum type="sha1">7418c038e40bdd82ebc8533183ab9404ad6860ec </sdk:checksum>
 <sdk:url>addon_r1.zip</sdk:url>
 </sdk:archive>
 </sdk:archives>
 <!-- Note the extra libraries present in the add-on -->
 <sdk:libs>
 <sdk:lib>
 <sdk:name>com.example.library1</sdk:name>
 <sdk:description>Example Library</sdk:description>
 </sdk:lib>
 <sdk:lib>
 <sdk:name>com.example.library2</sdk:name>
 <sdk:description>Example Service</sdk:description>
 </sdk:lib>
 </sdk:libs>
 </sdk:add-on>
 </sdk:sdk-addon>
  • 25. Tips & Tricks • Archive SHA: sha1sum archive.zip | cut -d " " -f 1 • Archive Size: stat -c %s archive.zip • Repository Schema Files • $AOSP/prebuilts/devtools/repository/*.xsd • xmllint --schema sdk-addon-07.xsd repository.xml • Repository XML Generator Script • $AOSP/development/build/tools/mk_sdk_repo_xml.sh • Parses manifest.ini or source.properties for metadata
  • 26. Learn More Android Internals Public Class Private On-Site Training Also Available http://thenewcircle.com/training/android Device Target + SDK Sample: http://github.com/thenewcircle/alpha