Android Development Setup
Notes on how I set up an android development setup with minimal bloat. No IDE, no Gradle, and just using C and Makefiles.
Instructions are more or less similar to the ones found on this project: https://github.com/cnlohr/rawdrawandroid.
install packages. on arch linux
pacman -S extra/jre11-openjdk-headless
pacman -S extra/jdk11-openjdk
pacman -S android-tools
mkdir ~/android export ANDROID_HOME=~/android
Download command line tools from https://developer.android.com/studio.
Unzip contents to cmdline-tools/3.0
folder in ANDROID_HOME
.
(sdkmananger will give you path warnings. trying to fix as I go).
save some keystrokes
alias sdkman=$ANDROID_HOME/cmdline-tools/3.0/bin/sdkmanager --sdk_root='${ANDROID_HOME}'
Agree to licenses:
yes | sdkman --licenses
Install stuff. Note: I'm making sure build-tools and platform-tools are the same version (29). Otherwise the rawdrawandroid session gets messed up.
sdkman "build-tools;29.0.3" "ndk;21.1.6352462" "platform-tools" "platforms;android-29"
NOTE: I ran into issues running stuff on older models like the nexus 7, so I downgraded. In the command above, I installed "25.0.0" of build-tools, and used "android-23" of platforms. In my build settings, I set the minsdk to be 17 and the target sdk to be 23. Try the modern, but if you get something related to symbol not found "fread_unlock", downgrade.
Now try cloning rawdrawandroid
git clone https://github.com/cnlohr/rawdrawandroid --recurse-submodules
Try building it with
make
Plug in properly configured device with:
make push run
On Linux, sometimes permissions are a bit screwy. Figure out
the vendor id with dmesg, and put this in
something like /etc/udev/rules.d/
as something like
51-android.rules
, where VENDOR_ID is your vendor ID.
Unplug, and plug in again and it should work.
SUBSYSTEM=="usb", ATTR{idVendor}=="VENDOR_ID", MODE="0666"