metalx1000

Android C compile to APK Notes

Jul 10th, 2020
1,933
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #Android C compile Notes
  2.  
  3. #install needed files
  4. sudo apt install android-sdk adb build-essential git unzip google-android-platform-24-installer openjdk-11-jdk-headless
  5.  
  6. #also could be downloaded from:
  7. #wget -c https://dl.google.com/android/repository/platform-24_r02.zip
  8.  
  9. #Might get a smaller sdk with this, but I have not tested it:
  10. #https://dl.google.com/android/repository/commandlinetools-linux-6200805_latest.zip
  11.  
  12. #get Google Android ndk
  13. #if in repose
  14. sudo apt install google-android-ndk-installer
  15.  
  16. ###if not download it###
  17. wget -c https://dl.google.com/android/repository/android-ndk-r21b-linux-x86_64.zip
  18. unzip
  19. ########################
  20.  
  21. #set paths
  22. #if you manually installed sdk and ndk then they might be in a different location
  23. export NDK=/usr/lib/android-ndk
  24. export ANDROID_HOME=/usr/lib/android-sdk
  25. export SDK_LOCATIONS=/usr/lib/android-sdk
  26. #CHANGE "android-23" to your version
  27. PATH=/usr/lib/android-sdk/platforms/android-23:$PATH
  28.  
  29. #get example code
  30. git clone https://github.com/cnlohr/rawdrawandroid --recurse-submodules
  31.  
  32. #compile, push to device, and run
  33. make keystore
  34. make push run
RAW Paste Data