Android App Development Video Tutorials



Android was developed by the Open Handset Alliance, led by Google, and other companies. This tutorial will teach you basic Android programming and will also take you through some advance concepts related to Android application development. This tutorial has been prepared for the beginners to help them understand basic Android programming. The Android operating system is changing our lives in so many ways and also enabled enterprises to develop into big names in the IT business. It has the bigg. Android OS is created using Java, so knowledge about Java is always a benefit if you want to develop an app for Android. Then, you will need to get Android SDK, which is Android’s basic app writing program like Android Studio or Eclipse, the Java Software Development Kit (JDK). Android accounts for approximately 85% of all devices sold today (2017 Q1). It only makes sense for you to be developing applications for the Android platform. I will take you through the basics of Android Application development, and introduce some more complex features as. The Flutter tutorials teach you how to use the Flutter framework to build mobile applications for iOS and Android. Choose from the following: Building layouts How to build layouts using Flutter’s layout mechanism. Once you’ve learned basic principles, you’ll build the layout for a sample screenshot. Adding interactivity to your.

In this tutorial, we will create a simple yet fully-functional Android application that counts how many times you tap a droid image. After that, we will run it on an Android virtual device.

This tutorial covers a simple scenario to help you get started with Android development in IntelliJ IDEA. For comprehensive how-to guides and reference documentation, visit the Android Studio user guide.

App

Create a new Android project

Create a project

  1. Launch IntelliJ IDEA. On the Welcome screen, click New Project. If you already have a project open, from the main menu select File | New | Project.

  2. In the New Project wizard, select Android on the left.

    If you don't have the Android SDK configured, IntelliJ IDEA will detect this and prompt you to download it:

  3. Select the components you want to install. If you haven't installed the Android SDK tools before, all the required components will be preselected.

    Optionally, modify the location for the Android SDK, and click Next:

  4. Review the installation settings and click Finish to start the download:

  5. When all components have been downloaded and installed, click Finish:

  6. Select Empty Activity as the project template:

  7. On the last step, type HelloDroid as the project name and select Java as the language:

Configure project JDK

Now that we have created our first project, let's make sure it uses the correct JDK.

  1. From the main menu, choose File | Project Structure and go to Platform Settings | SDKs. Select the Android SDK and make sure that the correct Java version is selected in the Java SDK field.

    We recommend that you use Java SE 11 or Java SE 8 for Android development in IntelliJ IDEA. If you don't have the correct JDK installed, in the Project Structure dialog, click the Add New SDK button on the toolbar and select Download JDK:

  2. In the Settings/Preferences dialog Ctrl+Alt+S, go to Build, Execution, Deployment | Build Tools | Gradle and select the correct Java version (8.x or 11.x).

Explore the project structure

For Android projects, there's a dedicated view in the IntelliJ IDEA Project tool window: click Project in the top-left corner and select Android.

This view doesn't reflect the actual hierarchy of files on your disk - it is organized by modules and file types to ease navigation between source files of your project. Note that it hides project files and directories that you don't commonly use (to see them, choose the Project view):

The app folder consists of the following subfolders:

  • manifests: contains the AndroidManifest.xml file, which holds general information about the application processed by the Android operating system. Among other things, it declares the package name that serves as a unique identifier for your application and the minimum version of the Android SDK required for the device where the application will run. It also declares the entry points of the application, along with permissions the application requires. For details, see App Manifest Overview.

  • java: contains the Java source code files grouped by packages, including JUnit tests.

  • res: contains all non-code resources, such as XML layout files, UI strings, images, and so on.

The Gradle Scripts folder contains all the project's build-related configuration files.

Edit the UI layout

At this stage, the user interface of our sample HelloDroid application is based on a very simple layout defined in the activity_main.xml file located in the res/layout folder.

Let us modify the auto-generated user interface and see how the application layout is rendered without running it on any physical or virtual device.

Open the UI designer

  1. In the Android project view, go to the app/res/layout and double-click the activity_main.xml file to open it. Note that since IntelliJ IDEA downloads the components required to render layout files, opening it may take a few seconds.

    If the UI designer fails to open, and you get the Design editor is unavailable until after a successful project sync error, press Ctrl+Shift+A, search for the Sync Project with Gradle Files action, and wait for the sync to finish.

    By default, IntelliJ IDEA provides a graphical view of the layout file, but you can also switch to the source code view, or view the text and the graphical representation side by side - use the icons in the top-right corner of the UI Designer pane:

    This pane shows a rectangular canvas that is synchronized with the layout definition and with the Component Tree, so any changes to the canvas are reflected there accordingly.

    Normally, layout files have a layout manager as their root element (for example, LinearLayout, FrameLayout, ConstraintLayout, and so on). In our example, the root element in activity_main.xml is ConstraintLayout that is responsible for positioning the elements of the application interface. For the purpose of this tutorial, we are not going to modify it, but you can learn more about designing interfaces from Build a Responsive UI with ConstraintLayout.

  2. To eliminate distraction and only see how your layout is represented, click the Select Design Surface icon in the top-left corner and choose Design:

  3. Now let's delete the existing text element. To do this, right-click the text label and choose Delete from the context menu.

Now the UI layout looks like the following, and we are ready to start designing the layout of our application:

Add image to the UI layout

Now let's add a droid image to our layout.

  1. In the Android project view, expand the app/res folder and drag the image you want to use into the drawable folder. For this tutorial, we've downloaded a Hello Droid image from the internet and saved it with the dimensions 50x50 px.

  2. Return to the activity_main.xml file opened in the Designer pane, from the Palette choose the ImageView element, and drag it to the canvas to the position where you want the image to appear.

  3. In the Pick a Resource dialog that opens, choose the resource file you've added and click OK:

  4. Next, we need to modify the default id of the imageView element to be able to reference it later.

    Select it in the Component Tree and in the Attributes pane on the right, enter the new identifier in the id field: droidImage. Press Enter; in the dialog that opens, confirm that you want to update all references to the image element id:

Add text to the UI layout

Now let's add some text to our layout.

  1. In the Palette pane, pick the TextView element and drag it to the canvas below the image.

    The widget displays some default text: TextView. To change it and link it to a string, we need to create a new text resource.

  2. Select the textView element in the Component Tree on the left. In the Attributes pane on the right, click the Pick a Resource icon next to the text attribute:

  3. In the dialog that opens, click the Add resource to the module icon in the top left corner and choose String Value.

  4. In the New String Value dialog, enter the resource name (welcome_text) and the resource value (Hello! I'm a droid.):

  5. Click OK to save the value and then click OK in the Pick a Resource dialog.

  6. Now let's modify the textView element id the same way we did with imageView.

    Select textView in the Component Tree on the left, and in the Attributes pane set the id to a new value: clickCounter.

Add style to text

Now let's add some style to the text to make it look more appealing.

  1. Pad the text a bit: locate the padding attribute, and set all values to 10dp:

  2. Change the font color: locate the textColor attribute, and click the Pick a Resource icon next to it.

    In the dialog that opens, click the Add resource to the module icon in the top left corner and choose Color Value.

    Enter the resource name (text_color) and the value (#9C27B0):

  3. Change the font size: locate the TextSize property and and click the Pick a Resource icon next to it.

    In the dialog that opens, click the Add resource to the module icon in the top left corner and choose Dimension Value.

    Enter the resource name (text_size) and the value (24sp):

As a result, your user interface now looks like the following:

To check what your application UI looks like in landscape orientation, click the Orientation for Preview icon on the Designer toolbar and choose Landscape:

To preview what your layout looks like on different devices, select another device from the device list:

Make the application interactive

Although our sample application is fully functional at this point, it does not support any form of interaction yet. Let's modify it to support tap events.

  1. In the Android project view, locate the MainActivity file under appjavacom.example.hellodroid and double-click to open it.

  2. MainActivity is not a very meaningful class name, so let's rename it.

    Right-click this file in the Android project view and choose Refactor | Rename from the context menu or press Shift+F6. In the dialog that opens, change the class name HelloDroidActivity and click Refactor:

    All references to this class will be updated automatically, and your application's source code will look as follows:

  3. Replace the code in HelloDroid.java with the following:

    package com.example.hellodroid; import android.os.Bundle; import android.view.View; import android.widget.ImageView; import android.widget.TextView; import androidx.appcompat.app.AppCompatActivity; public class HelloDroidActivity extends AppCompatActivity { private TextView message; private int counter = 0; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); message = findViewById(R.id.clickCounter); ImageView droid = findViewById(R.id.droidImage); //Define and attach click listener droid.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { tapDroid(); } }); } private void tapDroid() { counter++; String countAsText; /* * In real applications you should not write switch like the one below. * Use resource of type 'Quantity strings (plurals)' instead. * See https://developer.android.com/guide/topics/resources/string-resource#Plurals */ switch (counter) { case 1: countAsText = 'once'; break; case 2: countAsText = 'twice'; break; default: countAsText = String.format('%d times', counter); } message.setText(String.format('You touched the droid %s', countAsText)); } }

    Note that the identifiers we've used in the source code correspond to those we've set in our layout definition file, otherwise our code would not work.

Build and run the application

Now let's build our application and run it on a virtual device.

Configure Android virtual device

First of all, to be able to run our application, we need to configure a virtual device.

  1. In the main IntelliJ IDEA toolbar, click the devices list and choose AVD Manager:

  2. On the first step of the wizard, click Create Virtual Device:

  3. On the next step, we need to select the hardware that our virtual device will emulate.

    Let's select Phone on the left, and choose Pixel 2 as the target device:

  4. Choose the system image you want to mimic on the virtual device, that is the OS version, the Android API level, the application binary interface (ABI), and the target SDK version:

  5. Click the Download link next to the system image you want to mimic on the virtual device. For this tutorial, we've chosen to download the R system image.

    In the License Agreement dialog that opens, read the license agreement and accept it, then click Next and wait for the download to finish. When the system image has been downloaded, select it and click Next in the System Image step of the wizard.

  6. On the last step, you can modify your virtual device name and select the startup size and orientation of the screen. Choose the portrait layout and click Finish:

  7. The newly configured device appears in the Android Virtual Device Manager.

Run the application

Android Development Tutorial Ppt

  1. On the main IntelliJ IDEA toolbar, make sure the automatically created Run configuration and the virtual device we've just configured are selected and click :

    The Android emulator will launch after the build has successfully finished, with our application started:

  2. Click the droid image and see how the application processes the tap events, counts them and returns the corresponding message:

Making Mobile Apps with App Inventor

We have four beginner tutorials to try out. We recommend starting with Hello Codi!, but any of the four tutorials are accessible for novice coders. They can all be completed within an hour timeframe.

For each tutorial, we have multiple ways of accessing them:

  • Click the tutorial link to open up a project directly in the App Inventor environment with the tutorial in the sidebar. This is our recommended way to complete the tutorials. Note that each of these can also be used for Hour of Code events.
  • If you prefer, you can click on the video links to follow the tutorial in a video. Please note, this requires you have two windows open in the browser - one to play the video, and one to run App Inventor.
  • We also have links to pdf files for each tutorial, for those of you who prefer following text instructions.

Android App Development Book Pdf

After building the starter apps, which will take around an hour, you can move on to extending them with more functionality, or you can start building apps of your own design.