Android Tutorial

Android Tutorial Android Toast Button Widget In Android Tutorial Imageview Widget In Android Android Date Picker Example Android Time Picker Example Android Operating System Android Activity Android Architecture Android Content Providers Android Edittext Android Emulator Android Fragments Android Gridview Android Broadcast Receivers Event Handling In Android What Is Android Studio Android Navigation Drawer Android Recyclerview Android Scrollview Android Navigation Android Operating System Android ListView Android Studio Resources Android Studio's Layout Editor Android TextView Android Styles and Themes How To Show Image On An Android Application How To Insert An Email In Android Application In Android Version 8 How To Insert The Mobile Number On An Android Application Using Edittext Difference between android developer and web AdapterViewFlipper in Android with Example Android 9.0 Pie vs. Android 10, which one is better Android Development or Web Development which one is the best to choose Android Project Folder Structure Assets folder in Android How to reduce the size of APK in Android Top 7 Android App Development Books Top Programming Languages for Android Development Android Navigation Application Components Difference between android developer and web developer Event Handling in Android How to reduce the size of APK in Android Top 7 Android App Development Books Top Programming Languages for Android Development AdapterViewFlipper in Android with Example Android 9.0 “Pie” vs. Android 10, which one is better Android Development or Web Development which one is the best to choose Android EditText Android Fragments How to Update Gradle in Android Studio Navigation Drawer ScrollView What is Android Studio? Android Architecture Android Content Providers

What is Android Studio

Android Studio powered by the IntelliJ platform is an integrated development environment (IDE) and is officially recognized for developing androidapplications. Its foundation lies on JetBrains' IntelliJ IDEA and is specialized for the development of android applications.

It is currently available to install on Windows, Linux, and macOSoperating systems. The Eclipse Android Development Tools which was earlier considered as key IDE for native Android application development was substituted by Android Studio.

On May 16, 2013, Android Studio IDE was disclose the Google Input/Output conference. In May 2013, it was previewed for early access in version 0.1 and then launched in beta testing starting from version 0.8 in June 2014.In December 2014, the first stable build was released starting from version 1.0.

Kotlin substituted Java as Google's preferred programming language for Android app development on May 7, 2019. But currently, Java is still supported by Android Studio, as is C++ (for native coding).

Features:

  • Anadjustable Gradle-based build system
  • It provides acombined environment in which you can develop for all Android devices such as phones, watches, tablets, etc.
  • Able to push changes to your running app without building or creating a new APK
  • Provides code templates and Git integration to help you import sample code and build common app features
  • A high-speed and fully featured emulator
  • It provides lint tools for determining performance, version compatibility, and other issues
  • Vast testing tools and frameworks for your app testing purposes
  • Integration with Google Cloud Platform (GCP), making it easy to deploy Google App Engine and Google Messaging services
  • Provides C++ and NDK support
  • Provides Visual layout editor
  • Plug-in architecture used to extend Android Studio with plugins

Creating a new Android Project:

We can create a new Android project by following these steps:

What is Android Studio?

Android Studio welcome screen

  • If you have an existing project opened, select File -> New -> New Project option and follow the remaining steps.
  • Then the Select a Project Template window appears and in this select Empty Activity and click on the Next button.
What is Android Studio?

Select a Project Template Window

  • Now in the Configure your project window, you need to complete the following steps:
    • Enter your project name as per your requirement in the Name text field.
    • Enter "com.example.projectname" in the Package name text field. (In the latest versions of Android studio, it auto generates the package name)
    • If you may want to store the project in a different location, change its Save location as per your need.
    • Select either Kotlin or Java programming language from the Language drop-down menu.
    • Select the minimal version of Android that your app will support in the Minimum SDK drop-down menu.
    • If the app will need legacy library support, mark the Use legacy android.support libraries checkbox.
    • Leave the other options unchanged.
What is Android Studio?

Configure your Project Window

  • Click on the Finish button.

It may require some seconds to set up your project to bring up the Android Studio main window.

Android Studio might take a moment to review and download the most important files such as gradle files and several dependencies.

What is Android Studio?

Android Studio Main Window

Initially, check that the project window is open (choose [View] > [Tool Window] > [Project]) and make sure the Android view is selected in the drop-down list at the top of the window.

You can see the structure of the project and the following files:

  1. app > java > com.example.projectname>MainActivity: By default, it's the entry point for your app. When you build and run your application on an emulator or your device, the system will create an instance of this Activity and will load its respective layout.
  2. app > res > layout > activity_main.xml: This XML file defines the design for the activity's user interface (UI) which shows how it will be displayed on a user’s screen. By default, it contains a TextView with the text "Hello, World!"
  3. app > manifests > AndroidManifest.xml:The manifest file describes the basic characteristics of the app and the required permissions such as Location or Internet access permissions and defines each component.
  4. Gradle Scripts:In this there are 2 build.gradle files:
    1. Project level, "Project: My First App," and
    2. App module level, "Module: app."

Each module of the android project has its own build.gradle file. We can use each module's build.gradle file to control how the Gradle plugin builds your app.