Well G’day g’day, it’s Tim Buchalka the Aussie Android Dev Guy, and in todays video, I’m going to cover installing and configuring Android Studio on a Linux machine. Now the other thing you’ll need, a prerequisite for this is you need to have the Java Development Kit installed on your machine. So, let’s now proceed to installing Android Studio on a Linux box.

The best way to get up to speed is to watch the video on this page.

If you click the youtube logo at the bottom right of the video you can watch this video on Youtube in the proper size.

click-the-youtube-logo

 

Installing Android Studio

So, let’s go ahead and install Android Studio on a Linux machine. So, you’ll boot your linux up, and you’re going to open up your browser, and go to ‘developer.android.com’. Now scroll down and click the ‘Get SDK’ or ‘Get the SDK’. And click on ‘Download Android Studio’. Make sure you don’t click on the ‘SDK Tools Only’. Scroll down further, and select Linux down here, and click on that one. Because the tools are obviously only the tools and not the graphical user interface and of course you want the graphical user interface. You’re going to save that file on a directory.

Okay, you’re just about done. You’re going to go over to the file and unzip it by double-clicking it. And you’re going to put it in your ‘Home’ folder. It’s going to create a directory automatically. You can obviously put a forward slash (/) opt (/opt) or something like that, but in this case your just going to put it in the ‘Home’ folder. Click on ‘Extract’. Click on ‘Close’ in the Extract window. You’re now done with the installation, or with the extract at least.

Now go to your terminal and your going to go back to your ‘Home’ folder, and do an ‘ls’ command. Now you should see Android Studio. Go into Android Studio, and do another ‘ls’ command to have another look. There’s also a folder called ‘bin’ you’ll ‘cd’ into that folder and you should have a file there called ‘studio.sh’. You can see that in green on the right hand side of the screen. You then type dot forward slash studio dot sh ‘./studio.sh’ and press ‘Enter’. And that should start-up Android Studio for us.

running-android-studio-in-linux

Android Studio Initial Setup

Now while it’s starting up Android Studio it will also start fetching the SDK to figure out what it needs to download. Because of course, it only installed Android Studio. Now the option here that has come up is Android Virtual Device. You’d normally want that, because that’s the emulator that enables you to run Android Apps on your Linux machine. And note also, the Android SDK location, you may need that later. It’s automatically gone to your ‘Home’ folder. Forward slash Android forward slash SDK. Click on ‘Next’ to proceed. Now you can see the wizard has come up and detected that the Android emulator can run in an accelerated performance mode. So you do want to check those instructions, so click on those if you aren’t sure how to check that your KVM is enabled for faster speed. If in this case yours is, you click on ‘Next’ to continue. And just make sure that’s highlighted, the Android SDK license, and click on ‘Accept’ to accept all the licenses and click on ‘Finish’. And that’s going to go ahead and download everything it needs. This includes the Android Lollipop SDK, the support files, tools and so forth. Once it’s done, and everything been downloaded and installed, click on ‘Finish’.
SDK and JDK Location

So, we now reach the main Android Studio screen. What I want to do is just show you a few configuration options, Firstly, click on ‘Configure’. Now go down to ‘Project Defaults’. Click on ‘Project Structure’. Now I just want to show you once again how to find where the Android SDK location is, you may need to know that. and also the JDK location. You can see this is where its stored and might be found by Android Studio, the Java SDK that we installed in a previous video. If per chance you’re having some problems this is where you’d update that to point to the relevant Java Development Kit but in this case we’ve got Java 8 and we’re good to go. Just click on ‘Cancel’ to get out of that.

android-studio-jdk-and-sdk-location-in-linux

SDK Manager

I’m just going to go back to main Android Studio menu, because I want to show you ‘SDK Manager’. Now click on the “SDK Manager” option. Now this is where you can get updates to the SDK and also where Google on a regular basis will issue fixes and new versions of build tools, SDK tools and those types of things. This is how you find out whether they’re updated or not. So, you’ll get a status of whether its up to date. Installed means you have the latest version. If it comes up and obviously says ‘update’, it means there is an update and you would click on the ‘checkbox’ and then come over here to Install — ‘Install packages…’ button at the bottom right of the SDK Manager. And that would install the update for you.

Now it’s good to come in here periodically just to check and see what’s been updated. But just going down a little bit, we’re right at Android 5.0.1 API 21, that’s the latest version as of the time I’m shooting this video of Android, so this is what you’re dealing with. Now you can see these checkmarks have been put on automatically by Google because it wants you to download them. Now click on the ’Deselect All’ button. What I suggest you have installed is the ‘Documentation.’. You can see it hasn’t been installed. I would recommend that for sure, because it’s good to have that documentation on your machine anytime you’re looking up particular parameters for methods, you know those types of things, an API structure, and it’s great having the documentation.

SDK Manager(images) – Now if you wanted Android TV functionality, you’d click on those images. So I’m not going to click on those or Android Wear. But these images down here, are the ones you’ll probably want to use. The ARMEABI is the slowest system image, but it’s got more compatibility. So if you’ve got say less than four (4) or even 6-gigabytes of RAM, you may only be able to run this one, and if that’s the case select that. If you’ve got a bigger system and a decent graphics card, select the ‘Intel x86 Atom Image’. Incidentally you might be looking here and looking at _64 and thinking, ‘Oh I’ve got a 64-bit CPU, maybe I’ll run that one’, that’s not what it means. That’s actually 64-bit image of Android, so it’s the Android emulator for the 64-bit edition of Android. So you probably won’t need to use that in a lot of testing, so you should just stick to this one here the Android x86. But if you do have any difficulties running x86, you find out your system doesn’t have the performance you thought it had, you can always come back into here and select ARM instead and select that.

SDK Manager(sources) – And, the other thing I suggest you have also is the ‘Sources’. They’re already installed as you can see, but it’s great having the ‘Sources’’of the Android Software Development Kit So you can actually look at the code created by the other developers, the people who develop Android. And it’s just really interesting, going through and getting some great ideas.

SDK Manager(SDK Platform and Google APIs) – Lastly, I also want to talk to you about the platforms. You’ll see that the SDK platform has been installed. But Google APIs is the Google specific platforms. I also suggest you normally click on and select Google API since it contains things like Google Maps, and so forth. So if you’re going to be writing apps that use the Google specific APIs like I mentioned, Google Maps, you’ll want to select that as well.

SDK Manager(Extra) – Okay, now scrolling down to the bottom there may be some other things you need here. You’ve got some things installed, the Android Support Repository and the Google Repository are installed by default. But things like the Google Play Services if your going to be having leaderboards and achievements like for games, you’ll want that. and some of these other things depending on whether you’ve got that functionality, you may want that installed. It doesn’t hurt if you’ve got plenty of hard drive space and plenty of download capability on your internet connections, just to select everything if you want too. And obviously, the other things here aren’t compatible with Linux and we don’t need to address those.

So, once you’ve selected everything you wanted you just click over here on the ’Install’ button and it will download and install that for you automatically. Once your done with your business with the SDK Manager just close that down.

Updating In Android Studio

And lastly, I talked about addressing updates. I just want to show you another way to get to that. You can go back into the ‘Settings’ from the main menu of Android Studio. Scroll down to the bottom There’s an option here for updates. And this is where you specify the updates you can actually choose.

You’ve got a couple of options here. You’ve got Stable Channel, Beta, Dev and Canary. Now these are the various versions in terms of how stable they are, so the Canary Channel really hasn’t undergone much testing at all, it’s really just the developers popping out a fix. And, going up from bottom to top, they are more stable, so the Stable is obviously the most stable edition that you sort of find for the Android Studio.

android-studio-updating-for-linux

I normally set mine to ‘Beta Channel’. That’s one step down, and you’re still getting a lot of updates that are more relevant but you’re not getting a lot of bugs. Because bearing in mind, if you know much about Google, they are forever having products in Beta for a long period of time, so I trust them at that level, so it’s up to you. But, I would choose Beta myself given the choice. So you are going to select that now and click on ‘OK’.

Again, you saw this update notification at the top, and to go and have an update is pretty straight forward. You can see in the Update window, these are the versions. I’m going to click on ‘Update and Restart’. And you can notice how it’s actually a patch that’s it’s downloading instead of downloading the whole package again, so it’s done in a very efficient manner and you can see that its very quick and updates very quickly.

Now you might be wondering why is this coming up with another update? That because, you’ll remember, I selected and changed to the beta version. And the previous update when I clicked it was for the stable version. So if I click on ‘update’ now, you’ll see now it’s looking for a new Android Studio 1.1. Release Candidate 1 is available. But I won’t do that now, because you’ve seen how to do those updates.

Creating An Initial Project

The last thing I suggest you do is click on and create a new test project (Start a new android Studio project). Just to make sure everything is working. So on this ‘Configure your new project’ screen you can choose the application name, Your company domain. For example, if your company name was timbulchaka.com. Notice when I’m typing on the bottom, the package name is being reversed, so its a combination of reversed company name and the name of the app, so Android Studio does that for you automatically. But, we’ll talk more about package names in a future video. Click on ‘Next’ to proceed. And I’m going to click on ‘Next’ and leave all the options as the defaults. (Click on) ‘Next’. (Click on) ‘Finish’.

creating-a-new-android-studio-project-in-linux

And that should open up this package. And you can see, it’s working away in the background. You can see it’s chugging down there at the bottom of the screen. It’s just indexing and setting up. The first time you do create a new project in Android Studio, it does take some time to get going. It has to download various bits and pieces and index them and compile them, so we’ll wait until that finishes. And that’s it, that’s the sample test application, so at this point, we’re actually done.

And, that’s a wrap, we’ve now gone ahead and installed and configured Android Studio, and we’re up and going and you’re ready to start creating some Android Apps.

Tim’s Android Development Course

My course contains over Twenty-five (25)  hours of video training. With more being added regularly.
Teaching you, whether you’re a beginner at coding, or more experienced how to be a great Android app developer.  A fraction under 11,000  students have already taken my course and more are joining everyday.   I’d love to see you in there so come and check out what all the fuss is about!

Click here to access my Android Development course

All the best!

Cheers
Tim