Add Android examples
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12866 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
084425335f
commit
6d40bb0db8
30 changed files with 826 additions and 0 deletions
9
Examples/android/simple/jni/Android.mk
Normal file
9
Examples/android/simple/jni/Android.mk
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
# File: Android.mk
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := example
|
||||
LOCAL_SRC_FILES := example_wrap.c example.c
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
17
Examples/android/simple/jni/example.c
Normal file
17
Examples/android/simple/jni/example.c
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
/* File : example.c */
|
||||
|
||||
/* A global variable */
|
||||
double Foo = 3.0;
|
||||
|
||||
/* Compute the greatest common divisor of positive integers */
|
||||
int gcd(int x, int y) {
|
||||
int g;
|
||||
g = y;
|
||||
while (x > 0) {
|
||||
g = x;
|
||||
x = y % x;
|
||||
y = g;
|
||||
}
|
||||
return g;
|
||||
}
|
||||
|
||||
7
Examples/android/simple/jni/example.i
Normal file
7
Examples/android/simple/jni/example.i
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
/* File : example.i */
|
||||
%module example
|
||||
|
||||
%inline %{
|
||||
extern int gcd(int x, int y);
|
||||
extern double Foo;
|
||||
%}
|
||||
Loading…
Add table
Add a link
Reference in a new issue