[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Slick Forums • View topic - intro to Slick-AE

Slick Forums

Discuss the Slick 2D Library
It is currently Thu Jun 01, 2023 9:36 pm

All times are UTC




Post new topic Reply to topic  [ 39 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: intro to Slick-AE
PostPosted: Tue Jul 12, 2011 12:06 am 
Offline
Oldbie
User avatar

Joined: Thu Jan 13, 2011 4:42 pm
Posts: 349
Subject: intro to slick-AE

It seems that many people want to try out slick on android, and that all of the people who try run into trouble. This post is meant to outline:

1. How to setup a slick game to run on android
2. Issues with slick on android and their workarounds

I am not so brilliant that I figured out Slick-AE myself, most of this I learned from others on the forum. Thus, there are things I will likely forget in this outline, and I hope that if anyone comes across something I have left out, they will tell me so.

Part one: how to run a slick game on android
1. First off, you are going to need to install eclipse and the android plugin for eclipse. Instructions can be found here: http://developer.android.com/sdk/installing.html.

2. Next, you will need to download the source for Slick, and Slick-AE (both located in https://bitbucket.org/kevglass/slick/downloads). Slick-Android-Test is not required, but is extremely useful as an example of a working android program.

3. To get Slick-AE into a useable state, you will need to compile it into a jar. First, configure the Slick-AE build path to include Slick in your workspace, which should get rid of any errors Slick-AE has.

4. Next, run build.xml in Slick-AE. Once it is finished, refresh the workspace, and there should be a fully functional slick-ae.jar in the target folder.

5. In order to run your game on android, it will need both a normal java project (for running on a computer) and an android project (for running on android). Assuming you have a java project already, make a new Android project and add the java project to its build path.

6. Slick-AE is built off of the libgdx engine, so there are three jars and two folders that the android project will need to run your project, and they all need to be in a folder called “libs” in the android project folder. They are: the slick-ae.jar you just built, gdx.jar, gdx-backend-android.jar, a folder called armeabi, and another folder called armeabi-v7a. Make sure the jars are put on the build path (armeabi and armeabi-v7a should not be on the build path). All of these, except the slick-ae.jar should be taken from the Slick-AE project under the folder lib. There are newer versions of libgdx available, but at the time of this writing, Slick-AE needs to be tweaked in order to use them. This will be discussed further in sections two and three. For now, just use the stuff in the lib folder of Slick-AE.

7. Move all of the resources for the game into the assets folder in the android project (this should be automatically generated) they will be used as though the folder “assets” were not there. Also, you will need to copy defaultfont.fnt and defaultfont.png from the Slick-AE project into the assets folder of your android project.

8. Finally, there should be a single class in the source folder of the android project. You must change three things: make it extend SlickActivity instead of Activity, remove the line that says “setContentView(R.layout.main);”, and add the line “start(new YourGame(), 850, 480);” where YourGame is your game from the java project, 850 is the width of the screen, and 480 is the height of the screen.

9. Your android project is now ready to debug!

Part two: Troubleshooting

Issue 1:
Out of memory errors occur a lot. Android has much less available memory than a computer, so all of the resources may not fit in the memory at once. Best to use small images or unload images once they are finished.

Issue 2:
jpg files, 24 bit png files, and mod music files are not supported by libgdx. Best to convert them into 32bit png and other music formats
(thanks to Tobse: viewtopic.php?t=3389)

Issue 3:
Tiled maps sometimes have skewed sections. I don’t know a solution.

Issue 4:
container.getGraphics().copyArea(Image,int,int); does not seem to work. I don’t know a solution, and any solution would need to be implemented with the knowledge that if the user suspends the app (by, say, going to the home screen), the grahic will be lost.

Issue 5:
Restarts when screen is rotated or droid keyboard is deployed.
By default, when the screen is rotated the onCreate method is called again. The way you stop that is by adding the following lines in the manifest:

android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait"

(thanks to Ciph3rzer0: viewtopic.php?t=3496)

This is what I know so far. If I missed something, please let me know. :wink:


Last edited by Mr. Kenkron on Sat May 26, 2012 9:56 pm, edited 9 times in total.

Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 24, 2011 12:32 am 
Offline

Joined: Fri Jun 10, 2011 1:38 am
Posts: 15
Location: Mendoza, Argentina
Hi Mr. Kenkron!
Awesome tutorial
I need help with:
(.....) Assuming you have a java project already, make a new Android project and add the java project to its build path.
I'm using netbeans and I don't know how to do this.
I need a little help!

Thanks!

_________________
Martin


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 24, 2011 5:00 am 
Offline

Joined: Wed Aug 17, 2011 4:17 pm
Posts: 10


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 24, 2011 7:48 am 
Offline
Slick Zombie

Joined: Wed Apr 02, 2008 1:32 pm
Posts: 1340
Location: Italy
great work! Admins can move this into Android sub-forum? And maybe put as sticky?

some questions: can you build a template project with an "hello world slick game" working both on Android and as desktop app? I'm having trouble having a project working in both worlds :D

_________________
| Last game


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 25, 2011 3:11 am 
Offline
Oldbie
User avatar

Joined: Thu Jan 13, 2011 4:42 pm
Posts: 349
Here's a demo!



Top
 Profile  
 
 Post subject: great work! thank you!
PostPosted: Sun Aug 28, 2011 4:28 pm 
Offline

Joined: Sun Apr 03, 2011 1:57 pm
Posts: 3
great work! thank you! :D :D


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 28, 2011 7:25 am 
Offline

Joined: Wed Sep 28, 2011 7:20 am
Posts: 2

_________________
The best


Top
 Profile  
 
 Post subject: Re: intro to Slick-AE
PostPosted: Sun Jan 22, 2012 12:52 am 
Offline

Joined: Tue May 03, 2011 10:38 pm
Posts: 32
I'm having an issue with:

Error generating final archive: Found duplicate file for APK: libandroidgl20.so
Origin 1: D:\My Documents\workspace\testSlickAE\libs\armeabi\libandroidgl20.so
Origin 2: D:\My Documents\workspace\testSlickAE\libs\armeabi-v7a\libandroidgl20.so

Any idea how to fix this? I believe this is for step 6. I copied the jars and folders mentioned into the Android project and then included the jar's and folders in the build path.


Top
 Profile  
 
 Post subject: Re: intro to Slick-AE
PostPosted: Sun Jan 22, 2012 7:24 pm 
Offline
Oldbie
User avatar

Joined: Thu Jan 13, 2011 4:42 pm
Posts: 349
actually, I believe that the folders do not need to be in the build path (I didn't even know you could add folders). Try having just the jars in the build path. The folders should still be in the libs folder, but do not add them or their contents to the build path. I will update step six to make this more clear. Thank you for letting me know about this. Please post again if this does not work.

_________________
"Artificial intelligence will never be a match for human stupidity" - "Jamos Kennedynos"


Top
 Profile  
 
 Post subject: Re: intro to Slick-AE
PostPosted: Tue Jan 24, 2012 8:15 pm 
Offline

Joined: Tue May 03, 2011 10:38 pm
Posts: 32


Top
 Profile  
 
 Post subject: Re: intro to Slick-AE
PostPosted: Tue Jan 24, 2012 8:38 pm 
Offline
Oldbie
User avatar

Joined: Thu Jan 13, 2011 4:42 pm
Posts: 349
Try to start new threads on this forum for new problems.

I think I have received this message before in my projects. Oddly enough, it was a project that worked at one point, but started complaining whenever I used a version of slick-ae compiled after a certian time. At leat, I think that's what it was. I never really figured out exactly what was happening, but eventually, I moved my project to a different workspace and it started working again. I apologize. I have no idea what causes this. If you find something else, let me know.

_________________
"Artificial intelligence will never be a match for human stupidity" - "Jamos Kennedynos"


Top
 Profile  
 
 Post subject: Re: intro to Slick-AE
PostPosted: Tue Mar 27, 2012 7:17 pm 
Offline

Joined: Tue Feb 21, 2012 3:46 pm
Posts: 26
can i use the slick-ae.jar from you demo project?? Or do I have to build it in my workspace?!


Top
 Profile  
 
 Post subject: Re: intro to Slick-AE
PostPosted: Thu Mar 29, 2012 3:58 pm 
Offline
Oldbie
User avatar

Joined: Thu Jan 13, 2011 4:42 pm
Posts: 349
you should be able to use the jar from the demo. If it doesn't work, let me know. It might not be completely up to date.

_________________
"Artificial intelligence will never be a match for human stupidity" - "Jamos Kennedynos"


Top
 Profile  
 
 Post subject: Re: intro to Slick-AE
PostPosted: Thu Mar 29, 2012 5:35 pm 
Offline

Joined: Tue Feb 21, 2012 3:46 pm
Posts: 26
Ok there are no problems or errors :)

But to be save.. Can you desribe the creation of the slick-ae.jar with more details!? Because I can't get it done?! :roll:

thanks


Top
 Profile  
 
 Post subject: Re: intro to Slick-AE
PostPosted: Mon May 21, 2012 6:27 pm 
Offline

Joined: Mon May 21, 2012 6:21 pm
Posts: 7
Heyho, my projekt works perfectly like the offical "SlickAEDemo-Android", but when I touch on the screen the app crashes. This happens with my and the "SlickAEDemo-Android" app. Also it seems like there are no error messages. Also another question, how to interact with touch inputs? touchUp and touchDown always need a "pointer" or a "button", but I dont want these/dont know what the args are.

Is is better to use the "libgdx" directly or slick?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 39 posts ]  Go to page 1, 2, 3  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group