EDIT: Added this to the wiki
As you may already know making a native Android app with the new love-android-sdl2 it's not so simple and it's wiki explains how to do it in Arch linux (with console commands mostly) . A tutorial for Windows hasn't been made yet so I'll try to explain the process.
First I downloaded the Android SDK (as the wiki states is a needed step) to do this I went to Android Developers Download page. WARNING the "Download the SDK" link is not the one you have to click (learned this the wrong way), that links directs to a pre-set environment and we want to make our own one. The link you should click is in the "Use an existing IDE" section there you can click the download link and get the SDK tools. Keep this tab open we are gonna use it quite a bit.
So then I tried to install it BUT it requires to have the Java SDK (JDK for short). To get the JDK I went to the "System Requirements" section of the Android SDK page. There I found a link to the JDK download page.
You have to click the first option (without netbeans) and should be redirected to the downloads, scroll down ACCEPT THE LICENSE AGREEMENT (it's pretty easy to don't see it), and then click on the correct download link ( Windows 32bits jdk-7u51-windows-i586.exe, Windows 64bits jdk-7u51-windows-x64.exe)
NOTE: I had some troubles with this downloads that didn't let me install the JDK but I tried many many times till I got it right (you can check the file integrity with the checksums Java provides)
Install the JDK (You know... Accept Accept Install Finish ). Then install the Android SDK Tools (Don't run it yet we are gonna respect the steps as they are in the wiki page)
Now in the Android SDK page in the Requirements section you can get Apache Ant. Once you are in the main page you can go to the Downloads section at the right, click the Binary Distributions link and download the .zip archive (you can find it in the "Current Release of Ant" section)
Once you get the zip you can unzip it wherever you want. I placed it in "C:\Ant" but I think that anything will do.
NOTE: inside of the zip there is a folder so if you unzip it in "C:\Program files" the path will be "C:\Program Files\apache-ant-x.x.x".
Now lets get back to the Android SDK page to get the NDK (NDK requires the Android SDK but you already have that). At the left sidebar in the Downloads section there is an option that says: Download the NDK
Click on it and download the 32bit or the 64bit version depending on your system.
Okey so here we have other zip file that can be uncompressed wherever you want (just remember where you left them).
For this zip I made a folder in my user folder (since its not really an app but a library) "%USERPROFILE%\bin\android-ndk-r9c"
NOTE: This file is also a folder inside a zip.
NOTE2: There are almost 30000 files (maybe more) in the zip so it will take a lot of time
We are almost there
Now it's time to install the Android Components. To do this open the SDK Manager
Start > All Programs > Android SDK Tools > SDK Manager
Might take some time to start up.
In this checkbox list you have to select the following items:
- Android SDK Platform-tools API 19.0.1
- Android SDK Build-Tools API 19.0.1 (or API 19.0.2?)
- Documentation for Android SDK API 19 (I don't really think you need this but whatever)
- SDK Platform Android 4.4.2 API 19
- Samples for SDK API 19(not really needed either)
- ARM EABI v7a System Image API 19
- Google APIs ARM System Image API 19
- Sources for Android SDK API 19
- Android Support Library
- Google USB driver
This is driving me crazy
Okey so it's time to get the repo . You have a Git client? perfect use that (I don't have one so I cant help you but you can look at THIS). If you don't have one like me, follow this steps:
-Go to the Downloads page of the bitbucket repository
-Go to the Tags tab
-Select the "beta2" (or most recent version) .zip file and star downloading it
-Uncompress the file wherever you want, again this zip has a folder with the same name as the zip name inside of it (kind of inception), I puted it in %USERPROFILE%\repos\love-android-sdl2
We now have every single file you'll need... it's time to set ENVIRONMENT VARIABLES!! Yeah!
So... what's that anyway? Environment variables define constant variables inside of the OS that you can easily call in a shell.
e.g. %USERPROFILE%, %PATH%, etc.
It took me a while to understand how to set this variables since there are many ways to do so, I'll go for a "hard one" because I'm trying to do everything without using a shell.
So press Windows key + the Pause key (or go the My Computer right click and Properties)
NOTE: I imagine you have administrator privilegies (if you don't then this might be a little tricky and you should look how to do it somewhere else) but since you could install all those app you should have them.
Select "Advanced" in the left sidebar and at the bottom of the prompted window it will say "Environment Variables" click on it
So there are two types: User's and System's, I couldn't make User's variables work so I'll use System's (if you were able to use the User's ones please tell me)
WARNINGNOTE: I tried using %USERPATH% and other environment variables inside of the value fields but this didnt work so I had to change them for the full path (C:\Users\YourUsername\) so whenever you see an environment variable you should change it to its full path (just to be sure)
Here we will define some new variables so click New (under system variables) and put this:
Code: Select all
Name:ANT_HOME
Value: C:\Ant (or whatever directory you used for ant)
Code: Select all
Name: JAVA_HOME
Value: C:\Program Files\Java\jdk1.7.0_51 (or your java directory)
Code: Select all
Name: ANDROID_SDK
Value: %LOCALAPPDATA%\Android\android-sdk (or your android-sdk path)
Code: Select all
Name: ANDROID_HOME
Value: %LOCALAPPDATA%\Android\android-sdk (or your android-sdk path)
Code: Select all
Name: ANDROID_NDK
Value: %USERPATH%\bin\android-ndk-r9c
Code: Select all
Name: ANDROID_SWT
Value: %ANDROID_SDK%\tools\lib\x86 (or x86_64 in 64bits systems)
Click it and then click "Edit" now in the value field you will get some text right?
e.g.: C:\Windows\System32 (It should be longer but doesnt matter)
Now you have to add something and to do so you'll do this:
Code: Select all
OLDTEXT+;%ANT_HOME%\bin;%ANDROID_SDK%\tools;%ANDROID_NDK%
NOTE: Dont put any type of quotes ( " ' ) they are prohibited
Now we are done with environment variables lets keep going
Then I just went to the repository folder and created a new text file, I named "build.bat" (I changed the txt extension for the bat extension since this is a shell file)
inside of it I wrote
Code: Select all
ndk-build
rem You could specify the numbers of cores of the computers by replacing "ndk-build" for "ndk-build --jobs n+1"
rem Where "n" is the number of cores. I didnt test it on Windows so I dont know if it works as it should
pause
I then clicked on the file and the building process began (And if you were tired of waiting! )
Now you should check the wiki on how to deploy your own game instead of the no-game app
Then you can just create another text file in the repository folder and name it "whatever.bat" (PS: Dont name it "ant" it will brake) deleting the ".txt" extension of course and inside of it you write
Code: Select all
ant debug
Did you write in a console? I didn't
If you had a problem/made a mistake/I used a non-efficient way/or didnt explain something please tell me I'll do what is in my grasp
- Positive -