Skip to content

Commit cab35f9

Browse files
committed
Add minimal example
1 parent 96b7a38 commit cab35f9

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

README.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,24 @@ Compile openssl and curl for Android
66

77
Make sure you have `Android NDK` installed.
88

9-
And also necessary `autoconf` and `libtool` toolchains.
9+
You may also need to install `autoconf` and `libtool` toolchains.
1010

1111
## Download
1212

1313
If you do not want to compile them yourself, you can download pre-compiled static libraries from [releases](https://github.com/robertying/openssl-curl-android/releases). They are in `build.tar.gz`.
1414

1515
Doing your own compilation is recommended, since the pre-compiled binary can become outdated soon.
1616

17-
Update git submodules to compile newer versions of the libraries.
17+
Checkout newer versions in git submodules to compile newer versions of the libraries.
1818

1919
## Usage
2020

2121
```bash
2222
git clone https://github.com/robertying/openssl-curl-android.git
2323
git submodule update --init --recursive
2424

25-
export ANDROID_NDK_HOME=your_android_ndk_bundle_root_here
26-
export HOST_TAG=see_this_table_for_info # https://developer.android.com/ndk/guides/other_build_systems#overview
25+
export ANDROID_NDK_HOME=your_android_ndk_root_here # e.g. $HOME/Library/Android/sdk/ndk/21.0.6113669
26+
export HOST_TAG=see_this_table_for_info # e.g. darwin-x86_64, see https://developer.android.com/ndk/guides/other_build_systems#overview
2727
export MIN_SDK_VERSION=21 # or any version you want
2828

2929
chmod +x ./build.sh
@@ -43,14 +43,16 @@ include $(PREBUILT_STATIC_LIBRARY)
4343

4444
## Options
4545

46-
Change scripts' configure arguments to meet your requirements.
46+
Change scripts' configure arguments to meet your own needs.
4747

48-
For now, using tls (https) in Android would throw `peer verification failed`.
48+
For now, using TLS (https) in Android would throw `peer verification failed`.
4949

50-
Please explicitly set `curl_easy_setopt(curl, CURLOPT_CAINFO, CA_BUNDLE_PATH);` where `CA_BUNDLE_PATH` is your ca-bundle in the devide storage.
50+
Please explicitly set `curl_easy_setopt(curl, CURLOPT_CAINFO, CA_BUNDLE_PATH);` where `CA_BUNDLE_PATH` is your ca bundle path in the device storage.
5151

52-
You can download and copy [cacert.pem](https://curl.haxx.se/docs/caextract.html) to the internal storage to get tls working for libcurl.
52+
You can download and copy [cacert.pem](https://curl.haxx.se/docs/caextract.html) to Android assets or the device internal storage to get TLS working for libcurl.
5353

54-
## Working Example
54+
## Working Examples
5555

56-
Checkout this [repo](https://github.com/robertying/CampusNet-Android/blob/master/app/src/main/cpp/jni) to see how to integrate compiled static libraries into an existing Android project, including `Android.mk` setup and `JNI` configurations.
56+
- See this minimal example which calls `curl` from Android app, using `JNI` to use `libcurl`: [AndroidCurlExample](https://github.com/robertying/AndroidCurlExample). It includes `Android.mk` setup and `JNI` configurations.
57+
58+
- Checkout this more complex [repo](https://github.com/robertying/CampusNet-Android/blob/master/app/src/main/cpp/jni) to see how to integrate other compiled static libraries into an existing Android project, including `Android.mk` setup and `JNI` configurations.

0 commit comments

Comments
 (0)