~/talk

Best practices using JNI

Talkat Android Dev Summit 2018 · 2018-11-07..11-08· [android, c-and-cpp]
links:none on file
slides:none on file

Use C++ wrappers instead of raw JNI to make the single line that does work obvious, handling J strings as substrings and primitive arrays with operator[] rather than Get/Release calls. Android provides LibNativeHelper (AOSP header only) and recommends a printf‑style exception helper to avoid convoluted exception chaining. For deployment prefer one big SO, store it uncompressed and use ReLinker when supporting older releases. The presenter reports getting 90% of the benefit for 20% of the effort.

AI-written summary · about

  1. 0:00Introduction to JNI
  2. 0:17Problems with raw JNI code
  3. 0:43Improving JNI with C++
  4. 1:44Simplified exception handling
  5. 2:26Choosing helper libraries
  6. 2:59Code comparison and best practices
  7. 3:40Scalability and structure
  8. 4:24Advanced tips and conclusion
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.