Advertisements

Android Studio Tutorial For Beginner #2: Where To Start?

Android Studio IDE has many tools and features which you can use in different ways to develop an amazing application. Mostly you need to use these folders and views to start developing applications. You can add files, strings, resources, themes, designs, colors, code, third-party libraries, assets in your application if you know how to use IDE correctly.

If you haven’t installed and set up Android Studio and JDK then click here.

You must have knowledge of all the folders and what type of data you must put in it and how? This will help you learn as quickly as possible. Try to remember names and file types you can put in these folders. Let’s Start:

Create A New Project In Android Studio File -> New -> New Project.. -> Empty Activity -> Next -> Finish.

Creating Empty Activity

Let Build Finish. Now Press Alt+1 -> Project window will open -> extend your application These Folders must be visible:

Folders in Project Dialog -> Select Android From drop down

Manifests

you can also call this a index. This file will contain

1.List of all the activities and which activity is Launcher Activity (First Activity in your Application)

 <activity android:name=".MainActivity">
            <intent-filter>
               <action android:name="android.intent.action.MAIN" />

             <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

2. It also contains your Icon file path, theme, app name, package name. these are basic information about your application which will be added to manifest once you create a new Project. You can change them as per your requirement later in your application.

3. This file also contains a list of other Activities and different classes of SERVICES. We will discuss the services later.

4. You can add user permissions in your manifest file like the internet, SMS, WIFI, storage, gallery, etc.

5. If you are developing an application for different size of devices than you must mention the size of your devices in the manifest file, so that play store can recognize that you have created your application for which devices?

Java:

This folder contains all the java and test files or you can say all the logic is here. You don’t have to look much into test files. Click on your package name and this will extend the list of activities you have created. Other than activities you can add other java classes like services, models, adapters or just simple java classes. You might need to create packages to maintain a folder view of these different classes.

Res:

This folder contains views and everything related to view (whatever is visible on screen) in it. It has been classified further into different categories, which are:

Drawable: This will contain all the vector, SVG files or custom layout files to design your application and give a beautiful UI to it -> if you want to create a box with rounded corners, you will have to create drawable file.

Layout: This file will contain layouts for each activity (window) you see on your mobile screen and much more. Which you will learn later.

Mipmap: This folder will contain your images, which you can add in 5 different folders(hdpi, mdpi, xhdpi, xxhdpi, xxxhdpi) according to the size devices for which you are creating application.

Values: this folder will contain different types of files like:

String: This XML file will contain your strings like your app name which you are using in the manifest file! you can add all your strings here and use them anywhere in your project.

<resources>
    <string name="app_name">My Application</string>
</resources>

Colors: This file will have color values in hexadecimal format with the name. you can change colors or add colors and use them in your project. try changing these colors and see what changes are there in your application to understand.

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="colorPrimary">#008577</color>
    <color name="colorPrimaryDark">#00574B</color>
    <color name="colorAccent">#D81B60</color>
</resources>

Styles: this file will contain your theme. You can change or modify your theme here, which you will learn later.

 <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>

Right Click on res folder -> New -> New Resource File -> Name file: In drop down you can see there are multiple type of resources other than we have discussed like menu, navigation, XML, font.

creating new resource file

All these types of resources can be used in developing a application.

build.gradle (Module:app)

This gradle file will have your libraries, min-max sdk, version code, version name, other third party libraries which you want to implement. Libraries are added in:

dependencies{
 implementation 'com.android.support:appcompat-v7:28.0.0'
 implementation 'com.android.support.constraint:constraint-layout:1.1.3'
}

You can try remembering them or if you can’t then you will learn when we start working on them. This is just a brief introduction about placing things at right place.

How useful was this post?

Do not forget to rate! this helps us to Improve.

Average rating / 5. Vote count:

Read More Like This..

Follow us on social media!

We are sorry that this post was not useful for you!

Let us improve this post!

Advertisements

Safiya Akhtar

Safiya Akhtar is Android Application Developer in India. She is currently working as a public consultant for career and education too, besides blogging and freelancing. She believes that it is never too late or too early to start what you have always dreamed of.

Your Views And Question are Welcome Here!

Advertisements