Ex.
No : 1
INTRODUCTION TO MOBILE TECHNOLOGY AND DEVICES
Date :
AIM :
To give detailed study about Mobile Technology and Devices.
DESCRIPTION:
Mobile technology is a technology that is portable.
Mobile technology is technology that goes where the user goes.
It consists of portable two-way communications devices, computing devices and the networking
technology that connects them.
The communications networks that connect these devices are loosely termed wireless
technologies.
They enable mobile devices to share voice, data and applications.
Advantages of mobile technology
Benefits of using mobile technology for business can manifest in:
higher efficiency and productivity of staff
the quality and flexibility of service you offer your customers
the ability to accept payments wirelessly
increased ability to communicate in and out of the workplace
greater access to modern apps and services
improved networking capabilities
Mobile Devices
Smartphones
Tablets
Laptop computers
Smart watches
E-readers
Handheld gaming consoles
Mobile Devices and Their Uses
Smartphones
With the rise of Android and iOS, smartphones are the most popular mobile device.
These devices are handheld, can fit in a pocket, have a million and one uses, and help keep us
connected at all times thanks to a constant network connection from a wireless carrier.
Tablets
A tablet really shines when performing tasks that would be more suitable for a larger display with
more battery life.
Some examples include work presentations, heavy gaming, or even live streaming of shows in
high definition on Netflix.
Laptop Computers
These devices have always been popular because they give us the functionality of a desktop
computer that we can take anywhere.
We can use the same operating system with the same programs, which means there is no device
learning curve.
Having a full-sized keyboard, the same input/output ports and the ability to connect an external
display are some added benefits as well.
Smart watches
The main benefits a smart watch can provide us with are the ability to get notifications and
necessary information on our wrist without having to pick up another device.
With some of the new standalone models, we can even take and receive phone calls just like our
smartphones can.
E-readers
These devices share some commonalities with a tablet, but their primary purpose is for reading.
The Amazon Kindle and Barnes & Noble Nook have made the e-reader a popular choice for
people who enjoy reading books in a digital format.
Handheld Gaming Consoles
Some of the most well-known mobile gaming devices we have today include the Nintendo Switch
and the Nintendo 3DS.
Gaming is now one of the most popular forms of entertainment, and there will always be a need
for such devices.
RESULT:
Thus the detailed study about Mobile Technology and devices is done successfully.
EX NO: 2
INTRODUCTION TO ANDROID APPLICATION DEVELOPMENT
DATE:
AIM :
To give detailed study about Android application development.
DESCRIPTION:
THE ANDROID OPERATING SYSTEM:
Android is an mobile operating system based on the Linux kernel.
Android is similar to Symbian, iOS, Windows Mobile, and others.
It was initially developed by Android Inc., a company later purchased by Google.
It is now owned by the Open Handset Alliance and is fully open sourced, accounting for its
growing popularity.
The Android system supports background processing, provides a rich user interface library,
supports 2-D and 3-D graphics using the OpenGL-ES (short OpenGL) standard and grants
access to the file system as well as an embedded SQLite database.
While Android applications are written in the Java language, there's no Java Virtual Machine in
the platform, and Java byte code is not executed. Java classes are recompiled into Dalvik
executables and run on a Dalvik virtual machine.
Dalvik is a modified VM for Android and optimized devices running on battery power and
with low CPU.
For developers, Android SDK provides a rich set of tools, including debugger, libraries,
handset emulator, documentation, sample code, and tutorials.
Android applications can be easily developed using Eclipse (Android's official development
platform) with the help of a plug-in called Android Development Tools (ADT).
A wide array of widgets, which are similar to Java swing widgets, facilitate in creating a rich
UI for the apps.
ANDROID FEATURES:
Reuse and replacement of components
Dalvik virtual machine
Integrated browser
Optimized graphics
SQLite
Media support
GSM Telephony
Bluetooth, EDGE, 3G, and WiFi
Camera, GPS, compass, and accelerometer
Rich development environment
ANDROID PLATFORM COMPONENTS:
The Android system is a full software stack, which is typically divided into the four areas:
The levels can be described as:
Applications - The Android Open Source Project contains several default application, like the
Browser, Camera, Gallery, Music, Phone and more.
Application framework - An API which allows high-level interactions with the Android system
from Android applications.
Libraries and runtime - The libraries for many common functions (e.g.: graphic rendering, data
storage, web browsing, etc.) of the Application Framework and the Dalvik runtime, as well as
the core Java libraries for running Android applications.
Linux kernel - Communication layer for the underlying hardware.
The Linux kernel, the libraries and the runtime are encapsulated by the application
framework. The Android application developer typically works with the two layers on top to
create new Android applications.
APPLICATION COMPONENTS
Activity
◦ Present a visual user interface for one focused endeavor the user can undertake
◦ Example: a list of menu items users can choose from
Services
◦ Run in the background for an indefinite period of time
◦ Example: calculate and provide the result to activities that need it
Broadcast Receivers
◦ Receive and react to broadcast announcements
◦ Example: announcements that the time zone has changed
Content Providers
◦ Store and retrieve data and make it accessible to all applications
◦ Example: Android ships with a number of content providers for common data types (e.g.,
audio, video, images, personal contact information, etc.)
Intents
◦ Hold the content of a message
◦ Example: convey a request for an activity to present an image to the user or let the user
edit some text
ANDROID VERSION NUMBERS AND NAMES:
Beta versions: Astro and Bender
1.5: Cupcake
1.6: Donut
2.0 and 2.1: Eclair
2.2: Froyo (FROzen YOgurt)
2.3: Gingerbread
3.x: Honeycomb (a tablet-only version)
4.0: Ice Cream Sandwich
4.1, 4.2 and 4.3: Jelly Bean
4.4: KitKat
5.0 and 5.1: Lollipop
6.0 and 6.0.1: Marshmallow
7.0 to 7.1: Android Nougat
8.0 to Android 8.1: Android Oreo
9.0: Android Pie
10:
11:
SYSTEM REQUIREMENTS:
Android Development Tools (ADT)
Eclipse SDK
Android SDK
jdk-7u80-windows-i586
CREATE AN ANDROID VIRTUAL DEVICE:
This step is required in creating an Android phone emulator/Android Virtual Device (AVD)
on which applications can be run and tested.
Steps to create an AVD:
1. In Eclipse, choose Window > Android SDK and AVD Manager.
2. Select Virtual Devices in the left panel.
3. Click New. The Create New AVD dialog appears.
4. Type the name of the AVD, such as "myPhone."
5. Choose a target. The target is the platform to be run on the emulator.
6. Click Create AVD.
Once the AVD is launched, you can see how it gives the complete look and feel of a real
Android-based mobile phone, complete with keyboard and multi-touch support. It can also be used
in a variety of configurations to test your app, such as landscape/portrait mode, network strength,
and roaming network, etc.
CREATE A NEW ANDROID PROJECT:
From Eclipse, select File > New > Android Application Project. Select it and click Next.
You will be prompted to fill in the following details in a form:
Project name— This is the name of your project and can be something like "HelloWorld."
Application name— This is the name that will appear everywhere in your Android device,
along with the icons in the menu, in the shortcuts, and on the title bar when you run your
application. This can be something like "Hello Android."
Package name—com.example.helloandroid. The package name follows the same rules as
those in the Java language.
Create activity—This is the name for the class stub that will be generated by ADT. This
will be a subclass of Android's Activity class. An activity is simply a class that can run and
do some work. An application may contain one or more activities. They are typically on a
1:1 relationship with the screens found in an application. An application moves from one
activity to another by calling a method known as startActivity() or startSubActivity().
Min SDK version— This specifies the minimum API level required by your application.
THE ANDROID MANIFEST:
Configuration of your Android application:
The components and settings of an Android application are described in the AndroidManifest.xml file.
This file is known as the manifest file or the manifest. The Android manifest file must also contain the
required permissions for the application. For example, if the application requires network access, it
must be specified here. The manifest also specifies additional metadata for the application, e.g., icons
and the version number of the application. This file is read by the Android system during installation
of the application. The Android system evaluates this configuration file and determines the capabilities
of the application.
RESULT:
Thus the detailed study about Android application development is done successfully.
EX NO: 3
DEVELOP AN APPLICATION THAT USES GUI COMPONENTS,
DATE: FONT AND COLORS
AIM:
To develop an application that uses GUI components, Fonts and colors using Eclipse.
PROCEDURE:
1. Start the application by
Click on File -> New and choose Android Application Project and type the application name for the
project and click on the next button.
2. Configure the project by choosing the workspace location and then click the next button.
3. Configure the Launcher Icon by choosing the attributes of icon sets like foreground image,
scaling, shape and its background color and then click on to next button.
4. Create an activity by selecting blank activity and then click next.
5. A blank activity will be created and finally click finish button.
6. On clicking the finish button a new project will be created from which the java code and layout
code can be opened.
7. Go to res folder and select layout. Double click the main.xml file and type the code.
8. Run the emulator before execute the application by,
Windows Virtual Device managercreate new emulator first timeset the propertiesLaunch the
emulator
9. Run the project by right clicking on your project in Package Explorer window on the left and
choose Run As => Android Application.
10. Watch the deployment preparation for the app by checking the bottom-right of Eclipse for
deployment progress.
11. Now the application is opened in the emulator for use.
PROGRAM:
Activitymain.xml:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world"/>
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="50dp"
android:layout_marginTop="50dp"
android:text="Text From XML"
android:textSize="30dp"
android:textStyle="bold"
android:typeface="serif"
android:textColor="#0000CD"
android:background="#87CEEB"/>
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="welcome"
android:textSize="40sp"
android:textStyle="bold"
android:typeface="monospace"
android:textColor="#0000CD"
android:shadowColor="#ff0000"
android:shadowRadius="1.5"
android:shadowDx="2"
android:shadowDy="2"/>
OUTPUT:
RESULT:
Thus the application using GUI components, fonts and colors was successfully Created using
eclipse.
EX NO: 4
Develop an application that uses Layout Managers and event listeners
DATE:
AIM:
To develop an application that uses Layout Managers and event listeners using Eclipse.
PROCEDURE:
1. Start the application by
Click on File -> New and choose Android Application Project and type the application name for the
project and click on the next button.
2. Configure the project by choosing the workspace location and then click the next button.
3. Configure the Launcher Icon by choosing the attributes of icon sets like foreground image,
scaling, shape and its background color and then click on to next button.
4. Create an activity by selecting blank activity and then click next.
5. A blank activity will be created and finally click finish button.
6. On clicking the finish button a new project will be created from which the java code and layout
code can be opened.
7. Go to res folder and select layout. Double click the main.xml file and type the code.
8. Go to project explorer and select src folder.Now select mainactivity.java file and type the
following code.
9. Run the emulator before execute the application by,
Windows Virtual Device managercreate new emulator first timeset the propertiesLaunch the
emulator
10. Run the project by right clicking on your project in Package Explorer window on the left and
choose Run As => Android Application.
11. Watch the deployment preparation for the app by checking the bottom-right of Eclipse for
deployment progress.
12. Now the application is opened in the emulator for use.
PROGRAM:
Activitymain.xml:
<LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:gravity="center_horizontal"
android:background="#1EBAFF"
>
<EditText
android:id="@+id/ed1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textColor="#800000"
android:textSize="2dp"
android:textStyle="italic"
/>
<requestFocus />
</EditText>
<EditText
android:id="@+id/ed2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPassword" />
<Button
android:id="@+id/bu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ok" />
</LinearLayout>
Main Activity.java:
packagecom.example.ex;
importandroid.os.Bundle;
importandroid.app.Activity;
importandroid.view.Menu;
importandroid.view.View;
importandroid.widget.Button;
importandroid.widget.EditText;
importandroid.widget.Toast;
public class MainActivity extends Activity
{
EditText ed1,ed2;
Button bu;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ed1=(EditText)findViewById(R.id.ed1);
ed2=(EditText)findViewById(R.id.ed2);
bu=(Button)findViewById(R.id.bu);
bu.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
String a = ed1.getText().toString();
String b = ed2.getText().toString();
if(a.equals("Welcome")&&b.equals("abcd")){
Toast.makeText(getApplicationContext(), "success", Toast.LENGTH_LONG).show();
}
Else
{
Toast.makeText(getApplicationContext(), "", Toast.LENGTH_LONG).show();
}
}
});
}
@Override
protected void onResume() {
// TODO Auto-generated method stub
super.onResume();
}
@Override
publicbooleanonCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
}
OUTPUT:
RESULT:
Thus the application that uses Layout Managers and event listeners was successfully
Created.