top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Android: using java libraries in AOSP app from /lib directory of App source code?

+2 votes
920 views

How to use java libraries from /lib directory of my app in AOSP?

Currently I have built my app in eclipse so i had my libraries in /lib directory of my app but after including source code in AOSP, it is giving error, I think I need to add the entry of the libraries in /lib in my Android.mk file, but how?

I dont know what entry need to be made... any suggestions?

posted Apr 8, 2014 by Kiran Kumar

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

Yeee... Found the way to add libraries, and also progaurd setting, here is my Android.mk file and praugard file:


LOCAL_PATH := $(call my-dir)include $(CLEAR_VARS)
LOCAL_STATIC_JAVA_LIBRARIES := jackson-annotations-2.2.3 jackson-core-2.2.3 jackson-databind-2.2.3
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-renderscript-files-under, src)
LOCAL_PACKAGE_NAME := MyAPPLOCAL_CERTIFICATE := platform
LOCAL_PROGUARD_FLAG_FILES := proguard.flags
include $(BUILD_PACKAGE)LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := libs/jackson-annotations-2.2.3.jar libs/jackson-core-2.2.3.jar libs/jackson-databind-2.2.3.jar

include $(call all-makefiles-under,$(LOCAL_PATH))

And here is the proguard.flags file:
-dontwarn org.w3c.dom.bootstrap.DOMImplementationRegistry

I hope it would also be helpful to others, facing same issue.

answer Apr 8, 2014 by anonymous
Similar Questions
+4 votes

Does anyone know if it is possible to realize the distributed compilation of Java? Are there any limitations or problems of dependencies ? Are there any Open Source tools which could help to do this?

0 votes

at http://source.android.com/source/build-numbers.html#source-code-tags-and-builds

I find:

Source Code Tags and Builds
JSR78D android-4.3_r2 Nexus 7 (deb)

What does deb mean

+2 votes

I am often confused with Dex Optimization details. Here are few details I know of.

Kindly correct me if i am wrong ? While exploring the source code, i found that package manager scans all the external libraries, base frameworks, system packages, and vendor packages for dex optimization.

So, if I understand correct 'dex optimization' can be done both in compilation time and execution time.

Also, surfing in the internet, DISABLE_DEXPREOPT has an impact over this dex optimization when to be done?

Which one do I have to opt?

DISABLE_DEXPREOPT=true [OR] DISABLE_DEXOPT=false  

while building with the below command

make TARGET= droid -j6  

According to the source code, I understood if .odex is available as part of .jar or apk file, then it ignores dex optimization, while booting.

Kindly correct me if i am wong?. and suggest.

+1 vote

My ultimate goal is to create a new lock screen for android so I thought that the best way to do that is to modify the source files that already implement the lock screens in android and particularly in android 4.2 or 4.3. I followed the instructions in http://source.android.com/source/building.html and i successfully downloaded and built android 4.3 in my computer. The next step is the modification of some java files. I want to do this with eclipse. I have eclipse 4.3.1 and I am trying to follow the instructions in http://source.android.com/source/using-eclipse.html . The problem is that the instructions are for older version of eclipse and with the new version i cant follow the 5th step as shown below :

  • If Eclipse asks you for a workspace location, choose the default.
  • If you have a "Welcome" screen, close it to reveal the Java perspective.
  • File > New > Java Project
  • Pick a project name, "android" or anything you like.
  • SELECT "CREATE PROJECT FROM EXISTING SOURCE", ENTER THE PATH TO YOUR ANDROID ROOT DIRECTORY, AND CLICK FINISH.
  • Wait while it sets up the project. (You'll see a subtle progress meter in the lower right corner.)

How can I do this correctly in eclipse 4.3.1 ; If i follow the wright steps will I be able to import all android 4.3 in eclipse without showing any errors? Please help me.

+3 votes

Does anyone know how I can enable ART in AOSP 4.4? I complete a successful build and load it onto a Nexus 4 (mako). Everything seems to work fine, however, when I go to the settings and change the default runtime to ART, it reboots and never comes back up. When looking through the logs (adb logcat), I see a bunch of segmentation faults coming from libart.so. Is ART supported in AOSP?

Please note that when I take the official image from here: https://developers.google.com/android/nexus/images I am able to enable ART so my theory is that it is not yet enabled in AOSP.

...