Hello,

I'm currently experimenting Android development with CMake without using gradle, Android Studio, ant or anything else.

The idea is to use Android's sdk-tools only (aapt, dx, zipalign, apksigner).

The process isn't that hard but consists of several steps. The only real question is how should an hypothetical CPackAPK would build the application because the user has to write some java code and AndroidManifest file.

In a nutshell the process of building an apk consist of:

1. aapt package -f -m -J <input> -M AndroidManifest.xml -S <output> -I android.jar
2. javac *.java and output to obj
3. dx --dex --output=classes.dex obj
4. aapt package -f -m -F app.unaligned.apk -M AndroidManifest.xml -S <output> -I android.jar
5. apksigner sign --ks debug.keystore --ks-pass "blabla"
6. zipalign -f 4 app.unaligned.apk app.apk

So basically, the 1, 3, 4, 5, 6 steps are quite “easy” to implement in a CPackAPK module but I need to dig how the step 2 should be handled by that module. Also, we need to incorporate all .so required into the output directory as well (this could be done with a simple variable I think).

Any opinions are welcome,

Some sources which helped me:

https://medium.com/@authmane512/how-to-do-android-development-faster-without-gradle-9046b8c1cf68
https://stackoverflow.com/questions/41132753/how-can-i-build-an-android-apk-without-gradle-on-the-command-line

Regards

--
David
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

Reply via email to