Differences

This shows you the differences between two versions of the page.

Link to this comparison view

dapm:laboratoare:01 [2019/02/18 16:02]
george.stoica0310
dapm:laboratoare:01 [2021/03/07 09:26] (current)
ioana_maria.culic
Line 1: Line 1:
-===== Laboratorul ​01=====+===== Lab 01 - Install Android Studio ​=====
 ==== Objectives ==== ==== Objectives ====
   * Install and use the Android Studio IDE.   * Install and use the Android Studio IDE.
Line 25: Line 25:
   - Open Android Studio if it is not already opened.   - Open Android Studio if it is not already opened.
   - In the main **Welcome to Android Studio** window, click **Start a new Android Studio project**.   - In the main **Welcome to Android Studio** window, click **Start a new Android Studio project**.
-  - In the **Create New Project** window, choose **Empty Activity** for the **Phone or Tablet** and click **Next**: ​          ​{{:​dapm:​laboratoare:​lab01_choose_empty_activity.png?​300|300 }} +  - In the **Create New Project** window, choose **Empty Activity** for the **Phone or Tablet** and click **Next**: ​          ​{{:​dapm:​laboratoare:​lab01_choose_empty_activity.png?​400|400 }} 
-  - In the **Configure your project** section, enter **Hello World** for the **Application Name**, leave the other settings to their default state{{:​dapm:​laboratoare:​lab01_hello_world_name.png?​300|300 }}+  - In the **Configure your project** section, enter **Hello World** for the **Application Name**, leave the other settings to their default state{{:​dapm:​laboratoare:​lab01_hello_world_name.png?​400|400 }}
  
   - Click **Finish**   - Click **Finish**
Line 48: Line 48:
   - 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**).{{:​dapm:​laboratoare:​lab01_select_hardware.png?​400|400 }}   - 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**).{{:​dapm:​laboratoare:​lab01_select_hardware.png?​400|400 }}
   - Choose a device such as **Nexus 5x** or **Pixel XL**, and click **Next**. The **System Image** screen appears.   - Choose a device such as **Nexus 5x** or **Pixel XL**, and click **Next**. The **System Image** screen appears.
 +  - Click the **Recommended** tab if it is not already selected, and choose which version of the Android system to run on the virtual device (such as **Oreo**).{{:​dapm:​laboratoare:​lab01_emulator_system_image.png?​400|400 }}
 +  - After choosing a system image, click **Next**. The **Android Virtual Device** (AVD) window appears. You can also change the name of the AVD. Check your configuration and click **Finish**.
 +=== Run the app on the virtual device ===
 +Now we will run the Hello World app
 +  - In Android Studio, choose **Run** > **Run app** or click the Run icon {{:​dapm:​laboratoare:​run_app.png?​15|15}} ​ in the toolbar.
 +  - The **Select Deployment Target** window, under **Available Virtual Devices**, select the virtual device, which you just created, and click **OK**{{:​dapm:​laboratoare:​lab01_select_deployment_target.png?​400|400 }}
  
 +The emulator starts and boots just like a physical device. Depending on the speed of your computer, this may take a while. Your app builds, and once the emulator is ready, Android Studio will upload the app to the emulator and run it.
 +
 +You should see the Hello World app as shown in the following figure.
 +{{:​dapm:​laboratoare:​lab01_app_running.png?​200|200}}
 +
 +**Tip**: When testing on a virtual device, it is a good practice to start it up once, at the very beginning of your session. You should not close it until you are done testing your app, so that your app doesn'​t have to go through the device startup process again. To close the virtual device, click the **X** button at the top of the emulator, choose **Quit** from the menu, or press **Control-Q** in Windows or **Command-Q** in macOS.
 +
 +===Bonus===
 +  - Make the app display your name instead of the Hello World message
 +  - Run the app on a physical device instead of the emulator
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