Game Development Reference
In-Depth Information
Figure 2-9. External tools configurations (Refresh)
The file ch02_project_ProjectActivity.h is shown in Listing 2-2.
Listing 2-2. File ch02_project_ProjectActivity.h
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class ch02_project_ProjectActivity */
#ifndef _Included_ch02_project_ProjectActivity
#define _Included_ch02_project_ProjectActivity
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: ch02_project_ProjectActivity
* Method: getMyData
* Signature: ()Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_ch02_project_ProjectActivity_getMyData
(JNIEnv *, jobject);
#ifdef __cplusplus
}
#endif
#endif
Your last step will be to create the C file ch02.ccp and compile it.
Native Library
Here is where all the work takes place. The implementation is provided in ch02.ccp
(see Listing 2-3). This file lives in the jni folder within the project.
Note Native libraries in Linux (also known as shared objects) are the equivalents of dynamic link
libraries (DLLs) in Windows. By convention, shared objects are named as lib<NAME><VERSION>.so .
 
 
Search WWH ::




Custom Search