Skip to content

Latest commit

 

History

History

curl-ssl

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

curl-ssl

This sample shows how to import curl and OpenSSL from Google Maven to display a list of the most recent 10 reviews submitted to AOSP's code review system.

One of the goals is demonstrate how to handle HTTPS certificates correctly as explained by this Stack Overflow post: the root certificates presented by Android since ICS are not in the format OpenSSL expects, so we need to provide our own certificate file. We do this by downloading curl's cacert.pem and storing that in our assets directory, as described in this Stack Overflow post.

If you want to understand how to use C/C++ dependencies with AGP, refer to:

Pre-requisites

Getting Started

The C++ code in this sample can be built with either CMake (the default for this project) or ndk-build. To use ndk-build set the ndkBuild project property either in your local.properties file or on the command line by passing the -PndkBuild flag when building.

To build with Android Studio:

  1. Open this project in Android Studio.
  2. Click Run/Run 'app'. If you want to debug/trace code, due to the SSL lib's known issue with lldb, make sure to apply the recommendations there for a smooth debugging experience.

To build from the command line:

  1. Navigate to this directory in your terminal.
  2. Run ./gradlew installDebug (or gradlew.bat installDebug on Windows).

Screenshots

screenshot

Support

If you've found an error in these samples, please file an issue.

Patches are encouraged, and may be submitted by submitting a pull request through GitHub. Please see CONTRIBUTING.md for more details.