Learn Android App Development And Run Your First Hello World App

Let’s conquer your fear of software development by running your first android app. It’s easier than you think, I promise.

Android Development Article Image
Article Image

Target Audience – For Whom This Blog Is Written

  1. Curious to start android app development
  2. Introduction to Native Application Development
  3. Learn the benefits of Native Application Development
  4. Learn the features of Android Studio
  5. Want a quick guideline to download, install, and configure Android Studio on their computer.
  6. Want to learn quick tips and tricks with Android Studio to optimize their app development process
  7. Searching for necessary computer specifications to install Android Studio.
  8. Quick Introduction to Android Studio Interface
  9. Install And Run your first hello world application on Android Emulator and also in your physical device connected with USB or wifi.

Introduction And Benefits Of Native App Development

There are lots of definitions of the native applications over the web, which are very very technical. Thus new developers pass a hard time understanding what is a native application. So let’s keep it simple and non-technical.

Developed for a specific platform E.g: Developing native android application means it will only run on android mobile devices. Android, iOS, Windows are three major mobile operating systems. If you write a separate code for each mobile platform, then it is called a native application for that specific platform. In a simple scenario, if  John, a mobile application developer, writes an application that can be only run on Android smartphones, then he can say that he has written a native android application.

It’s also possible to develop an application only one time and run it in every smart-phone running on Android, iOS, Windows. As that type of application is not developed for any specific mobile platform, that’s why that application is not a native application. They are called hybrid applications.

Developers have to use JAVA or KOTLIN for native android application development. In our case, we will use java for android development.

There are several benefits of developing native applications over hybrid applications. Some have listed below.

  1. Native applications are very fast.
  2. They are easily approved on app stores. E.g: Native application for Android can be easily approved on Google Playstore
  3. Native apps are very interactive and run smoothly.
  4. You can use all the features of the phone. You can work with any part of the hardware easily. E.g: Developers can use GPS, compass, accelerometer, or other sensors data, microphone, etc easily if they are building a native application.
  5. Native apps are smaller than hybrid apps(non-native or cross-platform apps)

    Naive App vs Hybrid App Comparison

 

All Features And Benefits Of Using Android Studio

Android Studio is an IDE or Integrated Development Environment. Using Android Studio, a developer can build apps for Android phones, tablets, Android Wear, Android TV, and Android Auto. It is developed by Google. It comprises various useful tools like Android Virtual Device Manager or AVD and the Android Device Monitor.

Android Studio releases update very often to give developers the most enhanced experience possible. You can write code in JAVA or KOTLIN and design customized UI using dropdown elements as well as writing code in XML. That’s amazing flexibility for developers and designers. A large number of developers use Android Studio that means you won’t face much problem if you stuck somewhere in your journey.

Let’s see some quick features of Android Studio that impress developers.

  1. Code editor with rich features.
  2. You can see pre-declared classes and functions documentation from the code editor while coding
  3. All necessary features essential for smoothing coding experience is present in Android Studio
  4. Provides an environment where you can develop an application for all android devices
  5. Code testing, debugging, performance monitoring facilities available
  6. Provides built-in support for Google Cloud Platform.

System Requirement

The system requirement for your computer to run Android Studio is provided by the official site of Android App Developers.

Minimum Requirement on Windows
  1. OS: Microsoft Windows 7/8/10
  2. CPU: No requirements given from the official website
  3. RAM: 4 Gigabytes
  4. Disk Space: 2 Gigabytes
  5. Screen Resolution: 1280 x 800
Recommended system requirement on windows
  1. CPU: No requirements given from the official website
  2. RAM: 8 Gigabytes
  3. Disk Space: 4 Gigabytes

Despite above-mentioned requirements, you should have

  1. CPU having clock speed 2.5GHz or more with virtualization enabled.
  2. SSD (minimum 256 Gigabytes )will be a performance booster. Android Studio doesn’t run smoothly with HDD. Recommended 4 Gigabytes disk space for initial installation. You will need to download and install more packages with time. You have to install multiple emulators which will consume much disk space over time. Your all software, along with your android studio SDKs, emulators are installed inside a single drive, most probably in C drive. With time, you will install more software and need more disk space. Buying an SSD is a long term investment that will serve you years after years.
  3. A large monitor is helpful for coders to write codes and debug them. It’s not mandatory but useful

 

Install Android Studio On Windows 10

  1. Download Android Studio from the official website. Here is the link.
    Download Android Studio

     

  2. Before Downloading Android Studio,Agree to Terms and Conditions
    Agree Terms And Conditions And Start Download

     

  3. Make sure “virtualization” is turned on.
    Check Virtualization Status

     

  4. Run Android Studio as Administrator permission.
    Run As Administrator

     

  5. Allow User Access Control
    Allow User Account Control

     

  6. Wait until setup finishes loading.
    Android Studio Setup Loading

     

  7. Click Next.
    Setup Welcome Screen

     

  8. Make sure you have selected to install “Android Virtual Device” and click next.
    Select Components

     

  9. Leave the installation location as it is and select next.
    Choose Installation Location

     

  10. Untick “don’t create shortcut” and select install
    Create A Program Shortcut

     

  11. Wait Until installation completes.
    Installation Has Started

     

  12. After completing the installation, the “Next” button becomes clickable. Click on Next.
    Installation Has Completed And Go To Next Step

     

  13. Give a tick mark on “Start Android Studio” and select “Finish”.
    Start Android Studio

     

  14. You can see Android Studio is starting for configuration

    Loading Android Studio

  15. Select Next to configure the development environment.

    Setup Wizard

  16. Select setup type “Standard” and click Next

    Setup Wizard Installation Type

  17. Choose a UI theme that you like. We will go with “light” them but you can choose “dark” , if you want. After that select “Next”.

    Setup Wizard Theme Selection

  18. If any warning is shown then change the folder location as shown in the picture. This warning is shown due to the presence of whitespace in the folder path. If no warning is shown then skip this step.
    Select Android SDK Location

    Change Your Android SDK Location

    Change Android SDK Install Directory Step 1
    Change Android SDK Install Directory Step 2
    Change Android SDK Install Directory Step 3
    Change Android SDK Install Directory Step 4
    Change Android SDK Install Directory Step 5

    Change Android SDK Install Directory Step 6

  19. Give tick in the tickbox to install components as shown in the picture and Select Next.
    Please choose separate instruction for Intel and AMD CPUs, as shown in the picture. Intel HAXM doesn’t work with AMD processors, in fact, gives errors. That’s why you should avoid installing Intel HAXM on AMD processor and only install them if your computer uses Intel CPUs.
    Select Components For Intel Cpu

    Select Components For Non Intel Cpu Or AMD Cpu

  20. Select Finish

    Setup Wizard Verify Settings

  21. Wait until Android Studio Finishes downloading Components. Make sure you are connected with the internet as components are being downloaded from the internet.
    You can use see details option to see which components are being downloaded.
    Downloading Components
    See Currently Downloading Components Details

    Make sure all the components are successfully downloaded and installed without any error.

  22. After Completing Download Click Finish.

    Setup Wizard Downloading Components Have Finished

  23. Now This window will show up.You can start your project from here.
    Android Studio First Time Launched

     

Create Your First Hello World Project

  1. Create a new project
    Create First App Android Studio By Starting A New Project

    Create First App Android Studio By Starting A New Project Alternative Method

  2. Select Empty Activity and Click On Next

    Select Project Template- Empty Activity

  3. Give a name of your application. Application name should have white space between words.Make sure first letter of every word, separated by white space, is capital.
    Configure Your Project – Select App Name Or Project Name

    Use “Reverse Domain Name” to create package.Let make this matter clear by an example. Lets assume , the company domain name of the application is “samsofts.com” where “com” is top level domain and “samsoft” is second level domain. By using the reverse domain name , we can set our package name “com.samsofts.currencyconverter”. So the general format is for package name is
    “TopLevelDomain.SecondLevelDomain.ApplicationName” .

    Configure Your Project – Select Package Name

    Select a location of your choice to save your project files. Make sure there is no whitespace in the file path.We have seen how to change file paths before in “Installing and Configure Android Studio On Windows 10” section ,while installing Android Studio, in the same page that you are visiting now.

    Configure Your Project – Select Project Location

    Select “Java” Language and leave the minimum SDK as default (15) and Click on Finish.

    Configure Your Project – Select Project Language And Minimum SDK Version

  4. Wait while Gradle Build is running.Wait until it completes.
    Project Starting – Gradle Build Running

    Android Project Started – Gradle Build Finished

 

Enable Debugging Mode On Android Phone Run Hello World Application On Physical Device

If you want to run your application on your physical device, then you have to follow the steps listed below. You can follow this method if your computer has a weak processor and RAM less than 8 Gigabytes.

  1. To run an application on your android device, developed using Android Studio, you must enable “USB debugging”. “USB debugging” is disabled by default.
  2. Navigate to Build number and tap 7 times to enable developer options.Android 9 and higher: Settings > About Phone > Build Number
    Android 8.0.0  and Android 8.1.0 (API level 26): Settings > System > About Phone > Build Number
    Android 7.1  and lower: Settings > About Phone > Build Number
  3. Now Navigate to Developer options and enable USB DebuggingAndroid 9 and higher: Settings > System > Advanced > Developer Options > USB debuggingAndroid 8.0.0 and Android 8.1.0 (API level 26): Settings > System > Developer Options > USB debuggingAndroid 7.1 and lower: Settings > Developer Options > USB debugging
  4. Now after connecting your android phone with your computer, you might encounter a prompt titled “Allow USB debugging?”. Just simply select Ok.
  5. Now you can see your device listed on the drop-down menu. Select your physical device.
  6. Click Run and your application will be built and installed on your Android Phone.

Create Android Virtual Device And Android Phone Run Hello World Application On Emulator

If you have a powerful computer and you want to test your applications on an emulator rather than connecting with your physical device, then you can follow this method.

  1. Open Android Virtual Device Manager. Create a Virtual Device.

    Open And Create Virtual Device

  2. Select Any Pre-defined device of your choice. Here, we will select Pixel 2

    Select Hardware -Predefined Device

  3. You can download any recommended image if there is no pre-downloaded image and select that image after download it. Then click on Next.
    Download Recommended System Image
    Select Downloaded Recommended System Image

    Or, You can select x86 Image and look for a pre-downloaded image file. If no pre-downloaded x86 image is found then download one and then select that.

    Select Downloaded x86 System Image

    Avoid selecting Deprecated images.

    Avoid Selecting Deprecated System Image

  4. Leave every configuration as it is and click on Finish.

    Verify Configuration Of Android Virtual Device

  5. Select Your Device And Run Hello World Application
Select Device
Build And Run Application On Selected Device

Run Hello World Application On Physical Device Connected With Wifi

You can install and run any android application on your physical device without USB connection if your computer and mobile are connected to the same wifi network. To do so, please follow the instructions.

  1. Navigate to gettings.
    Navigate To Settings

     

  2. Navigate to Plugins. From Market Place Download and install “Android wifi ADB”, after than restart Android Studio.
    Download And Install Android Wifi ADB

    Restart Android Studio IDE After Installing Plugin

  3. Make sure your computer and android device is connected with same wifi network. Connect your Android Phone with computer , for the first time.
  4. Select Android wifi ADB , connect with your android device and after it says connected, remove the usb cable connection between your computer and smartphone
    Open Android Wifi ADB To Connect Android Studio And Physical Device

    Android Studio And Physical Device Are Connected

  5. Now simply select your physical device from the drop-down menu and run it.

    Select Physical Device Or Connected Smartphone

  6. Your android application will install and run in your android device. Thus you can run an android application on a smartphone from Android Studio without connecting your smartphone through USB.
  7. Select Your Device And Run Hello World Application.

    Run App On Smartphone

Top Tips And Tricks For Getting Most Out Of Android Studio

Every tips and trick mentioned below, images are provided as an example for better understanding.

  1. Search Anything In Everywhere: It enables you to find classes, functions, files (assets, layout files, image, and audio resources) containing the letters of the searched word. Press shift key twice (On Windows and Mac ) and search everywhere menu will pop up.

    Search Anything In Everywhere

  2. Fast And Easy Documentation Lookup: Instead of searching documentation for pre-defined classes and functions on the browser, you can check for the documentation on android studio. To check the documentation of pre-defined classes or functions, highlight that class or function and press Ctrl+Q (On Windows) or Command+J (On Mac) and the documentation will popup. If the documentation is not popping up, then you have to download documentation from SDK manager discussed on Run And Configure Android Studio After Installation For Smooth App Development Experience section of this blog.

    Easy Documentation Lookup Shortcut

  3. Useful Actions(e.g Run, Instant Run, Find, Replace, etc…) Lookup And Shortcut Finder: If you want to find certain quick actions like Run, Instant Run, Find, Replace, etc… then you can use Find Action menu. Just press CTRL+Shift+A(On Windows) or Command+Shift+A (On Mac) and Find Action Menu will appear. Just search for the action name and the action and related other actions will appear.

    Useful Actions Lookup And Build, Run, Debug, Finder Shortcut

  4. Automatic Override Methods: While extending the pre-defined classes, certain methods need to be overridden. Android Studio can generate boilerplate codes for you. Press Ctrl+O (For Windows) or Command+O (For Mac) and a list of methods that you can override will popup.
  5. Collapse Blocks Of Codes: You don’t look, neither you don’t work with the entire codebase at a time. You can collapse every block of codes and you can manually expand only those blocks you are currently working. It improves your coding experience.
    Before Collapsing Block Of Codes

    After Collapsing Block Of Codes

  6. Automatic Code Reformatting: Instead of formatting your code manually, you can format your code automatically by pressing CTRL+ALT+L (on Windows) or Command+Option+L (on Mac).
    Before Code Formatting

    After Code Re-Formatting

 

 

Summary
Article Name
Learn Android App Development
Description
You don't know anything about android application development, right? Read the world's easiest and comprehensive guide to android app development. Start reading now!!
Author

Leave a Comment