5、cygwin工具,以及配置环境,以及检测方式, 可能到这里有同学就不明白,这里是一个模拟linux终端的工具,为了实现后面JNI的编译,所以我们要安装这个工具安装,这里大家可以看一下网上的教程,那么这里我们在安装过程中只安装The GNU of the 'make' utility这一条在前面打X就可以了.当我们配置完系统环境之后,通过命令提示符,输入make -version如果显示GNU Make x.xx.xxx就成功了。
=================================================
=================================================
Header.h
#ifndef HEADER_H_
#define HEADER_H_
int sum(int a, int b);
#endif /* HEADER_H_ */
===============================================================
# 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)
#========================
my_swig_generate.mk(文件信息)
include $(CLEAR_VARS)
LOCAL_MODULE := hello-jni
LOCAL_SRC_FILES := hello-jni.c Header.c
MY_SWIG_PACKAGE := com.apress.swig
MY_SWIG_INTERFACES := Unix.i
MY_SWIG_TYPE := c
include $(LOCAL_PATH)/my_swig_generate.mk
include $(BUILD_SHARED_LIBRARY)