Introduction to Android Studio

By -

Feeling good to be back at blog :). Actually I have been managing GDG Ahmedabad, delivering android talks and managing workshops locally and outside my regions. Last month, I was quite busy in organizing “DevFest” event for the GDG Ahmedabad and then for the preparation of my 2 talks for the GDG Kathmandu DevFest.

I was invited to deliver 2 talks in DevFest organized by GDG Kathmandu. I have already published slides on my Speakerdeck. I am not sure whether you have already checked and learnt from my speaker deck but still give me a chance to write about Introduction to Android studio here.

What is Android Studio?

It’s an Android focused IDE, designed specially for the Android development. It was launched on 16th May 2013, during Google I/O 2013 annual event. Android studio contains all the Android sDK tools to design, test, debug and profile your app. By looking at the development tools and environment, we can its similar to eclispe with the ADT plug-in but as I have mentioned above its android focused IDE, there are many cool features available in Android Studio which can foster and increase your development productivity.

One great thing is that it depends on the IntelliJ Idea IDE which is proved itself a great IDE and has been using by most all the Android engineers.

android studio

What is the difference between IntelliJ Idea and Android Studio?

Nothing, in regards to Android.

If you use IntelliJ…

  • Keep using it
  • IntelliJ 13 will have the same stuff
  • EAP of IntelliJ Idea 13 includes all the new stuffs

If Not…

  • Give Android Studio a try

You may have some questions in mind regarding IntelliJ and Android Studio, check FAQ section: IntelliJ IDEA and Android Studio FAQ

Let’s download Android Studio

You can download Android Studio from the android developer site: http://developer.android.com/sdk/installing/studio.html

Cool features of Android Studio

As I have mentioned its similar to eclipse with ADT plug-in but Android Studio is having many cool features which can foster and could help you to increase development productivity.

Here are the cool features:

  • Powerful code editing (smart editing, code re-factoring)
  • Rich layout Editor (As you soon as you drag and drop views on the layout, it shows you preview in all the screens including Nexus 4, Nexus 7, Nexus 10 and many other resolutions. Layout designing can be done much faster way as compared to eclipse.)
  • Gradle-based build support
  • Maven Support
  • Templated based wizards
  • Lint tool analysis (The Android lint tool is a static code analysis tool that checks your Android project source files for potential bugs and optimization improvements for correctness, security, performance, usability, accessibility, and internationalization.)

You can experience all the cool features by using Android Studio yourself :)

Awesome stuffs Inside

Darcula theme
Darcula theme - Android studio

Its actually a black color based theme. While using Android Studio, I enjoy working in Darcula theme environment. BTW Its Darcula theme, not Dracula. I am correcting this just because I have seen many person over stackoverflow and Google+ speaking Dracula.

You can set the dracula theme in Android Studio by: File > Settings > IDE Settings > Appearance > Theme: Darcula.

Preview All the screens
Preview All screens _ Android Studio
We can consider this is as part of the Rich layout editor feature. With this privilege, user can design layouts and can check layouts by previewing in all the possible screens like Nexus 4, Nexus 7, Nexus and many other devices. It helps actually user to improve layout designs while providing compatibility to various resolutions available.

Device framed screen capture
save screenshot - Android Studio
It provides ability to capture directly generate a screenshot of your application. Yes it was already included in the SDK but Android Studio provides something more:

  • Device frame (As frames for many Nexus devices are available, you can capture screenshot in whiever frame you like most)
  • Drop shadow
  • Screen glare

Color Preview
color preview - Android Studio
I like this feature very much and I have found this feature helpful while working on big projects. While using eclipse, we have to have 3rd party color chooser and picker but this feature gives privilege to select color from in-build color chooser and can also have preview in Colors.xml file.

Color Preview – Activity class
Color preview - android studio

While using eclipse, it’s difficult for us to check which color we have used actually, yes we can imaging color by their name but actual preview is much better. This feature is lately introduced in Android studio so you must have latest Android studio installed.

Hard coded Strings
Hard coded strings - Android Studio
Another feature I like the most and have found useful. Whenever you use any string resources from Strings.xml then it displays actual value instead of variable name. By default, this setting comes by default but still in case you aren’t able to get hard coded strings in your activity class then try any of the below way.

Settings > Editor > Code Folding > Android String References
OR
Select String and right click on it and then go to Folding > Collapse
OR
CTRL + Numpad ‘-’

Create layout variation
layout variation - android studio
It provides ability to create layout variation directly, for example: layout for the large screen, layout for Xlarge screen, etc. The great thing is that the created variant layout gets stored in particular folders like layout-xlarge, layout-large-land, etc.

Should I use Android Studio?

You might have explored all the cool features or you are ready to explore right now. But questions might have arised in your mind “Should I use Android Studio?”, “Should we start using Android Studio right now?” or “Should I continue with IntelliJ or Eclipse?”, etc.

My answer is big NO to use Android Studio as main IDE for the Android development because currently its EARLY ACCESS PREVIEW and its getting matured over days. Engineers have been working hard to improve this IDE. So you should wait until BETA comes out.

I agree with Carlos Vega (commented over G+) for the point: “You should at least migrate to Intellij Idea 12 so that you get familiar with the IDE’s workflow and keyboard shortcuts. That way when Android Studio reach a more stable level, you can switch without a major learning curve.” Thanks Carlos Vega for the input.

BTW, here is the presentation which I had delivered at GDG Kathmandu DevFest, check either Android Studio on speakerdeck or the given below:

Paresh Mayani

Paresh Mayani is a lead android developer from India. Currently, He is Sr. Software engineer at InfoStretch Solutions Pvt. Ltd. He has been developing android apps since very 1st version i.e. Android 1.5, he says he has seen days and nights of Android history. He is the Head/Organizer of Google Developers Group (GDG), Ahmedabad

  • Ramakrishna

    awesome post for awesome IDE…

    Thank you.

  • Irwanto Widyatri

    how about when i want to use external library from github sir ? hope you can answer my question. thank you

    • http://www.technotalkative.com/ Paresh Mayani

      challenge? :) Any way, can you let me know which external libraries do you want to use? Because there may be a chance that your library is not available on Maven repository.

  • Andres

    I agree with the notion that this is a great IDE and one that can be tailored to android specifically. I have explored it before but never thought of it as a platform to do actual development on(at least not yet). When the time comes and beta is released I will most definitely look into this again and make a case for our company to use this rather than eclipse.

  • Sean O’Connor

    You definitely need to have an up-to-date PC to use android studio. It took more that 5 minutes to compile a ‘Hello World’ application on my 7 year old laptop. It is not useable on older hardware. A quad core 4GHz PC may get that time down to more reasonable 30 seconds I would guess. All the download size is too much at over 400Mb and I had to download twice because my anti-virus software (AVG) showed a false-positive on it (which can sometimes happen with any anti-virus software). Other people have written full IDE’s for their programming languages that are way, way smaller and way,way faster. It seems they are very lazy and simply bundle together other people’s projects with scripting ‘glue’, rather than making an effort to write there own code. In other words it is a very slow mash-up.

    • http://www.technotalkative.com/ Paresh Mayani

      Yes its obvious reason to understand that you should have PC with latest configurations to use latest stuffs. 7 year old laptop so I can guess one thing that its having <1GB RAM, if this is the case then yo should not expect great performance. I would suggest you to get latest configured laptop to enjoy Android programming.

      • Sean O’Connor

        I think they just got lazy and spent their time setting up configuration files for other people’s IDE’s, compilers etc. It’s not so difficult to write a fast, efficient tool chain yourself. Even individual programmers have done that. I would give up on android except for the AIDE app which is actually a fast and effective way of writing android code. Google have done a good job with android itself. I will use the AIDE app to write android code though.