zoukankan      html  css  js  c++  java
  • Android 系统内置App JNI

    说明

    将Android应用作为系统内置遇到一些问题:

    1. 一个是使用Android源码的mmm命令生成的JNI名字和使用NDK生成的JNI的名字是不一样的;
    2. 另外就是AndroidManifest.xml中的targetSDKVersion不能低于运行版本。

    JNI

    Android mmm命令
    ......
    No private recovery resources for TARGET_DEVICE sabresd_6dq
    make: Entering directory `/home/myzr/myandroid'
    Import includes file: out/target/product/sabresd_6dq/obj/SHARED_LIBRARIES/shutdown_intermediates/import_includes
    target thumb C: shutdown <= /home/myzr/myandroid/packages/apps/Shutdown/jni/shutdown.c
    target SharedLib: shutdown (out/target/product/sabresd_6dq/obj/SHARED_LIBRARIES/shutdown_intermediates/LINKED/shutdown.so)
    target Symbolic: shutdown (out/target/product/sabresd_6dq/symbols/system/lib/shutdown.so)
    Export includes file: /home/myzr/myandroid/packages/apps/Shutdown/jni/Android.mk -- out/target/product/sabresd_6dq/obj/SHARED_LIBRARIES/shutdown_intermediates/export_includes
    target Strip: shutdown (out/target/product/sabresd_6dq/obj/lib/shutdown.so)
    Install: out/target/product/sabresd_6dq/system/lib/shutdown.so
    make: Leaving directory `/home/myzr/myandroid'
    
    NDK 生成 JNI
    $ $NDK/ndk-build 
    Android NDK: WARNING: APP_PLATFORM android-18 is larger than android:minSdkVersion 8 in ./AndroidManifest.xml    
    [armeabi] Compile thumb  : shutdown <= shutdown.c
    [armeabi] SharedLibrary  : libshutdown.so
    [armeabi] Install        : libshutdown.so => libs/armeabi/libshutdown.so
    
    shell命令修改文件名
    root@android:/ # mv /system/lib/shutdown.so /system/lib/libshutdown.so 
    

    targetSDKVersion

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="18" />
  • 相关阅读:
    给Apache增加SSI支持(shtml的奥秘)
    Raphael实现商品来源去向图
    有趣的居中方式
    oc-基本语法
    APMServ 配置记录
    解决Mac Chrome打开HTTPS证书错误问题
    JavaScript生成GUID的算法
    Backbone模型
    利用apply和arguments复用方法
    软件复用的几种方式
  • 原文地址:https://www.cnblogs.com/zengjfgit/p/5452512.html
Copyright © 2011-2022 走看看