This is a proof of concept demonstrating the use of an Either type in cross-platform code for Android and iOS using Djinni.
To build for Android and iOS, the following are recommended:
Before you can build the Android and iOS projects, you need to run
git submodule init
and git submodule update
in the root directory, then
run make all
in the Either
directory.
If you don't want to download all of Boost pre-compiled for iOS, you can just
grab the subdirectory ofxiOSBoost/libs/boost/include/boost/optional
for the
ofxiOSBoost submodule.
Before you can build the Android project, you will need to add ndk.dir to your local.properties file. Here is mine exactly as it appears, for reference:
## This file is automatically generated by Android Studio.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file should *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
sdk.dir=/Users/tony/Library/Android/sdk
ndk.dir=/Users/tony/Library/Android/ndk
The Android and iOS apps don't do anything visible, but you can set a breakpoint
in MainActivity.onCreate
(Android) and ViewController -viewDidLoad
(iOS) to
see the result of calling into a common C++ component using Djinni and getting
back an Either result type.