Android Application Development Practical Guide, Cheat Sheet of Data Mining

A practical guide to android application development, covering essential aspects such as setting up the development environment, understanding various components, and designing activities using different layouts. It includes step-by-step instructions for installing android studio, configuring the sdk and avd manager, and creating a hello world application. The document also explains the structure of an android application and demonstrates methods of the activity life cycle, making it a valuable resource for students and developers learning to build mobile applications. It also covers linearlayout, relativelayout, gridview, framelayout, and constraintlayout. Useful for university students and lifelong learners.

Typology: Cheat Sheet

2024/2025

Uploaded on 07/30/2025

km-urvashi-shri
km-urvashi-shri 🇮🇳

6 documents

1 / 65

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Practical No– 01
Set-up of Android development environment, managing AVD and understanding its various
components.
Android development environment:
Step 1: Install Android Studio
Download Android Studio from the website: https://developer.android.com/studio Run
the downloaded installer and follow the installation wizard instructions.
During the installation, select the components that we want to install, such as the Android SDK,
emulator, and development tools.
Step 2: Launch Android Studio
After the installation is complete, launch Android Studio.
Step 3: Configure SDK and AVD Manager
On the Android Studio Welcome screen, click on "Configure" in the bottom-right corner and
select "SDK Manager."
The SDK Manager allows us to install SDK components, platform versions, and system images
for different device configurations.
Step 4: Install SDK Platforms and System Images
In the SDK Platforms tab, install the Android versions (API levels) that we want to target in our
app. For example, Android 11 (API 30).
Step 5: Create an AVD (Android Virtual Device)
After installing the necessary SDK components, click on "AVD Manager".
In the AVD Manager, click "Create Virtual Device."
Choose the device type we want to emulate (e.g., Pixel 4) and click "Next."
Select a system image for the virtual device and click "Next."
Configure the AVD properties (e.g., device orientation, scale, RAM, and storage) and click
"Finish" to create the AVD.
Step 6: Run the AVD
Back in the AVD Manager, click the green "Play" button next to the AVD we created to start the
virtual device.
The AVD will start up, and the Android system running on the virtual device.
Step 7: Use AVD for Testing
In Android Studio, open Android project.On the toolbar, select AVD from the device dropdown
menu. Click the "Run" button to run app on the selected AVD.
Prepared By: VPMP Polytechnic, Department of Computer Engineering Page 1
50703Subject Code: 43
Mobile Application Development Using Android
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41

Partial preview of the text

Download Android Application Development Practical Guide and more Cheat Sheet Data Mining in PDF only on Docsity!

Practical No– 01

Set-up of Android development environment, managing AVD and understanding its various components. Android development environment: Step 1: Install Android Studio Download Android Studio from the website: https://developer.android.com/studio Run the downloaded installer and follow the installation wizard instructions. During the installation, select the components that we want to install, such as the Android SDK, emulator, and development tools. Step 2: Launch Android Studio After the installation is complete, launch Android Studio. Step 3: Configure SDK and AVD Manager On the Android Studio Welcome screen, click on "Configure" in the bottom-right corner and select "SDK Manager." The SDK Manager allows us to install SDK components, platform versions, and system images for different device configurations. Step 4: Install SDK Platforms and System Images In the SDK Platforms tab, install the Android versions (API levels) that we want to target in our app. For example, Android 11 (API 30). Step 5: Create an AVD (Android Virtual Device) After installing the necessary SDK components, click on "AVD Manager". In the AVD Manager, click "Create Virtual Device." Choose the device type we want to emulate (e.g., Pixel 4) and click "Next." Select a system image for the virtual device and click "Next." Configure the AVD properties (e.g., device orientation, scale, RAM, and storage) and click "Finish" to create the AVD. Step 6: Run the AVD Back in the AVD Manager, click the green "Play" button next to the AVD we created to start the virtual device. The AVD will start up, and the Android system running on the virtual device. Step 7: Use AVD for Testing In Android Studio, open Android project.On the toolbar, select AVD from the device dropdown menu. Click the "Run" button to run app on the selected AVD.

Practical No– 02

Understanding of Various Components available in Android Application. Android applications are built using various components that interact with each other to provide the desired functionality and user experience. Activities : An activity represents a single screen with a user interface. It is the most fundamental component of an Android app and is responsible for interacting with the user. An application may consist of one or multiple activities. Each activity extends the Activity class and typically corresponds to a specific user interaction. Fragments : Fragments are modular sections of an activity that can be combined and reused across multiple activities. They are useful for creating responsive user interfaces, especially on devices with varying screen sizes. Fragments extend the Fragment class and are managed by activities. Services : A service is a component that runs in the background, independent of any user interface. It performs long-running operations or handles tasks that should continue to execute even when app is not in the foreground. Services can be used to play music, download data, or handle network transactions. Broadcast Receivers : A broadcast receiver is a component that listens for and responds to system- wide broadcasts. These broadcasts can be sent by the Android system or other apps. Broadcast receivers allow your app to respond to events, such as incoming SMS messages, network connectivity changes, or battery status updates. Content Providers : A content provider allows the app to share data with other apps securely. It acts as an interface to access and manage the app's data, which can be stored in a database, file, or any other data source. Content providers enable inter-app data sharing, allowing other apps to read or modify the data based on defined permissions. Intents : Intents are messaging objects used to communicate between components within an app or between different apps. They facilitate starting activities, services, or broadcasting events. Intents can carry data along with them to pass information between components. Layouts : Android uses XML-based layout files to define the user interface of an activity or fragment. These layout files specify how different UI elements are arranged and displayed on the screen. Resources : Android apps use resources such as strings, colors, styles, and images. These resources are kept separately from the code, allowing for easy localization and management.

Practical No– 04

AIM:- Develop Android Application to demonstrate methods of Activity Life Cycle. MainActivity.java

import android.os.Bundle; import android.app.Activity; import android.view.Menu; import android.widget.Toast; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Toast.makeText(MainActivity.this,"onCreate method called",Toast.LENGTH_LONG).show(); } @Override protected void onStart() { super.onStart(); Toast.makeText(MainActivity.this,"onStart method called",Toast.LENGTH_LONG).show(); } @Override protected void onResume() { super.onResume(); Toast.makeText(MainActivity.this,"onResume method called",Toast.LENGTH_LONG).show(); } @Override protected void onRestart() { super.onRestart(); Toast.makeText(MainActivity.this,"onRestart method called",Toast.LENGTH_LONG).show(); }

Practical No– 05

AIM:- Design Android Activities using LinearLayout, RelativeLayout, GridView, FrameLayout, and ConstraintLayout. LinearLayout: activity_main.xml

**RelativeLayout: activity_main.xml**

GridView: activity_main.xml

**FrameLayout: activity_main.xml** **ConstraintLayout: activity_main.xml**

Practical No– 06

AIM:- Design various Activities using different Layouts and available Widgets (TextView, EditText, Button, RadioButton, CheckBox, ImageButton, ToggleButton, TimePicker, DatePicker, ProgressBar, ImageView) to make the user-friendly GUI.

1. MainActivity (Linear Layout with EditText and Button):