Build Android AOSP with OpenCV Manager installed

Discussion in 'Android' started by spaniard, Apr 22, 2015.

  1. spaniard

    spaniard New Member

    Joined:
    Jun 17, 2014
    Messages:
    5
    Likes Received:
    0
    Hi,

    I am trying build the AOSP version provided with Udoo with the OpenCv Manager installed directly in it. The steps I had followed:

    1- Add the OpenCV_2.4.8_Manager_2.16_armv7a-neon.apk under the folder: AOSP_SOURCE_FOLDER/packages/apps/OpenCV_Manager/

    2- Add the Android.mk file to this folder, with the settings:
    Code:
    LOCAL_PATH := $(call my-dir)
    
    include $(CLEAR_VARS)
    
    LOCAL_MODULE_TAGS := optional
    LOCAL_MODULE := OpenCvManager
    LOCAL_SRC_FILES := OpenCV_2.4.8_Manager_2.16_armv7a-neon.apk
    LOCAL_MODULE_SUFFIX := .apk
    LOCAL_MODULE_CLASS := APPS
    LOCAL_CERTIFICATE := PRESIGNED
    LOCAL_MODULE_PATH := $(TARGET_OUT)/app
    
    include $(BUILD_PREBUILT)
    3- Modify the file udoo.mk to add this apk to the Products_packages, the result is:
    Code:
    PRODUCT_PACKAGES += \
    	rfkill \
    	iwconfig \
    	iwlist \
    	setotg \
    	ESFileExplorer \
    [b]     	OpenCvManager \
    [/b]	lsusb

    I know this steps are partially good because they work and the .apk is added to the build. The problem comes when I start the app and I receive the following error:

    Although the error message says that, I know the package is the correct because this doesn't happen when I had installed the app manually. It must be some problem of the installation during the build, maybe some other var that need to be defined in the Android.mk file? I am not sure, I am familiar with the Udoo kernel, but not with this part of the build process.

    Any help is welcome,

    Spaniard

    P.S: Useful links for people willing to help me:
    http://docs.opencv.org/platforms/android/service/doc/index.html
    http://docs.opencv.org/platforms/an...o-select-the-proper-version-of-opencv-manager
     
  2. udK

    udK New Member

    Joined:
    Apr 29, 2015
    Messages:
    2
    Likes Received:
    0
    The best way to copy a prebuilt APK is to use this code in .mk file:
    Code:
    # OpenCV file
    PRODUCT_COPY_FILES += \
        path/to/OpenCV_2.4.8_Manager_2.16_armv7a-neon.apk:system/app/OpenCV.apk
    but, you also need to modify a little part of AOSP code in build directory, here the commit needed https://github.com/rascarlo/android_bui ... 15d66c1b1c
     
  3. spaniard

    spaniard New Member

    Joined:
    Jun 17, 2014
    Messages:
    5
    Likes Received:
    0
    Thank you again for your reply I will try it and let you know.

    Spaniard.
     

Share This Page