Upload
dgmit2009
View
109
Download
5
Embed Size (px)
DESCRIPTION
1. Android NDK란? 2. Android 개발환경 구축하기 3. How to make Header Flie?
Citation preview
Android NDK
( Native Development Kit )
2014. 10. 28
Version : 1.0.0
made by 최대우R&D 1Team
2
CONTENTS.
1. Android NDK란 ? ……………… 3
2. Android NDK개발환경 구축하기 ……………… 4
2.1) Let’s install Android NDK ……………… 4
2.2) Set Environment for Android NDK …………… 6
3. How to make Header File? …………….. 9
3.1) Let’s learn from Build Example Project ..... 10
3
1. Android NDK란 ?What is Android NDK?
Why using Android NDK?
- Reuse- Access on Device- Performance
4
2. Android NDK개발환경 구축하기2.1) Let’s install Android NDK
1. Downloads Android NDK- http://developer.android.com/tools/sdk/ndk
5
2. Android NDK개발환경 구축하기
3. Then, “cmd“ is coming out and run Install !
2. Just Start this exe File !
2.1) Let’s install Android NDK
6
2. Android NDK개발환경 구축하기
1. Window → Preferences
Open Preferences
2. Android → NDK NDK Location:Set the Path which your“ndk“ file is exist.
2.2) Set Environment for Android NDK
7
2. Android NDK개발환경 구축하기
3. Run-> External Tools ->External Tools Configurations
2.2) Set Environment for Android NDK
4. Location:
Click Browse File System
and
Set Path which your javah.exe
8
2. Android NDK개발환경 구축하기2.2) Set Environment for Android NDK
9
3. How to make Header File?
1. Make Example Project for Explain Make Header File
3.1) Let’s learn from Build Example Project
2. Right Mouse Click on Project andAndroid Tools -> Add Native Support
3. Write Your Library(.so) Name You Want!
10
3. How to make Header File?
5. Make New Class in “src” folder for JNI
3.1) Let’s learn from Build Example Project
4. You Can See “jni” Folder is Created.
11
3. How to make Header File?3.1) Let’s learn from Build Example Project
6. Working Directory: Click Browse Workspace and Select Your Project
7. Arguments: Write this!-d ${workspace_loc:/프로젝트명/jni} -classpath ${workspace_loc:/프로젝트명/src} NDK 개발 클래스 패키지 풀네임
12
3. How to make Header File?3.1) Let’s learn from Build Example Project
8. Go to Refresh tap and Check “Refresh resources upon completion”.Check the Radio Button of “Specific resources”, and Click “Specify Resources”
9. Check Your Project and Click “Finish” Button.
13
3. How to make Header File?
10. If you done successfully, Your console will send message to you.
3.1) Let’s learn from Build Example Project
11. Header file is created in your “jni” folder.
14
3. How to make Header File?
12. In your header file, define some method which you wanna use.
3.1) Let’s learn from Build Example Project
JNIEXPORT return타입 JNICALL JAVA_패키지풀네임_메소드명
15
3. How to make Header File?
13. In your .cpp file, define your method’s operate
3.1) Let’s learn from Build Example Project
14. In your “Library”.java file,LoadLibrary your .cpp in static{},
and
define method with “native returnTypewhich you want use.
16
3. How to make Header File?
15. I added two button for test call JNI,
For use method in librarymake object typeof library Classand call object.method();
3.1) Let’s learn from Build Example Project
17
3. How to make Header File?
16.When Click each button,Native Method is Called Successfully !
3.1) Let’s learn from Build Example Project
18