Android Studio is where you will write, edit and save your app projects. Android Studio is focused specifically on Android development and provides streamlined environment and project set-up.
Google has done a lot of work to make Android Studio as powerful and helpful as possible.The latest version is Android Studio 3.0 and of course, Android Studio is free to download. You can refer to a previous post on how to it set-up.
Android Studio Plugins
In computing, a plug-in is a software component that adds a specific feature to an existing computer program. The common examples are the plug-ins used in web browsers to add new features such as search-engines or virus scanners.
The studio comes bundled with several plugins which are all activated by default.
AS has Intelli IDEA Plugin to help you write error free code. IntelliJ IDEA is a Java IDE for developing computer softwares. IntelliJ IDEA is developed by JetBrains (formerly known as IntelliJ) . Every aspect of IntelliJ IDEA is specifically designed to maximize developer productivity. It offers blazing fast and intelligent experience by giving relevant suggestions in every context and clever code completion.
In AS, IntelliJ plugin offers live hints while you’re coding for example and will often suggest necessary changes that can fix errors or make your code more efficient. If you start typing a line of code, Android Studio will provide a list of auto-complete suggestions to help you finish it; great if you can’t quite remember the correct syntax or you just want to save some time!
GitHub is a code hosting platform; Github plug-in is included to help you share your project files or import projects file into AS ( watch how to do it).
Firebase plugin gives you the tools to help you develop, grow and earn money from your android app. The tools include database management for your app, cloud messaging, user login authentication, and a way to test your apps against a range of physical devices hosted on Google’s cloud
Android Studio uses Gradle Plugin to automate and manage the build process. Gradle is used to compile and package together the various elements and files for an app project. Gradle takes all the raw materials of an app (code files, images, sounds ) and combines them into one file that can be installed on an Android device.
Gradle is an automated build system for Android projects, which means that we configure a few things, and it does a bunch of work for us automatically. It’s really helpful, and we usually don’t have to edit it too much after we first set up a project. But one thing that it does that is simply awesome, is manage dependency on other projects.
Dependency is used to refer when a piece of software relies on another one.The dependencies might need to be downloaded from a remote Maven or Ivy repository, or located in a local directory, or may need to be built by another project in the same multi-project build.
By default, Android Studio displays your project files in the project view. This view does not reflect the actual file hierarchy on disk, but is organized by modules and file types to simplify navigation between key source files of your project, hiding certain files or directories that are not commonly used. Let us review the 4 main folders which are automatically set-up for you upon setting-up an Android project.
- Manifests – contains the AndroidManifest.xml file. Manifest file defines app capabilities and permissions e.g. suppose we need to use the internet in our app then we need to define Internet permission in this file. Components such as activities, receivers, and services should be declared here. The manifest file works as an interface between Android OS and your app, so if you do not declare your component in this file, then it will not be considered by the OS.
- Java – it is where the java source code file for the app resides. The java source code file is where you write the code defining the logic of your app. By default, this is MainActivity.Java but you can refactor (rename) it.
- Res -it is where app resources are stored e.g. Animations, images, colors, assets and layout files.
res/drawable – this folder stores the image resources e.g. Bitmaps and Animation drawables and shapes
res/layout – This is a directory for xml files that define your app’s user interface. The default file is activity_main.xml, you will modify this file very frequently to change the layout of your app.This file contains all the XML mark-up tags that define our activity Screen Layout and its User Interface elements.
res/mipmap – The mipmap folders are for placing your app/launcher icons which are shown on the home screen
res/values -This is a directory for other various XML files that contain a collection of resources, such as strings and colors definitions.
- Gradle Scripts – This is an auto generated file which contains compileSdkVersion, buildToolsVersion, applicationId, minSdkVersion, targetSdkVersion, versionCode and versionName
Extensible Markup Language (XML)
Unlike Java (which is Back Bone of your app), xml helps you to design your app, how it will look and the screen layout for components like buttons, textview and editetexts etc as well as their styling.
Apart from these, xml is also used for parsing data either from database or server into your android app – this is called XML Parsing.
Android Studio Shortcuts
AS has some handy keyboard to help you code, some of the basis keyboards shortcuts that you should know are:
Ctrl + Space – Basic code completion
Ctrl + Shift + Space – find methods and variables that are suitable in the current context
Ctrl + Shift + Space – Casting while the caret is placed after a parenthesis
Ctrl + Shift + F7 – quickly highlights usages of some variable in the current file
Alt + Insert – generate getter and setter methods and constructors
Alt + Up or Alt + Down – move between methods in the editor
Ctrl + Shift + J – joins 2 lines into one and removes unnecessary space
Ctrl + Slash – comment or uncomment the current line or selected block with “//”
Ctrl + Shift+ Slash – encloses the selected block “/* …. */
Ctrl + O – to implement methods of the base class
Ctrl + Q – to show the Android documentation for the highlighted method.
Ctrl+ P – to show the possible parameters when the caret is placed between the parenthesis
You can review the full list of the shortcuts here
Tha is it about Android Studio, be sure to leave comments below.