How to Build and Run Android NDK Examples?
来源:互联网 发布:淘宝乐豆有什么用 编辑:程序博客网 时间:2024/05/16 00:08
Take the native-activity sample for example,
1) Cd C:\Users\Qingxu_Li\AppData\Local\Android\android-ndk-r10d\samples\native-activity
2) ndk-build
3) Run the command below to get all available targets.
android list targets
Available Android targets:
----------
id: 1 or "android-21"
Name: Android 5.0.1
Type: Platform
API level: 21
Revision: 2
Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, W
XGA720, WXGA800, WXGA800-7in, AndroidWearRound, AndroidWearSquare, AndroidWearRo
und, AndroidWearSquare
Tag/ABIs : android-tv/armeabi-v7a, android-tv/x86, android-wear/armeabi-v7a, an
droid-wear/x86, default/armeabi-v7a, default/x86, default/x86_64
----------
id: 2 or "Google Inc.:Google APIs:21"
Name: Google APIs
Type: Add-On
Vendor: Google Inc.
Revision: 1
Description: Android + Google APIs
Based on Android 5.0.1 (API level 21)
Libraries:
* com.google.android.media.effects (effects.jar)
Collection of video effects
* com.android.future.usb.accessory (usb.jar)
API for USB Accessories
* com.google.android.maps (maps.jar)
API for Google Maps
Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, W
XGA720, WXGA800, WXGA800-7in, AndroidWearRound, AndroidWearSquare, AndroidWearRo
und, AndroidWearSquare
Tag/ABIs : google_apis/x86
4) Run the command below to generate a build.xml file. Please note that the target ID 2 is retrieved from the command above.
android update project --path . --name NativeActivity --target 2
5) Run the command below to generate a .apk file.
ant debug
6) adb install bin/ NativeActivity-debug.apk
7) adb shell
Then, run the command below to launch the activity.
am start -n com.example.native_activity/android.app.NativeActivity
8) Now, you can run “adb logcat” to see the logs generated by this native activity.
I/native-activity( 1240): accelerometer: x=9.776220 y=0.000000 z=0.813417
I/native-activity( 1240): accelerometer: x=9.776220 y=0.000000 z=0.813417
I/native-activity( 1240): accelerometer: x=9.776220 y=0.000000 z=0.813417
I/native-activity( 1240): accelerometer: x=9.776220 y=0.000000 z=0.813417
I/native-activity( 1240): accelerometer: x=9.776220 y=0.000000 z=0.813417
I/native-activity( 1240): accelerometer: x=9.776220 y=0.000000 z=0.813417
I/native-activity( 1240): accelerometer: x=9.776220 y=0.000000 z=0.813417
I/native-activity( 1240): accelerometer: x=9.776220 y=0.000000 z=0.813417
- How to Build and Run Android NDK Examples?
- How to Build and Run Android L 64-bit ARM in QEMU
- How to run HelloWorld on ndk r4 and r5
- How to run test cases on android-ndk
- How to build and run the XML, RPG and DB2 sample
- How to build android
- How to build and run ARM Linux on QEMU from scratch
- How to Build ffmpeg with NDK r9
- How to Build ffmpeg with NDK r9
- How to Build ffmpeg with NDK r9
- how-to-build-ffmpeg-with-ndk-r9
- How to Build ffmpeg with NDK r9
- How to Build ffmpeg with NDK r9
- How to Build ffmpeg with NDK r9
- How to Build and Use libnetfilter_queue for Android
- How to build and debug android source code
- Build/Run Codec Engine Examples
- android mm and ndk-build
- 特殊回文数
- Android内置数据库sqlite执行insert,单引号报错问题的解决
- java method TestJava4_9 方法的参数与返回值
- 结构体字节对齐和位域对齐——VC、gcc
- js 对象 与 json之间的相互转化
- How to Build and Run Android NDK Examples?
- UIScrollView的delaysContentTouches与canCencelContentTouches属性
- MFC单文档应用程序问题
- POI颜色类型
- 一道算法题
- Android5.0的ApiDemo
- CLASS class DEFINITION { DEFERRED [PUBLIC]} | LOAD
- nginx虚拟主机+php修改open_basedir
- 回文数