You are on page 1of 10

Departamento de Engenharia Informática

Minds-On

Building Your First Android App

Paulo Baltarejo Sousa


pbs@isep.ipp.pt
2016
1 Creating an Android Project
If you did not have a project opened, Android Studio shows the Welcome
screen. To create a new project, click Start a new Android Studio Project.

If you had a project already opened, Android Studio shows the develop-
ment environment. To create a new project, click File > New Project.

1
1. The next window lets you configure the name of your app, the package
name, and the location of your project. Click Next.

2. Select Form Factors and API Level. The next window lets you select
the form factors supported by your app, such as phone, tablet, TV,
Wear, and Google Glass. The selected form factors become the app
modules within the project. For each form factor, you can also select

2
the API Level for that app. To get more information, click Help me
choose.

Click Next.

3. Add an Activity.

3
Choose an activity type (in this case select EmptyActivity) then click
Next.

4. Configure Your Activity.

4
Enter the activity name, the layout name, and the activity title (it
suggests some default names). Then click Finish.

5. Develop your app.

The project creation is done and the development environment is like


that.

2 Running "First App"


1. In the Android Studio, click Run from the toolbar.

5
2. if you have a physical Android device connected and a suitable AVD
the Choose Device window will appear providing the choice between
running within the emulator or on a connected physical Android device:

6
2.1 Run on a Real Device
If you have a physical Android device, here’s how you can install and run
your app:

1. Plug in your device to your development machine with a USB cable.


You might need to install the appropriate USB driver for your device.

2. Enable USB debugging on your device.

• On most devices running Android 3.2 or older, you can find the
option under Settings > Applications > Development.
• On Android 4.0 and newer, it’s in Settings > Developer op-
tions. 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.

3. From Choose Device window select the real device and click OK.

4. Android Studio installs the app on your connected device and starts it.

7
2.2 Run on the Emulator
To run your app on the emulator you need to first create an Android Virtual
Device (AVD). An AVD is a device configuration for the Android emulator
that allows you to model different devices.

1. From Choose Device window select the AVD device and click OK.

2. Android Studio installs the app on your connected device and starts it.

8
9

You might also like