DEMO下载链接: http://download.csdn.net/detail/logicsboy/7535409
首先给你们恶补下啥是NDK:(我从百度Copy的)
保存之后,去找你的.class文件吧、
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class com_misoo_pk01_helloNDK */
#ifndef _Included_com_misoo_pk01_helloNDK
#define _Included_com_misoo_pk01_helloNDK
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: com_misoo_pk01_helloNDK
* Method: sayHello
* Signature: ()Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_com_misoo_pk01_helloNDK_sayHello
(JNIEnv *, jobject);
#ifdef __cplusplus
}
#endif
#endif
不关我们的事。
/* DO NOT EDIT THIS FILE - it is machine generated */
#include "com_misoo_pk01_helloNDK.h"
JNIEXPORT jstring JNICALL
Java_com_misoo_pk01_helloNDK_sayHello
(JNIEnv *env, jobject thiz){
return (*env)->NewStringUTF(env,"Hello,NDK....");
}
# Copyright (C) 2009 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := helloNDK LOCAL_SRC_FILES := com_misoo_pk01_helloNDK.c include $(BUILD_SHARED_LIBRARY)
版权声明:本文博主原创文章,博客,未经同意不得转载。
原文:http://www.cnblogs.com/bhlsheji/p/4851377.html