I strongly recommend basing your work on the PlatformLibrary sample code,
rather than modifying the framework itself.

On Wed, Nov 18, 2009 at 1:37 AM, Sam <[email protected]> wrote:

> Hi all,
>      I want to add my own API's to android.
>      For this thing I followed one document I got from net and
> according to I added one directory called "abc" to android framework
> which contains three sub directories "java", "jni"  and "libabc".
>
> When I tried to build the source code with this added directory I got
> following error:
> make: *** No rule to make target `out/target/product/generic/obj/
> STATIC_LIBRARIES/�_intermediates/�.a', needed by `out/target/product/
> generic/obj/SHARED_LIBRARIES/libabc_jni_intermediates/LINKED/
> libabc_jni.so'.  Stop.
>
> Then I checked the libabc_jni_intermediate directory and found that
> LINKED directory is missing....
>
> The content of all this "java" directory is
> "abc.java" class file
>  package android.abc;
>
> public class abc
> {
>  static
>  {
>  System.loadLibrary("abc_jni");
>  }
>  public native int print(int i);
>  public abc()
>  {
>    //test
>  }
> }
>
> The content of "jni" directory is one "android_abc_abc.cpp" which
> contains jni layer for accesing native function.
> and "Android.mk" file. The content of "Android.mk" is as given below.
>
>
> ifneq ($(BUILD_WITHOUT_PV),true)
> LOCAL_PATH:= $(call my-dir)
> include $(CLEAR_VARS)
>
> LOCAL_SRC_FILES:= \
>  android_abc_abc.cpp
>
> LOCAL_SHARED_LIBRARIES := \
>  libopencoreplayer \
>  libopencoreauthor \
>  libandroid_runtime \
>  libnativehelper \
>
>
> $(warning JNI makefile)
>
> LOCAL_STATIC_LIBRARIES := \
>  libabc
>
> LOCAL_C_INCLUDES += \
>  external/tremor/Tremor \
>  $(PV_INCLUDES) \
>  $(JNI_H_INCLUDE) \
>  $(call include-path-for, corecg graphics)
>
> LOCAL_CFLAGS +=
>
> LOCAL_LDLIBS := -lpthread
>
> LOCAL_MODULE:= libabc_jni
> LOCAL_PRELINK_MODULE := false
> $(warning JNI makefile)
>
> include $(BUILD_SHARED_LIBRARY)
> endif
>
> And content of "libabc" directory are "test.h" and "test.cpp" file
> which defines native function along with "Android.mk".
> The content of "android.mk"file is
>
> LOCAL_PATH:= $(call my-dir)
> include $(CLEAR_VARS)
>
> LOCAL_SRC_FILES:= \
>  test.cpp
>
> LOCAL_SHARED_LIBRARIES := \
>  libui libcutils libutils
>
> $(warning LIBABC make file)
>
> LOCAL_MODULE:= libabc
> LOCAL_PRELINK_MODULE := false
>
> ifeq ($(TARGET_OS)-$(TARGET_SIMULATOR),linux-true)
> LOCAL_LDLIBS += -ldl
> endif
>
> ifneq ($(TARGET_SIMULATOR),true)
> LOCAL_SHARED_LIBRARIES += libdl
> endif
>
> LOCAL_C_INCLUDES := \
>  $(call include-path-for, graphics corecg)
> $(warning LIBABC make file)
>
> #include $(LOCAL_PATH)/abc/jni/Android.mk
> #include $(BUILD_STATIC_LIBRARY)
> #LOCAL_BUILT_MODULE:=libabc
> include $(BUILD_STATIC_LIBRARY)
>
> Please tell me what thing is causing error....
> Or if any one knows any other way to add new API to android please
> share it.
>
>
> Thanks in advance,
> Sagar
>
> --
> unsubscribe: 
> [email protected]<android-porting%[email protected]>
> website: http://groups.google.com/group/android-porting
>



-- 
Dianne Hackborn
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting

Reply via email to