In this chapter we are going to learn Android Studio Interface and its Tools, Menus as well as preferences and settings.
Se lets start and look at into Android Studio.
i. Welcome Screen
When you will start Android Studio you may get directly open your project on which your working last time you closed Android studio. And If not then Android studio will start with welcome screen.
From the welcome screen you can open your recent projects. In other side in a window you can create new project or can open existing project. I am going to open My First Project from Recent Projects
ii. Project Window
Once Open the project you can find the Project window left hand side of the screen.
The project window shows all the files and folder which are related to projects. There are few different options you have available to view the files structure of the project.
Project: If you choose project option you will find following structure.
In the.idea folder you will find all the xml files related to the IntelliJ idea configuration. In the next folder, that is app folder where you can find your project files and the last folder is gradle where you will find gradle plugin and its settings like which version you are using.
Also you will find some more settings related files like .gitignore to manage your git settings and .iml file etc.
There also you will find External Libraries. Where you will find your reference libraries like Android platform which you are using, Android Supporting Library and JDK.
Package: The package view gives you the simple look of your project files, where you can see only Java files, project resources files and xml file.
Android: By choosing android option you can view the project files by folders in organized form like manifest where you can find AndroidManifest.xml for app settings. Java folder where you can find all the java files related to project and last one is res folder where you can find all the resources of the app like layout, style, graphics etc.
There are few more option you will find which are Project files, production, problems and test that also you can try.
iii. Structure Window
This window shows the structural view of your java classes. If you have worked on eclipse you may know outline view similar like structure window in Android Studio.
Its shows the methods, fields, variables, constants and other member of the currently opened class.
Also you can filter or sort class members from configuration options. See image below.
And also you can jump any of the method, variable by clicking within class.
iv. Build Variants Window
With Build Variants window we can control build process of the current app and it shows two variants one is Release and another is Debug. We will discuss about this window in the chapter 5.
v Favorites Window
You can bookmark any of the your project files in Favorite window which you want again and again by double clicking on that file.. To add into favorite click on add button or you can directly add files by right click on file project window and add to favorite.
vi Message Window
Message window helps you to show the warning and errors dispatched by gradle build system while developing application.
vii Run window
It shows messages when you run any particular task.
viii Android window
Android window is the smaller view of DDMS Monitor view which shows the app logcat output and log generated by ADB(Android Debug Bridge).
If you want to open DDMS Monitor, goto Tools>Android>Android Device Monitor. This is the same window which is available in eclipse too. Here you can find all the debugging related tools.
ix Terminal Window
Terminal Window is same as command prompt of windows os. You can run all the command which you use on windows command prompt.
x TODO Window
From TODO window you can jump on comment where you have commented as TODO.
Every developer has a different habits when he/she use the IDE for development. Someone want project window right side instead left or someone want message window as float or android window on different monitor. Android Studio also has flexibility with managing windows placement as per developer requirement.
You can resize windows by holding mouse between two windows and can adjust to size. If you want any of the window on another place, you can easily drag it and drop it . See the image shown below.
You can float the windows if you want or place them into another monitor if you are using multiple monitors.
you finish with your windows placement you can save your layout from Window>Store current layout as default. And restore it any time from Window>Restore default layout.
Menus and Tools
In the most of the IDE you will find few menus are most command, like File, Edit, View, Window and Help Menu. Rest of the menus are you found as per its purpose. In the Android Studio you will find Navigate, Code, Analyze, Refactor, Build, Run, Tools and VCS. Each menu has all the command related to that. For example In the Build Menu you will find all the commands related to build a project. like Make Project, Make, Rebuild Project, Clean Project etc.
There is also available keyboard shortcuts which are mentioned side to the each menu commands or you can find all the keyboard shortcuts at place from Help>Default Keymap Reference. It will open the url of all keyboard shortcuts reference.
Below the menu-bar you will found Tool-bar also. From the tool bar you can directly save the file by clicking on save button or can run the cut copy paste commands. There is also you will find Run command button or debug etc. You can configure your tool bar as per your requirement by right click on tool bar and select Customize menus and tool-bars.
From the configuration window you can configure Menus and Toolbar as you want.
Settings and Preferences
From the setting dialog you can customize your Android Studio for you development like change font or font size or class member colors etc. Here I am going to show you how we can enable line numbers and method separator as an example.
Go to file menu and select Settings. dialog open go to Editor>Appearance setting. Now enable Show line numbers and Show method separators.