Skip to content Skip to sidebar Skip to footer

How To Build \external\mmc-util\ And Execute It In Android?

I have a RK3288 SOC platform and its all AOSP source code(Andorid SDK, NDK, Linux kernel, U-boot). There is \external\mmc-util\mmc.c in AOSP. That seems to use ioctl function to te

Solution 1:

The simplest way (for Linux and Eclipse ADT) is:

  1. Take the hello-jni example; make sure it compiles (via ndk-build) and runs.

  2. In the jni/ subdirectory, locate Android.mk

  3. Modify it to compile your file.

Example Android.mk:

LOCAL_PATH := $(call my-dir)# magic spellinclude$(CLEAR_VARS)
LOCAL_MODULE := one
LOCAL_SRC_FILES += one.c ... # files to compile# link with liblog.so libMyStuff.so libTheirStuff.so
LOCAL_LDLIBS := -llog -L$(LOCAL_PATH)/lib -lMyStuff -lTheirStuff
include$(BUILD_SHARED_LIBRARY)# this builds libone.so# you can build more than one module via the same .mkinclude$(CLEAR_VARS)

LOCAL_MODULE := sendraw
LOCAL_SRC_FILES := sendRawEth.c
#LOCAL_CPPFLAGS := -std=gnu++0x -Wall         # whatever g++ flags you like#LOCAL_LDLIBS := -llog   # whatever ld flags you likeinclude$(BUILD_EXECUTABLE)# <-- Use this to build an executable.

Post a Comment for "How To Build \external\mmc-util\ And Execute It In Android?"