This PR is the third and final piece of the basic Android support puzzle - it depends on #16110 and is related to #16883. It introduces an android directory under qt and a simple way to build an Android package of bitcoin-qt:
- Build depends for Android as described in the README
- Configure with one of the resulting prefixes
- Run
make && make apkinsrc/qt
The resulting APK files will be in android/build/outputs/apk. You can install them manually or with adb. One can also open the android directory in Android Studio for that integrated development and debugging experience. BitcoinQtActivity is your starting point.
Under the hood makefile apk target:
- Renames the
bitcoin-qtbinary tolibbitcoin-qt.soand copies it over to a folder underandroid/libsdepending on which prefix and corresponding ABIbitcoin-qtwas built for - Takes
libc++_shared.sofrom the Android NDK and puts in the same place. It must be included in the APK - Extracts Qt for Android Java support files from the
qtbasearchive independs/sourcestoandroid/src
There is also just a tiny bit of ifdef’d code to make the Qt Widgets menus usable. It’s not pretty but it works and is a stepping stone towards #16883.
Native menus (or Qt’s Android native implementation of QMenu) don’t support submenus. When you tap on any of the four options nothing happens.
That seems quite fast, no? And the phone’s not even warm…. This PR might make practical sense after all. :sunglasses: