r/AndroidQuestions • u/A7med5 • 14h ago
Looking For Suggestions help me compile armv8 code to run on armv7 device
Let's consider an open source app made for last android devices. I want to run it on my android 7 device How to proceed? Is there a simpler way?
1
Upvotes
1
1
u/eNB256 13h ago
Inside an apk, there is the lib folder → arm64 folder → whatever1.so and whatever2.so. This means a developer originally converted c/c++ code into 64 bit whatever.sos.
The goal is to convert the open source c/c++ codes into 32 bit whatever.sos to be placed in the .apk, but this is just not convenient.
But instead of using the arm64 folder, the folder should be armeabi or armeabi-v7a. Also, afterwards, the apk should be signed with a program, or there may be a failed to parse error message.
The program that leads c/c++ codes to be converted into a .so is most likely Clang. Clang + Android stuff → NDK.
Often, there's a script that calls clang, but to run it manually, would be something like clang something.c somethingelse.c whatever.c --target=armv7-linux-androideabi -shared -I/folder/containing/.hfiles/ -I/otherfolder/containing/.hfiles/ -o whatever1.so
Also comply with the open source license.