If you have a a main.cpp file, it can look something like this. Navigate to DemolitionCrew->app->jni->src in the tree view I guess there is a better way to do this but I was desperate. ~/development/android/DemolitionCrew/app/jni/srcĪlso place all the header files for SDL including SDL_mixer.h, SDL_image.h, SDL_ttf.h and SDL_net.h In this folder i place all my C++ and C code ~/development/android/DemolitionCrew/app/src/main/assetsĪssets are stuff like all your game graphics, sound, music and levels. Now you can minimize the Android studio window and in finder the folder option is the one with a android figure on) Right click on “DemolitionCrew->app->src->main” NOTE! It is easy to accidentally choose the wrong src-folder. Here you will see “java”, “res” and “ AndroidManifest.xml” NOTE! On line 18 you need to increase the versionCode for each build youĬhange line 14 from LOCAL_SHARED_LIBRARIES := SDL2Ĭhange line 12 from: LOCAL_SRC_FILES := YourSourceHere.c Make sure line 22 says: arguments “APP_PLATFORM=android-16”Ĭhange the ApplicationId on line 14 to this: applicationId “” Make sure line 16 says : minSdkVersion 16 The android:versionCode=“1” Not sure if this needs to be increased for each release on the google play store, but increase it anyways.Ĭhange this to required true if you want touch screen to work on all smart phones.Īdd these lines under the other permission lines if you wish SDL_net to access your local net and the internet In the almost top left corner you can alter the view between “Android” and “Project”Ĭhange to “Project” if it is not already choosen.Įxpand the tree view DemolitionCrew->app->src->mainĬhange the package=“” on line 6 to package=“” (Or what your company and app name is) Navigate to “~/development/android” and select your project. Ln -s ~/development/android/sdl2_ttf ~/development/android/DemolitionCrew/app/jni/SDL_ttfĭuring the installation MacOS complains over some components that are not compatible with future MacOS versions.Ĭlick on “Open an existing Android Studio Project” Ln -s ~/development/android/sdl2_net ~/development/android/DemolitionCrew/app/jni/SDL_net Ln -s ~/development/android/sdl2_mixer ~/development/android/DemolitionCrew/app/jni/SDL_mixer Ln -s ~/development/android/sdl2_image ~/development/android/DemolitionCrew/app/jni/SDL_image ln -s ~/development/android/sdl2 ~/development/android/DemolitionCrew/app/jni/SDL You have named your project folder in beforehand. Rename the folder “android-project” to what you want your project to be called.Ĭreate these links so they will appear as linked folders in the project. h and the folders “external”,“native_midi”,“timidity” and the file Androis.mk to ~/development/android/SDL2_mixer h and the file Android.mk to ~/development/android/SDL2_netįrom the “SDL2_mixer-2.0.4” folder you copy all files ending with. h and the folder “external” and the file Android.mk to ~/development/android/SDL2_ttfįrom the “SDL2_net-2.0.1” folder you copy all files ending with. h and the folder “external” and the file Android.mk to ~/development/android/SDL2_imageįrom the “SDL2_ttf-2.0.15” folder you copy all files ending with. unpack every zip to individual foldersįrom the SDL2.0.10 folder you copy the folder “android-project” to ~/development/androidįrom the SDL2.0.10 folder you copy “include”,“src” and “Android.mk” to ~/development/android/SDL2įrom the “SDL2_image-2.0.5” folder you copy all files ending with. Download these zip archives with source:ģ. ~ means the users home directory ~/development/androidĢ. The exception you make for each tool only lasts for one hour so you might have to do this several times the first This will also happen for “python”, “clang”, “clang++”, “ld”, “x86_64-linux-android-ar”, “LLVMgold.dylib”, “i686-linux-android-ar”Īfter each complain you will need to click “Build -> Make project” again. The next time this pops up you can now choose open. To be able to select the third option “from anywhere” Open Settings -> Security and integrity-> General settings tab. Then click on “cancel” on the popup window. Mac OS can complain that some tools like make and clang is not from a trusted developer. I will compile and run this on a Samsung Tablet (SM-T585)ĭuring the build process you might need to click on “Sync with gradle”Īlso you will need to klick on install SDK somewhere in the bottom. We need to utilize not only the SDL2 main lib but also SDL2_Image, SDL2_net etc Since all the examples is from a real game I have released on iOS, Android and Switch I will use its name. This is the updated tutorial to set up and build an app with SDL2.0.12 in Android Studio 4.0 in Mac OS Catalinaįor this instructions we wish to create a app named DemolitionCrew.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |