Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
DO NOT REPEAT YOURSELF
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Marco Sero
March 13, 2015
Programming
0
430
DO NOT REPEAT YOURSELF
Leverage the power of C++ and Djinni to write native cross platform code on iOS and Android
Marco Sero
March 13, 2015
Tweet
Share
More Decks by Marco Sero
See All by Marco Sero
Working on a Legacy App
marcosero
3
3.4k
Event Detection
marcosero
1
1.6k
Other Decks in Programming
See All in Programming
AI主導でFastAPIのWebサービスを作るときに 人間が構造化すべき境界線
okajun35
0
600
atmaCup #23でAIコーディングを活用した話
ml_bear
4
750
コーディングルールの鮮度を保ちたい / keep-fresh-go-internal-conventions
handlename
0
170
grapheme_strrev関数が採択されました(あと雑感)
youkidearitai
PRO
1
210
AIとペアプロして処理時間を97%削減した話 #pyconshizu
kashewnuts
1
210
Go1.26 go fixをプロダクトに適用して困ったこと
kurakura0916
0
330
CSC307 Lecture 15
javiergs
PRO
0
220
RubyとGoでゼロから作る証券システム: 高信頼性が求められるシステムのコードの外側にある設計と運用のリアル
free_world21
0
220
Codex の「自走力」を高める
yorifuji
0
970
DSPy入門 Pythonで実現する自動プロンプト最適化 〜人手によるプロンプト調整からの卒業〜
seaturt1e
1
580
Railsの気持ちを考えながらコントローラとビューを整頓する/tidying-rails-controllers-and-views-as-rails-think
moro
4
380
Windows on Ryzen and I
seosoft
0
190
Featured
See All Featured
Accessibility Awareness
sabderemane
0
73
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
190
For a Future-Friendly Web
brad_frost
183
10k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
620
Skip the Path - Find Your Career Trail
mkilby
1
72
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
280
Building the Perfect Custom Keyboard
takai
2
710
Into the Great Unknown - MozCon
thekraken
40
2.3k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
60
42k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Technical Leadership for Architectural Decision Making
baasie
3
270
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
Transcript
DO NOT REPEAT YOURSELF
IOS AND ANDROID HAVE SOMETHING IN COMMON
C++
BUT USING IT... IT'S NOT GREAT
Objective-C++ on iOS JNI (Java Native Interface) on Android
UNTIL...
DJINNI BY
.djinni interface + C++ implementation Djinni JAVA AND OBJECTIVE-C INTERFACES
THE HACK
SHARED C++ IMAGE CACHE
DEFINE INTERFACE IN A .djinni FILE image_cache = interface +c
{ static create_with_path(path: string): image_cache; image_for_key(key: string): binary; save_image_for_key(key: string, image_data: binary); }
IMPLEMENT IT IN C++ shared_ptr<ImageCache> ImageCache::create_with_path(const std::string &path) { ...
} vector<uint8_t> ImageCache::image_for_key(const string &key) { ... } void ImageCache::save_image_for_key(const string &key, const vector<uint8_t> &image_data) { ... }
USE IT FROM OBJECTIVE-C id<YCCPImageCache> imageCache = [YCPPImageCacheCppProxy createWithPath:cachePath]; NSData
*imageData = [imageCache imageForKey:cacheKey]; [imageCache saveImageForKey:cacheKey imageData:imageData]; AND JAVA ImageCache imageCache = ImageCache.createWithPath(cachePath); byte[] imageBlob = this.imageCache.imageForKey(cacheKey); imageCache.saveImageForKey(cacheKey, imageBlob);
NEVER WRITE JNI AND OBJECTIVE-C++ AGAIN
SHARE NATIVE CODE BETWEEN PLATFORMS MORE EASILY
DO I RECOMMEND THIS?
NO AT LEAST FOR OUR APPS
THANK YOU.