-
Notifications
You must be signed in to change notification settings - Fork 3
/
README.android
97 lines (80 loc) · 3.58 KB
/
README.android
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
jn
-------------------------------------------
Platform specific problem
-------------------------------------------
none.
-------------------------------------------
Make & Install
-------------------------------------------
= Brief description =
Java-M3G consits of 2 components.
- java-m3g.jar is a Java library
- libjava-m3g.so is a native library of java-m3g.jar
You need these 2 components and (of course) Desktop-M3G library(libm3g.so).
Finally you need 3 components (java-m3g.jar, libjava-m3g.so and libm3g.so) in your project.
Binary package of Java-M3G contains all of them.
= libm3g.so =
You need Desktop-M3G (libm3g.so) before compiling Java-M3G.
See http://code.google.com/p/desktop-m3g/
1. compile libm3g.so
- see README of Desktop-M3G
2. Copy *.hpp and libm3g.so to the following directory.
- ${Java-M3G}/jni/src/external/include
- ${Java-M3G}/jni/src/external/lib/android (for Android)
= libjava-m3g.so =
Compile C++ native libary first.
Ndk-build comes from Android-NDK.
See http://developer.android.com/sdk/ndk/index.html
1. cd ${Java-M3G}/build/android/Java-M3G
2. ndk-build
- which will generate libjava-m3g.so
= java-m3g.jar =
You need Eclipse for compiling java-m3g.jar.
1. import all projects from ${Java-M3G}/build/android
- which contains Java-M3G project and 12 samples.
2. open (or double click) java-m3g.jardesc at java-M3G project
- which export java-m3g.jar into the following directory.
- ${Java-M3G}/bin/java-m3g.jar
3. copy java-m3g.jar, libjava-m3g.so and libm3g.so to your project.
-------------------------------------------
How to use Java-M3G
-------------------------------------------
= Copy Java-M3G =
You need to copy 3 components (java-m3g.jar, libjava-m3g.so and libm3g.so) to your project.
You can find them in binary package or if you compiled it from source,
- ${Java-M3G}/Java-M3G/bin/java-m3g.jar
- ${Java-M3G}/jni/bin/lib/linux/libjava-m3g.so
- ${Java-M3G}/jni/bin/lib/linux/libm3g.so
Copy to
- ${YourProject}/${YourFavorite}/java-m3g.jar
- ${YourProject}/libs/armeabi/libjava-m3g.so
- ${YourProject}/libs/armeabi/libm3g.so
Native libary location MUST be "libs/armeabi" in Android.
As far as I know, you can't change this location.
(If you know a way, please tell me how to do it)
= Setup Java-M3G =
Open your project in Eclipse.
- [Properties] --> [Java Build Path] --> [Libraries] --> [Add External JARs...]
set jar files to
- ${YourProject}/${YourFavorite}/java-m3g.jar
and set native library location to
- ${YourProject}/libs/armeabi
Indeed, Android SDK ignore this native library location settings and search fixed place (libs/armeabi).
But it is a good practice to set location explicitely.
-------------------------------------------
Trobule shooting
-------------------------------------------
= I see error! =
Sometimes you see the following errors when openning Java-M3G project by Eclipse.
TODO: copy error message.
I'm not sure what they are, but [project] -> [clean] -> [Clean all projects] and build all will help you very much.
Or close all projects and re-open them will also help you.
Believe me!
-------------------------------------------
Test & Samples
-------------------------------------------
= UnitTest =
Sorry, There are no unit tests under Android OS.
I know it is a big problem.
= Samples =
There are 12 samples.