新增:实现testHello()),生成libcomclientjni.so,供APP调用。
This commit is contained in:
21
code/com_myjni_mynative_MyClientCmd.h
Normal file
21
code/com_myjni_mynative_MyClientCmd.h
Normal file
@ -0,0 +1,21 @@
|
||||
/* DO NOT EDIT THIS FILE - it is machine generated */
|
||||
#include "jni.h"
|
||||
/* Header for class com_myjni_mynative_MyClientCmd */
|
||||
|
||||
#ifndef _Included_com_myjni_mynative_MyClientCmd
|
||||
#define _Included_com_myjni_mynative_MyClientCmd
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
/*
|
||||
* Class: com_myjni_mynative_MyClientCmd
|
||||
* Method: testHello
|
||||
* Signature: ()V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_com_myjni_mynative_MyClientCmd_testHello
|
||||
(JNIEnv *, jobject);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
12
code/comclientjni.cpp
Normal file
12
code/comclientjni.cpp
Normal file
@ -0,0 +1,12 @@
|
||||
#include "com_myjni_mynative_MyClientCmd.h"
|
||||
#include <iostream>
|
||||
#include <stdio.h>
|
||||
#include <android/log.h>
|
||||
|
||||
#define LOG_TAG "MyClientCmd"
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_myjni_mynative_MyClientCmd_testHello(JNIEnv *, jobject)
|
||||
{
|
||||
printf("this is C++ print");
|
||||
__android_log_print(ANDROID_LOG_INFO, LOG_TAG, "this is C++ print");
|
||||
}
|
||||
Reference in New Issue
Block a user