Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Study: The features of Android studio

Aim
To study the folder structure of projects in android studio and all the main features of
android studio.
Reference:
http://tools.android.com/tech-docs/new-build-system/user-guide
http://javatechig.com/tools/android-studio-project-structure
http://stackoverflow.com/questions/17431838/android-studio-project-structure-v-s-
eclipse-project-structure

Android Studio replaced Eclipse as the main IDE for Android development in 2014. With this
change Google has revamped the way developers can take advantage of all the Android
development tools.
One of these improvements is the way setting up a new project works. It has never been
easier to set up a new project, just click File>New>New Project and Android Studio will step
you through exactly what you need to get started. Once this step is completed, click on
File>New Module to create the actual Graphical User Interface of the app. This creates a
new Module with a few folders and other files. Starting with the “manifests” folder which
holds theAndroidManifest.xml. The file holds basic information including the name of the
app that shows up on the device and any permissions that you define. Here is a
sampleAndroidManifest.xml:
This is the AndroidManifest.xml that Google provides when you make a new module.
The java folder hosts the java classes needed to make the app work, these can get very
complex depending on what you want to accomplish. The “Hello World!” application only
has 37 lines of code. Under the “res” folder you will find any images that are needed as well
as icons and the layout XMLs. The “activity_main.xml” controls the content and design of
the main activity.

Android Studio has a user interface that allows you to dragged and dropped different UI
items into place on the activity, or if you prefer you can add the items straight in the code.
Under the “values” folder there is the ability to change themes for the activity, the default is
“android:Theme.Holo.Light.DarkActionBar” which provides a white background and a gray
action bar.

What is Gradle?

Gradle is a build automation tool that sets out to be easier than traditional XML based
project configurators and was made for large projects. One benefit is that it knows what
parts of the build-tree are up to date, so those parts do not have to be re-executed. Gradle
is written in Java and Groovy, which makes it relatively easy to do the basic things needed
for an application. Gradle was introduced in 2007, but has only been used for Android since
the release of Android Studio. Note that each module in a project will have its own Gradle
file. Gradle provides an easy way to configure app details including build version and SDK
version. A Gradle file will look something like this:
Just like the Android Manifest, this can get more complicated, especially if dealing with an
Android Wear module as well as a phone module. In a Gradle file you can configure the SDK
versions needed for your app and the app version.

The Android SDK, AVD Manager and ADM

The Android SDK includes all the necessary libraries and files for Android Developers to get
started. What is nice about Android Studio is that the SDK is built right in and is easy to
access by just clicking a button on the top toolbar. The items beside the SDK Manager icon
include the Android Virtual Device Manager and Android Device Monitor. The AVD Manager
allows you to set up Android virtual devices to test apps on. You can configure just about
anything from the device size to the instruction set architecture. If you select an Intel
x86_64 instruction set architecture you can run the AVD in something known as “fast virt
mode”, this uses Intel’s Hardware Accelerated Execution Manager (HAXM) which allows for
a very smooth experience when running an AVD. The Android Device Monitor allows the
user to monitor everything that is happening on the device at any given time, it acts like a
turbocharged LogCat with a graphical user interface essentially, this makes it very easy to
debug apps and see what outside sources may be conflicting.
How to run an application in Android Studio

With the tools mentioned above it is extremely easy to run and manage applications. To run
an application just click the green arrow in the taskbar, this will run Gradle to make sure
there are no errors then pull up the device menu. From here you can select what device you
want the app to run on, whether it be an AVD or a physical device. Projects with one module
will default to that module, but a module will have to be chosen when there are more than
one. An extra dialog box will pop up and let the user choose a module they want to run.
When the app is running you can check the LogCat or ADM to make sure everything is
running right.

You might also like