It’s Tim Buchalka, the Aussie AndroidDev Guy, here with yet another video.
This time we’re setting up and installinglibGDX which is a game framework using Android, Android Studio for Linux.
Now, if you’re running a Mac or a Windowsmachine, click on the links over to my left and you’ll be taken to a videowhere I show you how to do that on your platform, but again thisvideo is all about configuring and setting up LibGDX, a game framework, using Android Studio for Linux.
Let’s get into it.
Okay, so let’s do a search forLibGDX Then goes with the first result, which is libgdx.
And click on that.
And once we’re there we’re gonna go tothe download, click on Download and select Download Setup App.
And I’m gonna save that.
It’s quite a small file.
You can see it’s now downloaded.
So we’re now going to open that file.
I’m gonna double click it.
Now if that doesn’t work, depending onthe way your Linux machine is configured, that may or may not work.
If double clicking it doesn’topen this for your automatically, then what you can do, andremember we’re in the downloads folders.
I can go back and open a terminal.
Going to the Downloads folder and I can type JA sorry Java- jar GDX- setup.
Jar and that will open it up that way.
So either way one of those should actuallywork for you so I’m just going to go back and close the terminal down nowThen go back and double click it.
Okay, so, now we’ve got a few thingsto do here so we need to know the name, the package, the game classdestination and the Android SDK.
Now this is the LibGDX Project Generator, so the idea of this is it generates the project, the shell, if youwill Of the code that you need to be able to use libGDX, so use this toolonce to create the project and from then on you edit it andcreate your game using Android Studio.
So this is the shell.
So what we need to know.
We need a few things.
We need to know the destinationwhere we’re gonna save the project.
But also the Android SDK.
The best way to find the Android SDKis to go back into Android Studio And just grab that link that we had.
So we’re going to open Android Studiocause you’ll recall if you followed along at home in the previous video whereI set up Android Studio, we went in and set up and located the correct treewhere the Android SDK is deployed.
Another thing we’ll remember whilewe’re here is the home folder.
So we’re storing our projectsin Android Studio Projects.
So we need to remember that because we’regoing to be putting our project in there.
So I’m going to close down the project, the current project.
Then I’m going to go back to here.
Then you’ll go into configure.
Project defaults, project structure.
Here’s our android STK location.
So, I’m going to take a copy of that and I’m going to paste thatinto the other app.
I’m going to cancel the screen for now.
Go back to our generator, and then in here under android STK I’mgoing to paste that path in.
The destination, remember, was the home folder.
And is my Android project, soclick on Browse for that one.
Here’s AndroidStudioProjects, so I’m just gonna select that.
We’re gonna click on OK.
We’re also gonna add something to here, we’re gonna add the name of the folderwe’re gonna use for this project.
I’m just gonna call it /test So that’swhere it’s going to write the files.
So the name I’m just going to, it’s goingto be pretty simple: My First Game.
Package, I haven’t really got time inthis video to talk about packages, it just needs to be something unique.
I’ll address packages in another video.
In game classes, the initial game classthat is executed When the project starts, when the game starts, sowe’ll talk about that later.
So for now, also keep in mind that someprojects are there because libGDX is cross-platform, it workson all those platforms.
I’m gonna just take the ticks off allthose inferior platforms, I’m kidding.
And just leave Android on.
So now in terms of extensions, if you don’t know what these are, you can just hover your mouse overthere and you’ll get some help.
So Bullet just to give you a bit ofan overview is a physics library.
Free Tarp is a lightweight fonts tool, so it does, sort of saves the space typicallyassociated with bitmap fonts.
Tools gives you things like texturepackers and the ability to generate fonts.
Controllers is forjoysticks and game pads.
Box2d is a 2D physics library, and Box2dlights is lights and shadows for that 2D physics library.
Ashley is an entity framework.
And last, but by no means least, AI is the artificial intelligence Framework that is now partof GDX as an extension.
You can also click on show third partyextensions and grab one of those or one or more of those things dependingon what comes up as well.
And you can see that these aren’tmaintained by the libGDX team.
I might do that now.
So I’m actually gonna deselect everything, but you would normally have Box2d selected.
I’m gonna leave that all like that.
So once we’ve done that, we can go into Advanced if we want to, but we won’t need to.
But just to show you what it looks like, that’s if you’re using Eclipse, or some other setup.
But we’re not doing that.
We’re using Android Studio.
So to do that now, all we need to do is click on Generate.
Now this will possibly pop up on yoursystem if you’ve got a more recent version of Android built tools.
Possibly, in the previous video I downloaded the latest version which wassort of ahead of the release of GDX.
Usually you’re okay you can try this.
If you did have difficultyyou can go back And fix that if you need to andby downloading a previous version.
Lock with the IPA, we’re using IPAlevel 21 which is Android Lollipop.
They haven’t tested it fully with libGDX, but with that said it’s going to be ok, but if you did have a problem you couldalways go back and regenerate it and just sort of downloada previous version first.
But I’m going to click onyes though to use both.
You can see on the screen below it’s notdownloading the relevant files in bits and pieces that it needs tocreate this project.
So the amount of time it takes and the size of downloads will be dependenton the options you’ve selected.
So you can see I deselectedthe sub projects and I’ve deselected all the extensionsjust to save a bit of time.
So I’m going to pause the video here andwait until this finishes and we’ll continue by importing thisproject into Android Studio.
Okay, can’t quite see because haven’tgot a lot of screen real estate here but it has actually finished if I scrollup you can see build successful.
So at this point we’re now done withthe libGDX project generator, so I’m going to close that down.
Go back to Android Studiowhich I’ve left open.
And we go back to the main options ormain menu.
You want to select importantnon Android Studio project.
We’ve got that.
We need to navigate to the folderthat just created it and of course that was my home folder, Android Studio projects test.
So I’m just going to click on test, and click OK.
This message may ormay not come up for you.
If it does, click OK, because it’s okay, and Android Studio [INAUDIBLE]grade will upgrade automatically.
So at this point now it’s going tostill do a little bit more analysis of the project and download the relevant files it needsto create an Android Studio project.
Now keep in mind here that what it’s doingis it’s importing the game framework.
You know, the basic skeleton code thatwe’ve created into Android Studio.
But it’s doing it in the same folder.
So it’s not creating another folder.
If you recall we created, we generated the project in that folder, Android Studio Projects four slash test.
It’s creating an infrastructurearound that, in that same folder.
Click on yes the language level changes.
And it’s just a matter of leavingthis to finish and do its thing.
Now it might take several minutes.
It may take quite a bit of time.
The first time that you open a project.
But once it’s done you can edit itnormally as you would any other android studio project.
So I’m just going to pause the videonow until this is completed.
Okay, shouldn’t be too much longer now.
So again, the first time you dothis can take quite some time just to update and download and do whatever else it needs to do just toget that project into Android Studio.
That is a once only process.
So we’ll just wait forthis to finish off, and then I’ll just quickly go through Justto show you some bits and pieces.
Not a lot to show, but basically againthis is just the skeleton code for libgdx.
On this point forward, you can startcreating your code in Android Studio.
And creating a game andrunning the game via the emulator, or via a physical Android deviceif you’ve got one connected.
Okay you can see it’s finished now sodo give it plenty time.
It does take a while to finish, but it’s a once only process.
First in terms of some of the folders.
You can see the standardAndroid manifest files there, Java files, resources, and so forth asyou would normally see in a project.
The part I want to show you is inthe core, and you can see, again, this is the package we choose, the class that we choose, and that’s the class that gets called orexecuted on the game start.
In this case it’s just setup by defaultbecause of some skeleton code to show the bad logic jpeg onscreen.
So that’s it.
And we’re done.
Dusted, complete and fully set up.
So libGDX is now readyto go on your machine.
Please now subscribe to my channel.
Click on the subscribe button to the lefthand side, and you’ll be kept up to date.
With new videos as I release them.
If you’ve got a moment also, can I ask you to please check outmy Android Development Course.
Over 25 hours of video training, showing you how to becomea better Android developer.
Feel free also to peruse some ofthe videos there to my left hand side, and really get you a feel, so to speak, of more Android app goodness.
Last, but by no means least, please comment on this video, let me know what you thought about it, butalso please give me some feedback of what you’d love in the cover in the futurevideo and I’d to do just that, to cover as many as those requestsas I can in the future videos.
This is Tim Buchalka, the Aussie Android dev guy signing off andI’ll see you in another video.
Cheers for now.