//
you're reading...
Uncategorized

Getting Started with Android – App Developing

Android Studio is a famous tool for developing android apps. We started developing app with android studio. Initially we will see how to create “Hello World!” project and then we create a new interface for the app that takes some user inputs and opens a second screen in the app.

First install latest version of Android Studio.

Welcome Window
  • In the welcome of android studio window, click on Start a new project then choose empty project.
  • Click next.
  • In Configure your project window Name the app like “My First App”
  • Change project location if you want.
  • Leave the other options as they are.
  • Select your desired programming language from language drop down.
  • Click finish.

In project window select View > Tool Window > Project and select Android View. You will see these files:

app > java > com.example.myfirstapp > MainActivity

This is the main activity for your app.  When you build and run the app, the system launches an instance of this Activity and loads its layout.

app > res > layout > activity_main.xml

This XML file determines the layout for the activity’s UI. It contains a “TextView” element with the text “Hello world!”.

app > manifests > AndroidManifest.xml

The manifest file describes the fundamental characteristics of the app and defines each of its components.

Gradle Scripts > build.gradle

                There will be two files with this name one for project and one for module.

You can run your app in two situations, in a real device and in a virtual device

To set up your real device as follow these steps:

  1. Connect your device to your development machine with a USB cable. If you’re developing on Windows, you might need to install the appropriate USB driver for your device.
  2. Enable USB debugging in the Developer options as follows.

First, you must enable the developer options:

  1. Open the Settings app.
  2. (Only on Android 8.0 or higher) Select System.
  3. Scroll to the bottom and select About phone.
  4. Scroll to the bottom and tap Build number 7 times.
  5. Return to the previous screen to find Developer options near the bottom.

Open Developer options, and then scroll down to find and enable USB debugging.

Run the app on your device as follows:

  1. In Android Studio, click the app module in the Project window and then select Run > Run (or click Run in the toolbar).
  2. In the Select Deployment Target window, select your device, and click OK.

Android Studio will install the app on your connected device and start it. You should now see “Hello World!” displayed in the app running on your device.

To run your app in a virtual device, follow these steps:

  • In Android Studio, click the app module in the Project window and then select Run > Run (or click Run in the toolbar).
  • In the Select Deployment Target window, click Create New Virtual Device.
  • In the Select Hardware screen, select a phone device, such as Pixel, and then click Next.
  • In the System Image screen, select the version with the highest API level. If you don’t have that version installed, a Download link is shown, so click that and complete the download.
  • Click Next.
  • On the Android Virtual Device (AVD) screen, leave all the settings alone and click Finish.
  • Back in the Select Deployment Target dialog, select the device you just created and click OK.

Discussion

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Categories

%d bloggers like this: