Kick Starting Android Development Journey in 2022

Kick Starting Android Development Journey in 2022

Table of contents

No heading

No headings in the article.

denny-muller-HfWA-Axq6Ek-unsplash.jpg

Introduction

Are you stuck on how to start android development? Then this article is for you. By the end of this blog I promise you will definitely gain some confidence and boosters which will make your android journey super smooth and enjoyable.

Talking about my experience, I started Android Dev approximately one year ago and the feelings of getting stuck in the basics are still fresh on my mind. Let me tell you that android development is not easy to grab as a beginner. It has lot of concepts, some weird syntaxes, etc. But if you pick up very basic topics at the start and build your first android app, it will give you a great motivation. All the upcoming concepts will look too easy to grab. So, here I will guide you which topic to pick first and start your android journey.

hello-i-m-nik-z1d-LP8sjuI-unsplash.jpg

Java or Kotlin ?๐Ÿค”

As a beginner, geeks often gets stuck on which language to choose. But trust me if you start with Java, many tough concepts and get clear easily. After you learn Java (atleast upto OOP's) you will grab Kotlin very easily. It has many shortcuts which decreases code lines but its not preferred if you are a beginner. Its always important to know the core concepts of programming and basic problem solving before diving into development.

So lets get started ๐Ÿš€

In my experience I have seen many geeks quitting android development because they fail to setup Android Studio Successfully. Go to this link https://developer.android.com/studio?gclsrc=ds&gclsrc=ds#downloads and download according to your system OS. I will suggest you to download Stable version of android studio. After it gets downloaded, click on the downloaded file to install android studio.

Getting Started ๐Ÿง‘โ€๐Ÿ’ป

At first this IDE seems to be overwhelming but trust be after you build your first application you will never look back. Without thinking about the file and other options available on the studio, lets jump to build a very basic project. We will build a simple counter application in this blog. So without ant further talk, lets get started.

Step 1: Click on "Create New Project" Screenshot 2022-02-28 062105.jpg

Step 2: Select the Empty Activity from the options

Screenshot 2022-02-28 062256.jpg

Step 3: Give name to your project, ignore the package name for now, select your project location, select language "Java" and finally select the Minimum SDK version. Now, what's this Minimum SDK? It means the application will be allowed to install on the devices higher or equal to the version specified by you. I suggest for now go with Android 5.0. Click on finish. It will open the IDE with some builds(processes) running and some indexing taking place. Just leave the system until it gets finished.

Screenshot 2022-02-28 062445.jpg

Step 4: Look to the top-left corner, If not selected android then select it like this:

Screenshot 2022-02-28 063133.jpg

Step 5: Look for the activity_main.xml file.

image.png

Delete the whole block and start writing your own code.

Go to this split option as shown below :

image.png

And in the code section between the add the code provided below:

<TextView
        android:id="@+id/counterTv"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginHorizontal="12dp"
        android:layout_marginTop="120dp"
        android:text="0"
        android:textAlignment="center"
        android:textColor="@color/black"
        android:textSize="18sp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <Button
        android:id="@+id/counterBtn"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="32dp"
        android:padding="2dp"
        android:text="Add Count"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/counterTv" />

After this you will start seeing the design on the right-hand-side of the IDE.

Now, going to MainActivity.java write the following codes (some will be already written by default) :

package com.example.myapplication;

import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {
    private TextView text;
    private Button countBtn;
    int count = 0;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        //connecting the views the variables declared above
        text = findViewById(R.id.counterTv);
        countBtn = findViewById(R.id.counterBtn);

        //Setting Click Action on the button we created
        countBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                count=count+1; //increased the count variable by one on the click

                //setting the value of the count on our textView we created
                text.setText(String.valueOf(count));
            }
        });
    }
}

After this connect to the USB of your device and going to the developer options click on enable USB debugging (google it if you don't get it). Now click on Run Button (shown below):

Screenshot 2022-03-01 035032.jpg

It will take some time to compile and build the files and then it will show install/deny on your mobile. Finally the application will install on your android device and congratulations ๐Ÿฅณ๐Ÿฅณ, you made your first working applications.

After getting this confidence, try to pick up topics and learn them step by step, and yes, building live examples applications are compulsory of you really want to grab all the concepts.

What should be your next step? ๐Ÿค”

But what to learn, where to get the topics and from where to learn? So, here you will find the whole roadmap of android development for beginners https://twitter.com/Subhadipdhn/status/1462090989086994438 . After learning all this you will surely become a independent developer who can easily explore more advanced topics and shoot them as they come.

Resources (Free) ๐Ÿคฉ

If you like to read documentations and dive deep into the topics then these are for you:

If you love watching tutorials and then code the same:

Some other channels for basic/advanced android concepts (mostly you will find kotlin):

I will suggest not to watch old videos as many libraries and Classes gets deprecated(removed) with time.

I hope if you have reached upto this line, you are surely a focussed guy and keeps interest in android development. So whats there to wait. Begin your journey now๐Ÿš€. All the best ๐Ÿ’ซ

Did you find this article valuable?

Support LearnDroid by becoming a sponsor. Any amount is appreciated!

ย