@ -39,3 +39,51 @@ V has a OnePlus 6T Android phone with the following specifications (from [[https
| Android Version | 10 |
The two main specs I need to care about are Android Version and Display Resolution. Additionally, AMOLED hints that pure black is going to look nice.
See [[file:Dependencies/gamelib/Dependencies/SDL/docs/README-android.md][SDL's README-android.md]] for instructions I followed for setting up Android. You need to download Android Studio. (You could get away with only the SDK and build tools, but you'll probably want the debugger when things don't work out of the box anyways.)
*** Known working version(s)
My local build was tested the following software versions:
| Component | Version |
| Android | 10 |
| SDK Build-Tools | 29.03, 28.03¹ |
| NDK | 21.4.7075529² |
¹= I'm not actually sure which SDK version is being used, because I didn't explicitly specify one.
²= I had to downgrade from version 22 due to ~platforms~ folder missing. See below section.
*** Fix ~SDL_main()~ not found in ~libmain.so~ error
- Ensure you have ~main()~ defined *with* its full signature: ~int main(int numArgs, char* args)~
- Note that SDL defines ~main()~ as a macro to be ~SDL_main()~, which is a bit confusing, but works okay as long as you have the full signature
*** Fix no ~platforms~ folder in NDK
I had to downgrade from version 22 due to ~platforms~ folder missing. To do so:
- Open Android Studio
- ~Tools -> SDK Manager~
- Switch to tab ~SDK Tools~
- Check ~Show Package Details~
- Expand the NDK tree and check ~21.4.7075529~, then click OK
*** Building from the command line
Follow the [[file:Dependencies/gamelib/Dependencies/SDL/docs/README-android.md][SDL README-android.md]] for using ~androidbuild.sh~, which is how I got the first version going. For reference, here is the command sequence: