├── droid-testapp
├── res
│ ├── drawable-hdpi
│ │ └── ic_launcher.png
│ ├── drawable-ldpi
│ │ └── ic_launcher.png
│ ├── drawable-mdpi
│ │ └── ic_launcher.png
│ ├── values
│ │ └── strings.xml
│ └── layout
│ │ └── main.xml
├── jni
│ ├── Application.mk
│ ├── SSLInit.h
│ ├── SSLInit.c
│ ├── Android.mk
│ ├── cmoss-tests.c
│ └── cmoss-tests.cpp
├── .classpath
├── project.properties
├── .settings
│ ├── org.eclipse.cdt.core.prefs
│ └── org.eclipse.cdt.codan.core.prefs
├── AndroidManifest.xml
├── src
│ └── org
│ │ └── cmoss
│ │ └── tests
│ │ └── TestLibsActivity.java
├── proguard.cfg
├── .project
└── .cproject
├── .gitignore
└── README
/droid-testapp/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mdsol/cmoss/develop/droid-testapp/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/droid-testapp/res/drawable-ldpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mdsol/cmoss/develop/droid-testapp/res/drawable-ldpi/ic_launcher.png
--------------------------------------------------------------------------------
/droid-testapp/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mdsol/cmoss/develop/droid-testapp/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/droid-testapp/jni/Application.mk:
--------------------------------------------------------------------------------
1 | APP_PROJECT_PATH := $(call my-dir)/..
2 | APP_STL := gnustl_static
3 | APP_MODULES := cmoss-tests
4 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | .gitignore.*
3 | .DS_Store
4 | *.bak
5 | *.old
6 |
7 | bin/
8 | tmp/
9 | tmp.*/
10 | log/
11 |
12 | droid-testapp/bin
13 | droid-testapp/gen
14 | droid-testapp/libs
15 | droid-testapp/obj
16 |
17 |
--------------------------------------------------------------------------------
/droid-testapp/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/droid-testapp/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Testing cURL...
5 | Testing expat...
6 | Testing yajl...
7 | Testing soci/sqlcipher...
8 |
9 | CMOSS - Tests
10 |
11 |
--------------------------------------------------------------------------------
/droid-testapp/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system use,
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 |
10 | # Project target.
11 | target=android-14
12 |
--------------------------------------------------------------------------------
/droid-testapp/.settings/org.eclipse.cdt.core.prefs:
--------------------------------------------------------------------------------
1 | #Tue Mar 27 22:09:49 EDT 2012
2 | eclipse.preferences.version=1
3 | environment/project/com.android.toolchain.gcc.1014137256/PATH/delimiter=\:
4 | environment/project/com.android.toolchain.gcc.1014137256/PATH/operation=replace
5 | environment/project/com.android.toolchain.gcc.1014137256/PATH/value=${NDK_PATH}\:${NDK_PATH}/platforms/android-14/arch-arm/usr/include\:/usr/bin\:/bin\:/usr/sbin\:/sbin
6 | environment/project/com.android.toolchain.gcc.1014137256/append=true
7 | environment/project/com.android.toolchain.gcc.1014137256/appendContributed=true
8 |
--------------------------------------------------------------------------------
/droid-testapp/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
14 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/droid-testapp/src/org/cmoss/tests/TestLibsActivity.java:
--------------------------------------------------------------------------------
1 | package org.cmoss.tests;
2 |
3 | import android.app.Activity;
4 | import android.os.Bundle;
5 | import android.widget.TextView;
6 |
7 | public class TestLibsActivity extends Activity
8 | {
9 | static
10 | {
11 | System.loadLibrary("log");
12 | System.loadLibrary("cmoss-tests");
13 | }
14 |
15 | private TextView tv1;
16 |
17 | @Override
18 | public void onCreate(Bundle savedInstanceState)
19 | {
20 | super.onCreate(savedInstanceState);
21 | super.setContentView(R.layout.main);
22 |
23 | initialize(this.getCacheDir().getAbsolutePath() + "/certs");
24 |
25 | this.tv1 = (TextView) findViewById(R.id.text1);
26 | }
27 |
28 | @Override
29 | public void onStart()
30 | {
31 | super.onStart();
32 |
33 | String result = curlTest();
34 | tv1.setText(result);
35 | }
36 |
37 | @Override
38 | public void onDestroy()
39 | {
40 | super.onDestroy();
41 | shutdown();
42 | }
43 |
44 | public native void initialize(String path);
45 | public native void shutdown();
46 |
47 | public native String curlTest();
48 | }
49 |
--------------------------------------------------------------------------------
/droid-testapp/res/layout/main.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
18 |
19 |
24 |
25 |
30 |
31 |
36 |
37 |
--------------------------------------------------------------------------------
/droid-testapp/proguard.cfg:
--------------------------------------------------------------------------------
1 | -optimizationpasses 5
2 | -dontusemixedcaseclassnames
3 | -dontskipnonpubliclibraryclasses
4 | -dontpreverify
5 | -verbose
6 | -optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
7 |
8 | -keep public class * extends android.app.Activity
9 | -keep public class * extends android.app.Application
10 | -keep public class * extends android.app.Service
11 | -keep public class * extends android.content.BroadcastReceiver
12 | -keep public class * extends android.content.ContentProvider
13 | -keep public class * extends android.app.backup.BackupAgentHelper
14 | -keep public class * extends android.preference.Preference
15 | -keep public class com.android.vending.licensing.ILicensingService
16 |
17 | -keepclasseswithmembernames class * {
18 | native ;
19 | }
20 |
21 | -keepclasseswithmembers class * {
22 | public (android.content.Context, android.util.AttributeSet);
23 | }
24 |
25 | -keepclasseswithmembers class * {
26 | public (android.content.Context, android.util.AttributeSet, int);
27 | }
28 |
29 | -keepclassmembers class * extends android.app.Activity {
30 | public void *(android.view.View);
31 | }
32 |
33 | -keepclassmembers enum * {
34 | public static **[] values();
35 | public static ** valueOf(java.lang.String);
36 | }
37 |
38 | -keep class * implements android.os.Parcelable {
39 | public static final android.os.Parcelable$Creator *;
40 | }
41 |
--------------------------------------------------------------------------------
/droid-testapp/jni/SSLInit.h:
--------------------------------------------------------------------------------
1 | // The MIT License
2 | //
3 | // Copyright (c) 2011 Mevan Samaratunga
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in
13 | // all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | // THE SOFTWARE.
22 | //
23 | // SSLInit.h : OpenSSL initialization.
24 | //
25 |
26 | #ifndef SSL_INIT_H_
27 | #define SSL_INIT_H_
28 |
29 |
30 | #ifdef __cplusplus
31 | extern "C" {
32 | #endif
33 |
34 | void init_locks();
35 | void kill_locks();
36 |
37 | #ifdef __cplusplus
38 | } /* closing brace for extern "C" */
39 | #endif
40 |
41 |
42 | #endif /* SSL_INIT_H_ */
43 |
--------------------------------------------------------------------------------
/droid-testapp/jni/SSLInit.c:
--------------------------------------------------------------------------------
1 | // The MIT License
2 | //
3 | // Copyright (c) 2011 Mevan Samaratunga
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in
13 | // all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | // THE SOFTWARE.
22 | //
23 | // SSLInit.h : OpenSSL initialization, such as setting up call backs for thread
24 | // safety of GCrypt libraries. See:
25 | //
26 | // OpenSSL docs for this:
27 | // http://www.openssl.org/docs/crypto/threads.html
28 | // gcrypt docs for this:
29 | // http://gnupg.org/documentation/manuals/gcrypt/Multi_002dThreading.html
30 | //
31 |
32 | #include "SSLInit.h"
33 |
34 | #include
35 | #include
36 |
37 | /* we have this global to let the callback get easy access to it */
38 | static pthread_mutex_t *lockarray;
39 |
40 | static void lock_callback(int mode, int type, char* file, int line) {
41 |
42 | (void) file;
43 | (void) line;
44 |
45 | if (mode & CRYPTO_LOCK) {
46 | pthread_mutex_lock(&(lockarray[type]));
47 | }
48 | else {
49 | pthread_mutex_unlock(&(lockarray[type]));
50 | }
51 | }
52 |
53 | static unsigned long thread_id()
54 | {
55 | return (unsigned long) pthread_self();
56 | }
57 |
58 | void init_locks()
59 | {
60 | lockarray = (pthread_mutex_t *) OPENSSL_malloc(CRYPTO_num_locks() * sizeof(pthread_mutex_t));
61 |
62 | int i;
63 | for (i = 0; i < CRYPTO_num_locks(); i++) {
64 | pthread_mutex_init(&(lockarray[i]), NULL);
65 | }
66 |
67 | CRYPTO_set_id_callback((unsigned long (*)()) thread_id);
68 | CRYPTO_set_locking_callback((void (*)()) lock_callback);
69 | }
70 |
71 | void kill_locks()
72 | {
73 | CRYPTO_set_locking_callback(NULL);
74 |
75 | int i;
76 | for (i = 0; i < CRYPTO_num_locks(); i++)
77 | pthread_mutex_destroy(&(lockarray[i]));
78 |
79 | OPENSSL_free(lockarray);
80 | }
81 |
--------------------------------------------------------------------------------
/droid-testapp/jni/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | include $(CLEAR_VARS)
4 |
5 | LOCAL_MODULE := minizip
6 | LOCAL_SRC_FILES := ../../bin/droid/lib/armv7/libminizip.a
7 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../bin/droid/include
8 |
9 | include $(PREBUILT_STATIC_LIBRARY)
10 |
11 | include $(CLEAR_VARS)
12 |
13 | LOCAL_MODULE := crypto
14 | LOCAL_SRC_FILES := ../../bin/droid/lib/armv7/libcrypto.a
15 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../bin/droid/include
16 |
17 | include $(PREBUILT_STATIC_LIBRARY)
18 |
19 | include $(CLEAR_VARS)
20 |
21 | LOCAL_MODULE := ssl
22 | LOCAL_SRC_FILES := ../../bin/droid/lib/armv7/libssl.a
23 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../bin/droid/include
24 |
25 | include $(PREBUILT_STATIC_LIBRARY)
26 |
27 | include $(CLEAR_VARS)
28 |
29 | LOCAL_MODULE := curl
30 | LOCAL_SRC_FILES := ../../bin/droid/lib/armv7/libcurl.a
31 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../bin/droid/include
32 |
33 | include $(PREBUILT_STATIC_LIBRARY)
34 |
35 | include $(CLEAR_VARS)
36 |
37 | LOCAL_MODULE := boost
38 | LOCAL_SRC_FILES := ../../bin/droid/lib/armv7/libboost.a
39 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../bin/droid/include
40 |
41 | include $(PREBUILT_STATIC_LIBRARY)
42 |
43 | include $(CLEAR_VARS)
44 |
45 | LOCAL_MODULE := pion-common
46 | LOCAL_SRC_FILES := ../../bin/droid/lib/armv7/libpion-common.a
47 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../bin/droid/include
48 |
49 | include $(PREBUILT_STATIC_LIBRARY)
50 |
51 | include $(CLEAR_VARS)
52 |
53 | LOCAL_MODULE := pion-net
54 | LOCAL_SRC_FILES := ../../bin/droid/lib/armv7/libpion-net.a
55 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../bin/droid/include
56 |
57 | include $(PREBUILT_STATIC_LIBRARY)
58 |
59 | include $(CLEAR_VARS)
60 |
61 | LOCAL_MODULE := cmoss-tests
62 | LOCAL_SRC_FILES := SSLInit.c cmoss-tests.cpp
63 | #LOCAL_SRC_FILES := cmoss-tests.c
64 |
65 | LOCAL_C_INCLUDES += ${NDK_ROOT}/platforms/android-14/arch-arm/usr/includes
66 | LOCAL_C_INCLUDES += ${NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/include
67 | LOCAL_C_INCLUDES += ${NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/include
68 | LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../bin/droid/include
69 | LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../bin/certs
70 | LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../../nadax/NadaxUtility/src/include
71 |
72 | LOCAL_CFLAGS += -DUNIX -DLOG_LEVEL_TRACE
73 | LOCAL_CPPFLAGS += -frtti -fexceptions
74 |
75 | LOCAL_LDFLAGS += ${NDK_ROOT}/platforms/android-14/arch-arm/usr/lib/crtbegin_so.o
76 | LOCAL_LDFLAGS += -Os -nostdlib -Wl,-rpath-link=${NDK_ROOT}/platforms/android-14/arch-arm/usr/lib
77 | LOCAL_LDLIBS += -lc -ldl -llog -lz
78 |
79 | #LOCAL_STATIC_LIBRARIES := curl ssl crypto minizip boost pion-common pion-net
80 | LOCAL_STATIC_LIBRARIES := curl ssl crypto minizip boost
81 |
82 | include $(BUILD_SHARED_LIBRARY)
83 |
--------------------------------------------------------------------------------
/droid-testapp/jni/cmoss-tests.c:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 | #include
5 |
6 | #include "log.h"
7 | #include "openssl_certs.h"
8 |
9 | #define BUFFER_SIZE 1024
10 |
11 |
12 | int curlDebugCallback(CURL* curl, curl_infotype infotype, char* text, size_t len, void* userdata) {
13 |
14 | TRACE("cURL: %s", text);
15 | return 0;
16 | }
17 |
18 | // **** JNI Implementations ****
19 |
20 | void Java_org_cmoss_tests_TestLibsActivity_initialize(JNIEnv* env, jobject thiz, jstring path) {
21 |
22 | const char* certPath = (*env)->GetStringUTFChars(env, path, 0);
23 | TRACE("Extracting certs to path '%s'...", certPath);
24 |
25 | int error = extractCerts(certPath);
26 | if (error) {
27 | TRACE("Error extracting certificates: %d", error);
28 | }
29 |
30 | curl_global_init(CURL_GLOBAL_ALL);
31 |
32 | TRACE("Done initializing CMOSS Tests.");
33 | }
34 |
35 | void Java_org_cmoss_tests_TestLibsActivity_shutdown(JNIEnv* env, jobject thiz) {
36 |
37 | curl_global_cleanup();
38 |
39 | TRACE("Done shutting down CMOSS Tests.");
40 | }
41 |
42 | jstring Java_org_cmoss_tests_TestLibsActivity_curlTest(JNIEnv* env, jobject thiz) {
43 |
44 | char result[BUFFER_SIZE];
45 | char error[CURL_ERROR_SIZE];
46 |
47 | CURL* curl = curl_easy_init();
48 | if (curl) {
49 |
50 | curl_easy_setopt(curl, CURLOPT_URL, "https://www.google.com");
51 | // curl_easy_setopt(curl, CURLOPT_PROXY, "http.proxy.fmr.com");
52 | // curl_easy_setopt(curl, CURLOPT_PROXYPORT, 8000L);
53 |
54 | curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, error);
55 | curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1L);
56 | curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, curlDebugCallback);
57 | curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
58 |
59 | #ifdef SKIP_PEER_VERIFICATION
60 | /*
61 | * If you want to connect to a site who isn't using a certificate that is
62 | * signed by one of the certs in the CA bundle you have, you can skip the
63 | * verification of the server's certificate. This makes the connection
64 | * A LOT LESS SECURE.
65 | *
66 | * If you have a CA cert for the server stored someplace else than in the
67 | * default bundle, then the CURLOPT_CAPATH option might come handy for
68 | * you.
69 | */
70 | curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
71 | #else
72 | curl_easy_setopt(curl, CURLOPT_CAPATH, __CACERTS_PATH);
73 | #endif
74 |
75 | #ifdef SKIP_HOSTNAME_VERFICATION
76 | /*
77 | * If the site you're connecting to uses a different host name that what
78 | * they have mentioned in their server certificate's commonName (or
79 | * subjectAltName) fields, libcurl will refuse to connect. You can skip
80 | * this check, but this will make the connection less secure.
81 | */
82 | curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
83 | #endif
84 |
85 |
86 | TRACE("Sending request...");
87 |
88 | CURLcode res = curl_easy_perform(curl);
89 | if (res) {
90 | snprintf(result, BUFFER_SIZE, "cURL HTTP returned error: %s", error);
91 | TRACE("cURL HTTP returned error: %s", result);
92 | } else {
93 | snprintf(result, BUFFER_SIZE, "cURL HTTP request succeeded");
94 | TRACE("cURL HTTP get succeeded.");
95 | }
96 |
97 | curl_easy_cleanup(curl);
98 |
99 | } else {
100 |
101 | snprintf(result, BUFFER_SIZE, "Error initializing cURL. A null handle was returned.");
102 | }
103 |
104 | return (*env)->NewStringUTF(env, result);
105 | }
106 |
--------------------------------------------------------------------------------
/README:
--------------------------------------------------------------------------------
1 | The CMOSS scripts can be used to build the following C/C++ Open Source Software libraries for native development on iOS and Android.
2 |
3 | * minizip : http://www.winimage.com/zLibDll/minizip.html
4 | * icu : http://site.icu-project.org/
5 | * c-ares : http://c-ares.haxx.se
6 | * bzip2 : http://bzip.org/
7 | * libidn : http://www.gnu.org/software/libidn/
8 | * GnuPG 1.4.x, Libgcrypt, Libgpg-error : http://www.gnupg.org/
9 | * OpenSSL - http://http://www.openssl.org/
10 | * libSSH2 - http://www.libssh2.org/
11 | * cURL - http://curl.haxx.se/ - C HTTP API
12 | * expat - http://expat.sourceforge.net/ - XML event parser
13 | * tinyxml - http://www.grinninglizard.com/tinyxml/ - XML DOM based parser
14 | * yajl - http://lloyd.github.com/yajl/ - JSON parser
15 | * sqlcipher - http://sqlcipher.net/ - SQLite with encryption
16 | * boost - http://www.boost.org/ - C++ utilities
17 | * soci - http://soci.sourceforge.net/ - generic C++ database API
18 | * pion : http://pion.org/ - C++ HTTP API
19 |
20 | The android kernel already provides some of these shared libraries so check if they are available before including them in your NDK project. For example both openssl and icu are part of the Android distribution.
21 |
22 | To build armv6 binaries for iOS you need to use the 5.1 SDK or lower. The blog at http://blog.chpwn.com/post/31824877081 provides instructions on how to add the 5.1 SDK alongside the 6.0 SDK if you are using XCode 4.5. The scripts will automatically pick up the older SDK for armv6 builds. If the 5.1 SDK is not available then armv6 binaries will not be built.
23 |
24 | The scripts will download the source code from the internet and build them locally. So your build machine needs to be connected to the internet when building. Once the source code archives have been downloaded they will be saved in the [cmoss root path]/tmp folder and will not be downloaded again unless you delete them or change the version. The builds have been tested with the versions hard-coded in the script files. If you change these versions it is possible the build for that library may break. If you do find a new version that breaks a build please let me know so it can be fixed.
25 |
26 | There is an issue with the icu builds with the SDK that ship with versions before XCode 4.5. This results in the Android builds having to be rerun when the icu host build fails, but it fails the entire icu build for iOS. If you are on an older version of XCode please comment out the icu build step.
27 |
28 | To run iOS build:
29 |
30 | cd [cmoss root path]/build-ios
31 | ./build-all.sh [installed sdk version #] [proxy_host:proxy_port]
32 |
33 | (scripts were tested with SDK 6.0)
34 |
35 | To run Android build:
36 |
37 | cd [cmoss root path]/build-droid
38 | ./build-all.sh [path to Android NDK] [proxy_host:proxy_port]
39 |
40 | (scripts were tested with Android NDK r8d)
41 |
42 | These build scripts were tested on a Mac OS X 10 with the following Mac ports:
43 |
44 | cmake @2.8.4_0 (active)
45 | cppunit @1.12.1_0 (active)
46 | dos2unix @5.1.1_0 (active)
47 | expat @2.0.1_1 (active)
48 | gettext @0.18.1.1_2 (active)
49 | gperf @3.0.4_0 (active)
50 | libiconv @1.13.1_0 (active)
51 | libidn @1.20_0 (active)
52 | ncurses @5.8_0
53 | ncurses @5.8_1 (active)
54 | ncursesw @5.8_0 (active)
55 | openssl @1.0.0d_0 (active)
56 | wget @1.12_3+ssl (active)
57 | libtool @2.4.2 (active)
58 | zlib @1.2.5_0 (active)
59 |
60 | The Android scripts should work in a Linux environment but have not been tested.
61 |
62 | The builds do not run the unit tests that come with the libraries on each platform. If you run into linker issues with the libraries you will need to tweak the builds. Please let me know of any issues when using the libraries and fixes that need to be addressed.
63 |
--------------------------------------------------------------------------------
/droid-testapp/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | droid-testapp
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.cdt.managedbuilder.core.genmakebuilder
10 | clean,full,incremental,
11 |
12 |
13 | ?children?
14 | ?name?=outputEntries\|?children?=?name?=entry\\\\\\\|\\\|\||
15 |
16 |
17 | ?name?
18 |
19 |
20 |
21 | org.eclipse.cdt.make.core.append_environment
22 | true
23 |
24 |
25 | org.eclipse.cdt.make.core.buildArguments
26 | NDK_DEBUG=1
27 |
28 |
29 | org.eclipse.cdt.make.core.buildCommand
30 | ndk-build
31 |
32 |
33 | org.eclipse.cdt.make.core.buildLocation
34 | ${workspace_loc:/droid-testapp}/jni
35 |
36 |
37 | org.eclipse.cdt.make.core.cleanBuildTarget
38 | clean
39 |
40 |
41 | org.eclipse.cdt.make.core.contents
42 | org.eclipse.cdt.make.core.activeConfigSettings
43 |
44 |
45 | org.eclipse.cdt.make.core.enableAutoBuild
46 | false
47 |
48 |
49 | org.eclipse.cdt.make.core.enableCleanBuild
50 | true
51 |
52 |
53 | org.eclipse.cdt.make.core.enableFullBuild
54 | true
55 |
56 |
57 | org.eclipse.cdt.make.core.fullBuildTarget
58 | V=1
59 |
60 |
61 | org.eclipse.cdt.make.core.stopOnError
62 | true
63 |
64 |
65 | org.eclipse.cdt.make.core.useDefaultBuildCmd
66 | false
67 |
68 |
69 |
70 |
71 |
72 | clean,full,incremental,
73 |
74 |
75 | ?name?
76 |
77 |
78 |
79 |
80 |
81 | com.android.ide.eclipse.adt.ResourceManagerBuilder
82 |
83 |
84 |
85 |
86 | com.android.ide.eclipse.adt.PreCompilerBuilder
87 |
88 |
89 |
90 |
91 | org.eclipse.jdt.core.javabuilder
92 |
93 |
94 |
95 |
96 | com.android.ide.eclipse.adt.ApkBuilder
97 |
98 |
99 |
100 |
101 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
102 | full,incremental,
103 |
104 |
105 |
106 |
107 |
108 | com.android.ide.eclipse.adt.AndroidNature
109 | org.eclipse.jdt.core.javanature
110 | org.eclipse.cdt.core.cnature
111 | org.eclipse.cdt.core.ccnature
112 | org.eclipse.cdt.managedbuilder.core.managedBuildNature
113 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
114 |
115 |
116 |
--------------------------------------------------------------------------------
/droid-testapp/jni/cmoss-tests.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2009 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | *
16 | */
17 |
18 | #include
19 |
20 | #include
21 | #include
22 | #include
23 |
24 | #include
25 | #include
26 | #include
27 | #include
28 | #include