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.
Related
I am currently working on a Xamarin.Forms application that uses native barcode scanning capabilities of the mobile device. I have integrated two different device SDKS from different manufacturers (Casio & Denso).
The main launcer is SplashActivity, which shows the splash screen, detects device info and launces one of the following:
CasioActivity
DensoActivity
These activities are responsible for subscribing to scan events raised by corresponding device.
Denso integration is done with a DLL file supplied by the manufacturer, while Casio integration is done through a Xamarin Bindings project, following this tutorial.
Deployment to Casio works fine but when I deploy the application on the Denso unit, I get the following error message in Visual Studio:
install_failed_missing_shared_library device.sdk is required
I believe that the Casio SDK (*.aar file) is forcing that the app runs only on Casio devices. I tried adding the following to the application manifest:
<uses-library android:name="device.sdk" android:required="false" />
and also tried adding the UsesLibrary attribute to all activities to make device.sdk optional but none worked. It appears that the bindings project is injecting the following to the manifest file on deployment:
<uses-library android:name="device.sdk" android:required="true" />
Is there any way to prevent the injection of the above line into the manifest file?
I would like to make the application compatible with both of these units.
I solved this by modifying the aar file.
Use 7zip to extract the aar file to a folder
Find the application manifest in the extracted folder
Set android:required attribute to false.
Zip the folder again
Change the file extension from .zip to .aar
Put the new file under Jars folder as shown here
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
I'm developing a simple plugin to Unity Android, that displays an image from the web.
I've created a Jar using my Java files, and loaded it (in a blank Unity sample application) using AndroidJavaClass.
All worked fine, but then I've wanted to rename my Java package.
From now on - I can't see the image. The plugin doesn't even trying to access it.
I've changed the package name in the Java files, and also in the AndroidManifest.xml and in the CS file that's calling it.
The Jar compiles successfully, the application runs on the device, but... nothing.
I've also created a new application that uses the plugin with his new name, but no success.
What have I done wrong?
Or - what can I do to make it work?
Thanks,
Keren
Why would you code a plug-in to display a web image ?
Just use unity native WWW call, then put the result in a texture.
Look at the unity docs.
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
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.