Learn How to Develop Android Application

Introduction:

Welcome to Android application development!

Here i am going to teach to you how to build your first Android app in Android Studio.

Development Environment:

Before you start this class, be sure you have your development environment set up. You need to:
  1. Download Android Studio.
  2. Download the latest SDK tools and platforms using the SDK Manager.

Create New Project:

An Android project contains all the files that comprise the source code for your Android app.
This lesson shows how to create a new project using Android Studio.

Steps:

  1. In Android Studio, create a new project:
    • If you don't have a project opened, in the Welcome screen, click New Project.
    • If you have a project opened, from the File menu, select New Project.



  2. Under Configure your new project, follow below steps.
    • Application Name is the app name that appears to users. For this project, use "My First App."
    • Company domain provides a qualifier that will be appended to the package name; Android Studio will remember this qualifier for each new project you create.
    • Package name is the fully qualified name for the project. Your package name must be unique across all packages installed on the Android system. You can Edit this value independently from the application name or the company domain.
    • Project location is the directory on your system that holds the project files.
3. Under Select the form factors your app will run on, check the box for Phone and Tablet.
4. For Minimum SDK, select API 8: Android 2.2 (Froyo).
   The Minimum Required SDK is the earliest version of Android that your app supports, indicated using the API level. To support as many devices as possible, you should set this to the lowest version available that allows your app to provide its core feature set.
5. Leave all of the other options (TV, Wear, Android Auto and Glass) unchecked and click Next.
6. Under Add an activity to mobile, select Blank Activity and click Next.
7. Under Customize the Activity,  change the Activity Name to MyActivity. The Layout Name changes to activity_my, and the Title to MyActivity. The Menu Resource Name ismenu_my.
8. Click the Finish button to create the project.
Your Android project is now a basic "Hello World" app that contains some default files. Take a moment to review the most important of these:
app/src/main/res/layout/activity_my.xml
This is the XML layout file for the activity you added when you created the project with Android Studio. In this XML contains one Relative Layout and one Text View. This Text View contains the text called "Hello Sandy!!!".







app/src/main/java/com.mycompany.myfirstapp/MyActivity.java
This is the java file for the activity you added when you created the project with Android Studio. When you build and run the app, the Activityclass starts the activity and loads the layout file that says "Hello Sandy!!!".
app/src/main/AndroidManifest.xml
The manifest file describes the fundamental characteristics of the app.components.
app/build.gradle
          Android Studio uses Gradle to compile and build your app. 
drawable/
          Here you can store images that should be in "png " formate. Various densities  such as medium-density (mdpi) and high-density (hdpi) screens.
layout/
       Directory for files that define your app's user interface like activity_my.xml, discussed above, which describes a basic layout for the MyActivity class.
menu/
       Directory for files that define your app's menu items.
values/
      Directory for other XML files that contain a collection of resources, such as string and color definitions. The strings.xml file defines the "Hello world!" string that displays when you run the default app.

Running Your App On Real Device:

           If you have a device running Android, here's how to install and run your app.
  1. Plug in your device to your development machine with a USB cable.
  2. Enable USB debugging on your device.
  • On Android 4.0 and newer, it's in Settings > Developer options.
Note: On Android 4.2 and newer, Developer options is hidden by default. To make it available, go to Settings > About phone and tap Build number seven times. Return to the previous screen to find Developer options.


Run the app from Android Studio:

  1. Select one of your project's files and click Run  from the toolbar.
  2. In the Choose Device window that appears, select the Choose a running device radio button, select your device, and click OK .
Android Studio installs the app on your connected device and starts it.
Here the below figure shows of our result:



I hope this article was helpful for beginners trying to create a simple Project using Android Studio .

I will come with new interesting topics in android in further articles.




Sandeep K

Android developer
Nanite Solutions
sandeep@nanitesol.com
+91 - 7411868235


                                                                                                        
                                                                                          Thanks,

                                                                                          Guided by: Praveen Kumar,Co-founder and President,                                                                                               Nanite Solutions, praveen.kumar@nanitesol.com


Other blogs by the author
55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 

Comments

Unknown said…
A verry good article for android developers
Unknown said…
It good article

Popular posts from this blog

Internet of Things - MindMap

Creating a Mobile Strategy: Find out the top 10 ways!

Trends in Cloud Computing for 2016 and Beyond