This is an old revision of the document!


Laboratorul 01.

Objectives

  • Install and use the Android Studio IDE.
  • Use the development process for building Android apps.
  • Create a simple Hello World Android project.

Installing Android Studio

Android Studio provides a complete integrated development environment (IDE) including an advanced code editor and a set of app templates. In addition, it contains tools for development, debugging, testing, and performance that make it faster and easier to develop apps. You can test your apps with a large range of preconfigured emulators or on your own mobile device, build production apps, and publish on the Google Play store.

Android Studio is available for computers running Windows or Linux, and for Macs running macOS. The newest OpenJDK (Java Development Kit) is bundled with Android Studio.

To get up and running with Android Studio, first check the system requirements to ensure that your system meets them. The installation is similar for all platforms. Any differences are noted below.

Steps for installation

  1. Navigate to the Android developers site and follow the instructions to download and install Android Studio.
  2. Accept the default configurations for all steps, and ensure that all components are selected for installation.
  3. After finishing the install, the Setup Wizard will download and install some additional components including the Android SDK. Be patient, this might take some time depending on your Internet speed, and some of the steps may seem redundant.
  4. When the download completes, Android Studio will start, and you are ready to create your first project.

Installation videos

Below are installation videos for different platforms:

Create a Hello World app

Create the app project

  1. Open Android Studio if it is not already opened.
  2. In the main Welcome to Android Studio window, click Start a new Android Studio project.
  3. In the Create New Project window, choose Empty Activity for the Phone or Tablet and click Next: 300
  4. In the Configure your project section, enter Hello World for the Application Name, leave the other settings to their default state300
  1. Click Finish

Android Studio creates a folder for your projects, and builds the project with Gradle (this may take a few moments).

Tip: See the Configure your build developer page for detailed information.

You may also see a “Tip of the day” message with keyboard shortcuts and other useful tips. Click Close to close the message.

If you made all the previous steps correctly, you should see something like this: 500

Use a virtual device (emulator)

For the Hello World app will use the Android Virtual Device (AVD) manager to create a virtual device (also known as an emulator) that simulates the configuration for a particular type of Android device, and use that virtual device to run the app. Note that the Android Emulator has additional requirements beyond the basic system requirements for Android Studio.

Using the AVD Manager, you define the hardware characteristics of a device, its API level, storage, skin and other properties and save it as a virtual device. With virtual devices, you can test apps on different device configurations (such as tablets and phones) with different API levels, without having to use physical devices.

Create an Android virtual device (AVD)

In order to run an emulator on your computer, you have to create a configuration that describes the virtual device.

  1. In Android Studio, select Tools > AVD Manager. Your Virtual Devices screen appears. If you've already created virtual devices, the screen shows them (as shown in the figure below); otherwise you see a blank list.400
  2. Click the +Create Virtual Device. The Select Hardware window appears showing a list of pre configured hardware devices. For each device, the table provides a column for its diagonal display size (Size), screen resolution in pixels (Resolution), and pixel density (Density).400
  3. Choose a device such as Nexus 5x or Pixel XL, and click Next. The System Image screen appears.
dapm/laboratoare/01.1550498522.txt.gz · Last modified: 2019/02/18 16:02 by george.stoica0310
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0