Now you can create a folder, called my.xyz.sdk. Inside of it, please create sub-folder "libs", "docs" to hold the jar file and API documents respectively. And if you also want to share the sample code, you may create a sub-folder "samples", and put the samples in it.
Inside of folder my.xyz.sdk, please create 3 text files, i.e., hardware.ini, manifest.ini and source.properties.
In hardware.ini, you can define display density and virtual machine heap size. For example
# Custom hardware options for the add-on.
# Properties defined here impact all AVD targetting this add-on.
# Each skin can also override those values with its own hardware.ini file.
hw.lcd.density=240
vm.heapSize=24
# Properties defined here impact all AVD targetting this add-on.
# Each skin can also override those values with its own hardware.ini file.
hw.lcd.density=240
vm.heapSize=24
In manifest.ini, you can set parameters for the SDK addon, such as name, vendor, api level, version, library name, jar file and description. For example,
# SDK Add-on Manifest
# File encoding is UTF-8
name=My XYZ SDK
vendor=My XYZ
# version of the Android platform on which this add-on is built.
api=10
# revision of the add-on
revision=1
# list of libraries, separated by a semi-colon.
libraries=MyXYZSDK;
MyXYZSDK=MyXYZSDK.jar; MyXYZ library# File encoding is UTF-8
name=My XYZ SDK
vendor=My XYZ
# version of the Android platform on which this add-on is built.
api=10
# revision of the add-on
revision=1
# list of libraries, separated by a semi-colon.
libraries=MyXYZSDK;
In the source.properties file, you can specify package description, addon name, package revision, addon vendor, and Android API level. For example,
### Android Tool: Source of this archive.
Pkg.Desc=My XYZ SDK - API Level 1.0.1
Addon.Name=MY XYZ addon Jul 23, 2012
Pkg.Revision=1.0.1
Addon.Vendor=My XYZ
AndroidVersion.ApiLevel=10
Pkg.Desc=My XYZ SDK - API Level 1.0.1
Addon.Name=MY XYZ addon Jul 23, 2012
Pkg.Revision=1.0.1
Addon.Vendor=My XYZ
AndroidVersion.ApiLevel=10
Now all files in the MyXYZSDK folder and its sub-folders are ready.
Please proceed to use any compression tool, such Zip, 7zip, to zip the folder and create a zip file, named it as MyXYZSDK.zip.
If you want developers to download and install your SDK addon with Android SDK Manager, then
after the zip MyXYZSDK.zip is created, please open a command window, either on Windows machine or Linux, and use OpenSSL tool, sha1 or md5, to get the checksum value for the zip file,
copy and paste the checksum value into the repository.xml file.
In the repository.xml, you can define some parameters for the addon. The following is a sample.
?xml version="1.0" encoding="UTF-8"?>
<sdk:sdk-addon
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:sdk="http://schemas.android.com/sdk/android/addon/1">
<sdk:add-on>
<sdk:name>MY XYZ SDK</sdk:name>
<sdk:api-level>10</sdk:api-level>
<sdk:vendor>My XYZ</sdk:vendor>
<sdk:revision>1.0.1</sdk:revision>
<sdk:description>My XYZ SDK addon, API 10, revision 1.0.1</sdk:description>
<sdk:desc-url>http://myxyz.com</sdk:desc-url>
<sdk:uses-license ref="androidaddonlicense" />
<sdk:archives>
<sdk:archive os="any">
<sdk:size>27230698</sdk:size>
<sdk:checksum type="sha1">2d9ca1f0034d431b7f5096d3b4dd3574ac848d46</sdk:checksum>
<sdk:url>http://dl.myxyz.com/sdk/download/MyXYZSDK.zip</sdk:url>
</sdk:archive>
</sdk:archives>
<sdk:libs>
</sdk:libs>
</sdk:add-on>
<sdk:license type="text" id="androidaddonlicense">SOFTWARE DEVELOPERS TECHNOLOGY LICENSE AGREEMENT ..."></sdk:license>
</sdk:sdk-addon>
<sdk:sdk-addon
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:sdk="http://schemas.android.com/sdk/android/addon/1">
<sdk:add-on>
<sdk:name>MY XYZ SDK</sdk:name>
<sdk:api-level>10</sdk:api-level>
<sdk:vendor>My XYZ</sdk:vendor>
<sdk:revision>1.0.1</sdk:revision>
<sdk:description>My XYZ SDK addon, API 10, revision 1.0.1</sdk:description>
<sdk:desc-url>http://myxyz.com</sdk:desc-url>
<sdk:uses-license ref="androidaddonlicense" />
<sdk:archives>
<sdk:archive os="any">
<sdk:size>27230698</sdk:size>
<sdk:checksum type="sha1">2d9ca1f0034d431b7f5096d3b4dd3574ac848d46</sdk:checksum>
<sdk:url>http://dl.myxyz.com/sdk/download/MyXYZSDK.zip</sdk:url>
</sdk:archive>
</sdk:archives>
<sdk:libs>
</sdk:libs>
</sdk:add-on>
<sdk:license type="text" id="androidaddonlicense">SOFTWARE DEVELOPERS TECHNOLOGY LICENSE AGREEMENT ..."></sdk:license>
</sdk:sdk-addon>
Now if you would like to test the addon SDK downloading, you need to revise the repository.xml, and change the sdh_url value pointing to the url on your testing server.
Please put both repository.xml and MyXYZSDK.zip into the folder on your testing server. And on your local computer, create a testing xml file to list your SDK addon site, for example
<?xml version="1.0"?>
<sdk:sdk-addons-list xmlns:sdk="http://schemas.android.com/sdk/android/addons-list/1"> <sdk:addon-site>
<sdk:url> https://dl-ssl.google.com/android/repository/addon.xml </sdk:url>
<sdk:name>Google Inc.</sdk:name>
</sdk:addon-site>
<sdk:addon-site>
<sdk:url>http://alpha-test.myxyz.com/sdk/addon.xml</sdk:url>
<sdk:name>MyXYZ</sdk:name>
</sdk:addon-site>
</sdk:sdk-addons-list>and put it in a folder "sdktest".
From the command prompt on your local computer, set the path of SDK_TEST_BASE_URL to the full path of the "sdktest" folder, then run Android SDK Manager by starting "android". Now you can test the downloading of the MyXYZSDK.
If there are some errors, you may go to the steps mentioned above to repeat them again.
After all is well, you can move the MyXYZSDK.zip, repository.xml to your production server.
And also do not forget to contact Google to include the repository url into their SDK addon list,
so that developers would be able to see it in the list of Android SDK addon.
No comments:
Post a Comment