Deploying SDK Addon component - android

Based on PlatformLibrary sample code in the SDK, I have created a small hello world library, the eventual goal of the library is to add capability for 3rd part developers to develop for my custom Android image.
I am currently stuck at the point on how to deploy the same so that developers can start using it, I am unable to find any pointers, please help if you have any information.

Ok, I figured out based on for 4.0.3
Create a new sample device, based on the the existing one located at
<SDK-ROOT>/device/sample
build the sdk-addon
<SDK-ROOT>$ . build/envsetup.sh
<SDK-ROOT>$ make -j8 PRODUCT-<your-sdk-addon-name>-sdk_addon
Once the SDK is build you will get the sdk addon archive located at
<SDK-ROOT>/out/host/linux-x86/sdk-addon/<sdkname>.zip
I copied the ZIP to the http server directory, so that it has a link I can refer in Android SDK manager.
Created new SDK XML configuration file and put it in the http server (I used the one located at http://android-sdk-addons.motodevupdate.com/addons.xml for reference)
Went to Android SDK manager, added path to new add on XML created on #5 and OK
Install the new SDK On listed in the android SDK manager, after the installation is done, you can get check the add-ons directory of ur developer SDK to find the add-on.
Also bits and pieces from marakana.com/s/remixing_android,1044/index.html helped.

Looks like you resolved your own issue, but just FYI - to simplify/automate your step #5 above, you can use the mk_sdk_repo_xml.sh script provided under platform/development/build/tools to build the add-on repository.
This is actually used by the phony 'sdk_repo' target (platform/development/build/tools/sdk_repo.mk), so you can take a look to see what the intended usage is. It has the benefit of managing all the packaging/checksum generation etc for you.
Note that it's supposed to provide some automagic behaviour based on the ADDON_SDK_ZIP which is defined by the sdk_addon build task, but that never worked on our customized gingerbread platform, so I ended up putting in an explicit call like this:
$(shell $(TOPDIR)development/build/tools/mk_sdk_repo_xml.sh \
$(TOPDIR)out/host/linux-x86/sdk_addon/addon.xml \
$(TOPDIR)sdk/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-addon-1.xsd \
add-on any $(TOPDIR)out/host/linux-x86/sdk_addon/LIBRARY_NAME-eng-linux-x86.zip:sdk-repo-any-addon-LIBRARY_NAME.zip )

I figured out based on 4.4.2 and Andrdoid Studio 1.4, and it doesn't need put sdk add on xml to web server.
1.Create a new sample device, based on the the existing one located at
<ANDROID-ROOT>/device/<your-sdk-addon-name>
2.build the sdk-addon
<ANDROID-ROOT>$ . build/envsetup.sh
<ANDROID-ROOT>$ make -j8 PRODUCT-<your-sdk-addon-name>-sdk_addon
3.Once the SDK is build you will get the sdk addon archive located at
<ANDROID-ROOT>/out/host/linux-x86/sdk-addon/<sdkname>.zip
4.Extract .zip to
<SDK-ROOT>\add-ons\<your-sdk-addon-name>
5.Copy
<ANDROID-ROOT>\device\<your-sdk-addon-name>\sdk_addon\manifest.ini
to
<SDK-ROOT>\add-ons\<your-sdk-addon-name>
Create new file source.properties to <SDK-ROOT>\add-ons\<your-sdk-addon-name>
Addon.NameId=your-sdk-addon-name
Pkg.Desc=Provides the oem APIs to 3rd party apk developer
Addon.VendorId=your-sdk-addon-vendor-name
Archive.Arch=ANY
Addon.NameDisplay=your-sdk-addon-name
Addon.VendorDisplay=your-sdk-addon-vendor-name
Archive.Os=ANY
Pkg.Revision=1
AndroidVersion.ApiLevel=19
Open SDK Manager, your will see your SDK add on listed
New a Android Studio project, edit build.gradle file:
android {
compileSdkVersion "<your-sdk-addon-vendor-name>:<your-sdk-addon-name>:<sdk-api-level>"
...
}
Build the project, your add on jar will be loaded to External Libraries in Android Studio

Related

Can't mach build Fennec for Android

i'm following this tutorial from firefox android source code https://wiki.mozilla.org/Mobile/Fennec/Android
but, the problem i can't ./mach build, ./mach package, ./mach install and i already create .mozconfig file in mozilla-central but it's can't found the file.
like this:
i'm using Ubuntu 14.04.2
thx for help
You probably had an error during the initial "mach bootstrap" step. Your screenshot tells us, that mach can't find the android sdk tools. It's looking for them under ~/.mozbuild/android-sdk-linux/.
One thing you could do is to manually put your sdk under that directory and then retry "mach bootstrap" from the source dir to resolve the remaining dependencies.
Also see these steps for manual setup of the build tools: https://wiki.mozilla.org/Mobile/Fennec/Android/Detailed_build_instructions

Using serial for android library

I'm trying to implement this https://github.com/mik3y/usb-serial-for-android/blob/master/UsbSerialExamples/src/com/hoho/android/usbserial/examples/SerialConsoleActivity.java in my project but there is something wrong with this sample.
Line 121:
sDriver.setParameters(115200, 8, UsbSerialDriver.STOPBITS_1, UsbSerialDriver.PARITY_NONE);
Why I can't see this method setParameters()?
I had the same problem when I tried to use the example project. The problem I had was that I was using usb-serial-for-android-v010.jar that you can download from the git repository. I think it was created using an older version of the project and doesn't support some of the newer features like setParameters. If you downloaded the example project there should be a folder inside called UsbSerialLibrary. Import that into your IDE and add it to your build path: (Eclipse) Properties>Java Build Path>Projects>Add. This should let you use setParameters.
Also, the API was recently refactored so you may want to look at that.

Adding new class in framework via SDK-Addon: NoClassDefFoundError

I am trying to introduce a new API on the custom android 4.0.3 image.
I have used the \device\sample project and created a new device sdk-addon based on it,
I have added my own java add-on library code and the build is happens perfectly fine, when compiled with 'make PRODUCT-mysample_addon-sdk_​addon'
The output is available in the out\host\linux-x86\sdk_addon\ as a ZIP file
I am able to install the zip file in the sdk add-on directory, create new avd with my custom add-on and launch the emulator.
When I create new android UI application using the new add-on I created, the application builds using my new custom API but when I try to run it on device, the addon class is not found and I get java.lang.​NoClassDefFoundError.
The Jar and odex are located in /system/framework directory, the JAR file contains only the manifest the ODEX contains the actual class information.
I am not sure what more entries needs to be done, I got hint from someone that adding the class reference in BOOTCLASSPATH in init.rc will help, I have also tried but it does not seems to work.
Please suggest if you have any idea.
The solution answered elsewhere was to add
<uses-library android:name="<library-package>"/>
in AndroidManifest.xml of the application.

default.properties not being created

I am using InteliJ Idea Community edition to develop android apps. I was trying to write UnitTests for a HelloWorld App as described in link text
. However I keep on getting an error
Found main project package: com.example.helloandroid
Found main project activity: .HelloAndroid
Error: Unable to load the main project's default.properties
On going through the files that were created by InteliJ Idea, I saw that all the files as mentioned in d.android.com/guide/developing/other-ide.html#CreatingAProject are being created except for defaul.properties and build.properties.
Is there any way we can create these files?
I had the same problem you're describing as I'm also developing using IntelliJ and these are the steps I followed to create a valid default.properties
1) Create a project using Android (with no IDE) the instructions are here. I created using exactly the same information than in my original IntelliJ project but looking at the resulting file it was not that important.
2) Copy the default.properties to your own project
In order to create the project you will have to know the id of the target you are using, you can obtain the list by executing android list targets.
Once I created the project I opened the default.properties file and the only thing important there was the target, in my case Project target.target=android-8
Hope this helps although your question is stackoverflow since a long time already.
Regards
PS: if I knew how to attach a file you wouldn't require to follow the above steps as the resulting file has no project specific information except for the target (if you want me to send it to you just tell me)
This is a bug and has been fixed but the fix has not been released yet:
http://youtrack.jetbrains.net/issue/IDEA-69343?projectKey=IDEA&query=android+default.properties

How to add javadoc for android to Netbeans

I just started using Net Beans. I am wanting to try my hand at developing android apps. I got the android sdk downloaded and everything is working well. I can create little apps and run them in the emulator. However, the intelisense popup for the android methods says that the Javadoc isn't found. Is there a way to add it?
The best way as below steps in NetBeans 7:
Tools --> Ant Libraries.
New library --> Name it Android.
Classpath --> Add JAR/Folder --> {SDK Folder}\platforms\android-16\android.jar
(in short find android.jar and use it's path, for me I'm using 16 version).
Javadoc --> Add ZIP/Folder --> {SDK Folder}\docs\references
(important note: you may get error in above step, so search will not work. To solve it, copy the file index.html inside [references folder] to a new file and called index-all.html. Then re-add the path in step 4).
Source: Here
Take a look at the Android Sources provided by adt-addons. This eclipse plugin will download all of the sources and attach them automatically.
If you aren't using Eclipse, you can still download the source zips from the jar at http://adt-addons.googlecode.com/svn/trunk/source/com.android.ide.eclipse.source.update/plugins/
Extract the jar file and inside you'll find source zips for each platform revision. Attach these to your IDE.
Otherwise, you can check out the sources manually from git but this is a rather lengthy and arduous process to achieve the above.
You can download various javadocs from
http://www.jarvana.com/jarvana/browse/com/google/android/android/2.3.3/
Just drop the javadocs jar files to android-sdk-{macosx,windows,linux}/docs
Not sure what your setup is like, but the JavaDoc is stored in /docs/reference
For my setup I had to create a zip of that folder and add it as JavaDoc to the Android library.
If you use the nbandroidsupport plugin you can download the javadoc from Android SDK Manager, you can found the package in the latest android's API (in my case Android 5.1.1) the name of package is "Documentation for Android SDK".
Once you have installed the package restart your netbeans. In my case the javadoc is not showing sometimes pressing ctrl+space on the method therefore you can show the javadoc pressing ctrl+shift+space.
Note: this method applies to any API version.

Categories

Resources