I have a temporary working fix for this, and I have attached a zip containing sampleGame and sampleGameAndroid. The problem with this is that if anything is updated (slick2d, slick-ae, or libgdx) I have no real way of updating it.
(
Download zip here)
Here is a guide on how to set up and use it. I'm assuming you've installed the
Android SDK and
Android USB for your device1. Extract zip to desired location
2. In Eclipse, choose File > New > Java Project
- Project Name: sampleGame
- Uncheck Use Default Location
- Browse to the sampleGame and click OK
- Click Finish
- Double check the folder structure in Eclipse and make sure it looks like:
sampleGame
- src
- sample.game
- DesktopLauncher.java
- GamePlayState.java
- MainMenuState.java
- zzTest.java
- JRE System Library (We're running with 1.6)
- Referenced Libraries
- libs
- gdx-backend-lwjgl-natives.jar
- gdx-backend-lwjgl.jar
- gdx-natives.jar
- gdx.jar
- slick-ae.jar
- res
- defaultfont.fnt
- defaultfont.png
3. In Eclipse, choose File > New > Project, then Android > Android Project and click Next
- Project Name: sampleGameAndroid
- Uncheck Use default location
- Browse to sampleGameAndroid and click OK
- Click Next
- Select Android 2.3.3 from the list of OS's (I've only tested this to work with 2.3.3)
- Click Next
- Package Name: sample.game
- Click Finish
- Click Yes when it asks you if you want to create the project in an existing blah blah blah...
- Click OK when it tells you AndroidManifest.xml already exists...
- Double check to make sure the file structure looks like:
sampleGameAndroid
- Android 2.3.3
- Referenced Libraries
- src
- sample.game
- SampleGameAndroidActivity.java
- gen
- assets
- defaultfont.fnt
- defaultfont.png
- bin
- libs
- armeabi
- armeabi-v7a
- gdx-backend-android.jar
- gdx.jar
- slick-ae.jar
- res
- AndroidManifest.xml
- progaurd.cfg
- project.properties
4. Set up your Android Emulator
- In Eclipse, go to Window > AVD Manager
- New
- Name: (Name this whatever you like)
- Target: Android 2.3.3
- Skin -> Built-in WVGA800
- Device ram size: 1024
- Click Create AVD
5. To test the project on the emulator:
- Open SampleGameAndroidActivity.java in Eclipse
- Click the arrow beside the run icon
- Run Configurations
- Click Android Application from the left sidebar and click the new icon on the top left ( looks like a piece of paper with a plus on it)
- Name: (Anything you want)
- Browse and select sampleGameAndroid and click OK
- Under the Target tab, check Automatic, and check the Emulator you just configured in 5.
- Click Apply, then Run
- You can now click the run icon whenever you want to debug the game
- If it doesn't automatically run, click the arrow beside the run icon and select the run configuration you made
5a. If you have an Android device, you can go back into the run configuration you made, under the Target tab and choose Manual. From now on after you've set that, a dialogue box will come up when you run the game to ask you if you want to run it on your device or run it on the emulator.