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

Android rjd3

Uploaded by

Rahul Jadhaw
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Android rjd3

Uploaded by

Rahul Jadhaw
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

EXPERIMENT NO 4

Aim / Title: Study of UI in Android

Problem Statement: Build the First Android Application Hello World to understand the
basics of Android.

Objectives: Student should be able to design their own UI for android application using
XML

Outcomes: Student will demonstrate the basic application using UI in android

Pre-requisite: Java, Object Oriented Programming, APIs, Databases

Hardware requirements: A 64-bit environment, At least 250GB of free disk space, Memory
of 4 GB RAM or more

Software requirements: Android SDK tools 22.0.5, Java Runtime Environment 1.6, Java
SE JDK v6.0, Android Studio

Theory:

Create Android Application

The first step is to create a simple Android Application using Android studio.
When you click on Android studio icon, it will show screen as shown below
You can start your application development by calling start a new android studio
project. in a new installation frame should ask Application name, package
information and location of the project.−

After entered application name, it going to be called select the form factors your
application runs on, here need to specify Minimum SDK, in our tutorial, I have
declared as API23: Android 6.0(Mashmallow) –
The next level of installation should contain selecting the activity to mobile, it
specifies the default layout for Applications.

At the final stage it going to be open development tool to write the application
code.
Anatomy of Android Application

Before you run your app, you should be aware of a few directories and
files in the Android project –

Sr.No. Folder, File & Description

Java
1 This contains the .java source files for your project. By default, it
includes an MainActivity.java source file having an activity class
that runs when your app is launched using the app icon.

res/drawable-hdpi
2 This is a directory for drawable objects that are designed for high-
density screens.

res/layout
3
This is a directory for files that define your app's user interface.

res/values
4
This is a directory for other various XML files that contain a
collection of resources, such as strings and colours definitions.

AndroidManifest.xml
5 This is the manifest file which describes the fundamental
characteristics of the app and defines each of its components.

Build.gradle

6 This is an auto generated file which contains compileSdkVersion,


buildToolsVersion, applicationId, minSdkVersion,
targetSdkVersion, versionCode and versionName

The Main Activity File


The main activity code is a Java file MainActivity.java. This is the actual
application file which ultimately gets converted to a Dalvik executable
and runs your application. Following is the default code generated by
the application wizard for Hello World! application −

Here, R.layout.activity_main refers to the activity_main.xml file located


in the res/layout folder. The onCreate() method is one of many methods
that are figured when an activity is loaded.
The Layout File
The activity_main.xml is a layout file available in res/layout directory, that is
referenced by your application when building its interface. You will
modify this file very frequently to change the layout of your application.
For your "Hello World!" application, this file will have following content
related to default layout −
Running the Application
Let's try to run our Hello World! application we just created. To run the
app from Android studio, open one of your project's activity files and
click Run icon from the tool bar. Android studio installs the app on
your AVD and starts it and if everything is fine with your set-up and
application, it will display following Emulator window –

Conclusion:

Sample Viva Questions and Answers:

Roll Name of Date of Date of Grade Sign of Sign of


No. Student Performance Evaluation Student Faculty
0818IT Rahul
211048 Jadhaw
Q1. How to create android virtual machine?

You might also like