Skip to content
\n

This will include the KFR project to get built with your app. You may come across some errors building. I had to disable some features within the KFR CmakLists.txt file. Specifically i removed everything related to kfr_io Here is a link to my modified repo. It probably isn't the best way to do this but it gets a working KFR build for android.

\n

I am no good at CMake, but i suspect there is a way to detect it is being cross complied for android and disable these features. Or maybe they can be modified to work.
\nSomeone that is better at CMake and more familiar with the KFR please feel free to advise on doing this properly. Would be nice to get a proper solution documented. Let me know if you have any questions.

","upvoteCount":1,"url":"https://github.com/kfrlib/kfr/discussions/211#discussioncomment-8347699"}}}

How to build in Android? #211

Answered by beezow
fisher111777 asked this question in General
Discussion options

You must be logged in to vote

Follow the android documentation to build a native library, be sure to choose a CMake based build as it will be easier to include (i think). You will have to setup your own C linkage if you want to call KFR functions directly from Java. I'd suggest doing the bulk of the work in C/C++. Clone the KFR repository into the src/main/cpp directory. Within the src/main/cpp/CmakeLists.txt add in

## Include KFR subdirectory
add_subdirectory(kfr)
## replace native-lib with your library name.
target_link_libraries(native-lib kfr)

This will include the KFR project to get built with your app. You may come across some errors building. I had to disable some features within the KFR CmakLists.txt file. Sp…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by dancazarin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #115 on February 02, 2024 15:16.