Either
Proof of concept for implementing an Either type for Djinni
Install / Use
/learn @Wattpad/EitherREADME
Either and Djinni
This is a proof of concept demonstrating the use of an Either type in cross-platform code for Android and iOS using Djinni.
Requirements
To build for Android and iOS, the following are recommended:
Generating Sources from Djinni
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.
Configuring the Android Project
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
What to Expect
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.
Related Skills
node-connect
345.9kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
106.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
345.9kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
345.9kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
