0% found this document useful (0 votes)
4 views

Exercise 1 - Download and install Android studio

The document provides a comprehensive guide for downloading and installing Android Studio, detailing system requirements for Windows, MacOS, and Linux. It outlines steps for creating a virtual device to run apps on the Android Emulator, as well as instructions for running apps on physical Android devices via USB or Wi-Fi. Additionally, it describes the project structure, user interface, and Gradle build system used in Android Studio.

Uploaded by

vupdn.23it
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Exercise 1 - Download and install Android studio

The document provides a comprehensive guide for downloading and installing Android Studio, detailing system requirements for Windows, MacOS, and Linux. It outlines steps for creating a virtual device to run apps on the Android Emulator, as well as instructions for running apps on physical Android devices via USB or Wi-Fi. Additionally, it describes the project structure, user interface, and Gradle build system used in Android Studio.

Uploaded by

vupdn.23it
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Download and install Android Studio

1. Check system requirements


Android Studio systems requirements:
*Windows:
- 64-bit Microsoft® Windows® 8/10/11
- x86_64 CPU architecture; 2nd generation Intel Core or newer, or AMD CPU with
support for a Windows Hypervisor
- 8 GB RAM or more
- 8 GB of available disk space minimum (IDE + Android SDK + Android Emulator)
- 1280 x 800 minimum screen resolution
*MacOS:
- MacOS® 10.14 (Mojave) or higher
- ARM-based chips, or 2nd generation Intel Core or newer with support
for Hypervisor.Framework
- 8 GB RAM or more
- 8 GB of available disk space minimum (IDE + Android SDK + Android Emulator)
- 1280 x 800 minimum screen resolution
*Linux:
- Any 64-bit Linux distribution that supports Gnome, KDE, or Unity DE; GNU C Library
(glibc) 2.31 or later.
- x86_64 CPU architecture; 2nd generation Intel Core or newer, or AMD processor with
support for AMD Virtualization (AMD-V) and SSSE3
- 8 GB RAM or more
- 8 GB of available disk space minimum (IDE + Android SDK + Android Emulator)
- 1280 x 800 minimum screen resolution
2.Download and install Android Studio
https://developer.android.com/studio
3.Run your app on the Android Emulator
3.1.Create an AVD
To run an Android app in an emulator on your computer, you first create a virtual device:
- In Android Studio, select Tools > Device Manager.

1
- The Device Manager dialog opens. If you created a virtual device previously, it's
listed in this dialog.

- Click Create Virtual Device, the Virtual Device Configuration dialog appears.
The dialog shows a list of pre-configured devices, organized by category, from
which you can choose. For each device, the table provides a column for its display
size (in inches), screen resolution (in pixels), and pixel density (number of pixels
per inch).

- Select Phone as the category.


2
- Select a phone, such as the Pixel 5, and then click Next.
- This step opens another screen where you can choose the version of Android to run
on your virtual device. This lets you test your app on different versions of Android:
+ If there's a download link, click Download > Accept > Next > Finish. The
presence of the download link indicates that the image isn't installed on your
computer, in which case you must install the image before you can configure the
virtual device.
+ Choose the version of Android and click Next.

- Choose additional configuration details for your device.

3
- In the AVD Name field, enter a name for your AVD or use the default. Leave the
rest of the fields unchanged. Click Finish. This action returns to the Android
Virtual Device Manager pane.

- Close the Device Manager dialog.


3.2.Run your app on the Android Emulator
- Select the virtual device that you created from the dropdown menu at the top of the
Android Studio window.

- Click .
- The virtual device starts just like a physical device. Expect this to take a while—
potentially several minutes—for the emulator to start for the first time. The virtual
device should open beside the code editor.

- When your app is ready, it opens on the virtual device.

4
4.Run your app on the Android device
4.1.Enable USB debugging
To let Android Studio communicate with your Android device, you must enable USB
debugging in the Developer options settings of the device.
To show developer options and enable USB debugging:
- On your Android device, tap Settings > About phone.
- Tap Build number seven times.
- If prompted, enter your device password or pin. You know you succeeded when you
see a You are now a developer! message.

- Return to Settings and then tap System > Developer options. If you don't
see Developer options, tap Advanced options.

5
- Tap Developer options and then tap the USB debugging toggle to turn it on.

Install the Google USB Driver (Windows only):


If you installed Android Studio on Windows, you must install a USB device driver before
you can run your app on a physical device.
- In Android Studio, click Tools > SDK Manager. The Preferences > Appearance
& Behavior System Settings > Android SDK dialog opens.
- Click the SDK Tools tab.
- Select Google USB Driver and then click OK.

6
4.2.Run your app on the Android device with a cable
- Connect your Android device to your computer with a USB cable. A dialog should
appear on your device, which asks you to allow USB debugging.

- Select the Always allow from this computer checkbox and then tap OK.
- In Android Studio on your computer, make sure your device is selected in the
dropdown. Click .

- Select your device and then click OK. Android Studio installs the app on your
device and runs it. If your device runs an Android platform that isn't installed in
Android Studio and you see a message that asks whether you want to install the
needed platform, click Install > Continue > Finish. Android Studio installs the app
on your device and runs it.
4.3.Run your app on the Android device with Wi-Fi
If you don't have a cable, you can also connect and run your app on your device with Wi-
Fi.
- Ensure that your computer and device are connected to the same wireless network.
- Ensure that your device runs Android 11 or higher. For more information, see Check
& update your Android version.

7
- Ensure that your computer has the latest version of Android Studio. To download
it, see Android Studio.
- Ensure that your computer has the latest version of the SDK Platform Tools.
Pair your device:
- In Android Studio, select Pair Devices Using Wi-Fi from the run configurations
drop-down menu. The Pair devices over Wi-Fi dialog opens.

- Go to Developer options, scroll down to the Debugging section and turn


on Wireless debugging.

- On the Allow wireless debugging on this network? popup, select Allow.

8
- If you want to pair your device with a QR code, select Pair device with QR
code and then scan the QR code on your computer. Alternatively, if you want to
pair your device with a pairing code, select Pair device with pairing code and then
enter the 6-digit code.
- Click run and you can deploy your app to your device.
5.Android studio
5.1.Project structure
Each project in Android Studio contains one or more modules with source code files and
resource files. Types of modules include:
- Android app modules
- Library modules
- Google App Engine modules

9
All the build files are visible at the top level under Gradle Scripts and each app module
contains the following folders:
- manifests: Contains the AndroidManifest.xml file.
- java: Contains the Java source code files, including JUnit test code.
- res: Contains all non-code resources, such as XML layouts, UI strings, and bitmap
images.
5.2.The user interface
The Android Studio main window is made up of several logical areas:.

1. The toolbar lets you carry out a wide range of actions, including running your app and
launching Android tools.

10
2. The navigation bar helps you navigate through your project and open files for editing.
It provides a more compact view of the structure visible in the Project window.
3. The editor window is where you create and modify code. Depending on the current
file type, the editor can change. For example, when viewing a layout file, the editor
displays the Layout Editor.
4. The tool window bar runs around the outside of the IDE window and contains the
buttons that allow you to expand or collapse individual tool windows.
5. The tool windows give you access to specific tasks like project management, search,
version control, and more. You can expand them and collapse them.
6. The status bar displays the status of your project and the IDE itself, as well as any
warnings or messages.
5.3.Gradle build system
Android Studio uses Gradle as the foundation of the build system, with more Android-
specific capabilities provided by the Android plugin for Gradle. This build system runs as
an integrated tool from the Android Studio menu, and independently from the command
line. You can use the features of the build system to do the following:
- Customize, configure, and extend the build process.
- Create multiple APKs for your app, with different features using the same project
and modules.
- Reuse code and resources across sourcesets.
By employing the flexibility of Gradle, you can achieve all of this without modifying your
app's core source files. Android Studio build files are named build.gradle. They are plain
text files that use Groovy syntax to configure the build with elements provided by the
Android plugin for Gradle. Each project has one top-level build file for the entire project
and separate module-level build files for each module. When you import an existing
project, Android Studio automatically generates the necessary build files.

References:
https://developer.android.com/codelabs/basic-android-kotlin-compose-install-android-
studio#0
https://developer.android.com/codelabs/basic-android-kotlin-compose-connect-
device?continue=https%3A%2F%2Fround-lake.dustinice.workers.dev%3A443%2Fhttps%2Fdeveloper.android.com%2Fcourses%2Fpathways%2
Fandroid-basics-compose-unit-1-pathway-2%23codelab-
https%3A%2F%2Fround-lake.dustinice.workers.dev%3A443%2Fhttps%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-
compose-connect-device#0
https://developer.android.com/studio/intro

11

You might also like