Sunteți pe pagina 1din 132

Introduction to Java ME (J2ME)

Java ME (J2ME) stands for Java 2 MicroEdition. Whereas J2EE (Java 2 Enterprise
Edition) refers to the specs that govern the use of java in distributed server side environments,
and while J2SE (Java 2 Standard Edition) addresses the needs of the desktop, Java ME (J2ME)
targets the extremely diverse array of consumer and handheld devices that have suddenly
proliferated like wildfire in recent years.

The relationship between the three can be thought of as a superset-subset one, with Java
ME (J2ME) being a subset of J2SE, while itself being a subset of J2EE.

The problem for SUN and its partners was the extremely diverse range of devices that the
Java ME (J2ME) was supposed to target, with the minimal devices having as little as 1 kb of
RAM and 24 kb of ROM (and small or no screens), while the larger, more capable devices had
nearly the capabilities of desktops. Java ME (J2ME) needed to be extremely flexible in meeting
the demands of all these target devices.

On the one hand, they wanted some portability going from one small device to another.
On the other hand, the range of these devices in terms of memory, speed, and other capabilities
was daunting.

They could have:

Created an all-encompassing architecture that would have contained every single


available and possible API, BUT this would mean that lower end devices would be overburdened
because of their memory constraints.
• Created an architecture for the lowest common-denominator, which would mean
stripping most everything out of the Java ME (J2ME).

They decide on neither --- What they finally decided on was to make the Java ME
(J2ME) extrememly modular, with particular profiles targeted at specific devices, BUT with
most portability maintained across configurations.

Configurations and Profiles

These two are what make the Java ME (J2ME) extremely flexible and modular, but at the
same time they cause lots of confusion among beginner programmers.

Configurations are targeted towards a horizontal group of devices, meaning devices that
have similar memory constraints, similar user interface requirements, similar network
capabilities, etc. It's the minimum platform (VM, core java classes) that will support a relatively
broad range of similar devices (e.g. low and medium end PDAs and cellphones could be placed
in the same configuration because they

may have similar requirements and needs as noted above). There are two current configurations:
The CDC (Connected Device Configuration), for capable devices such as Symbian EPOC
Communicators and high end PDAs; and CLDC (Connected Limited Device Configuration), for
low end PDas and such limited devices as cell phones, pagers, and smart cards.

Profiles sit on top of a configuration and will not work without the underlying
configuration. Profiles target devices in a specific vertical market (e.g. MIDP profile, which is
part of the CLDC configuration targets low end cellphones. There is a PDA profile in the works
which will also be in the CLDC). Profiles contain the java classes that focus on specific
implementations such as user interface components and record managment (ie. where and how to
store persistent data).

The image below represents the relationships between the different Java ME (J2ME)
configurations and profiles. Click on the respective profiles/configurations for more information.
The different profiles are based upon two configuration: the CDC (Connected Device
Configuration) for high end devices, and the CLDC (Connected Limited Device Configuration),
for resource constrained devices like basic cell phones and pagers.
Why J2ME?
J2ME is aimed squarely at consumer devices with limited horsepower. Many such
devices (e.g., a mobile phone or pager) have no option to download and install software beyond
what was configured during the manufacturing process. With the introduction of J2ME, “micro”
devices no longer need to be “static” in nature. Not unlike a web browser downloading Java
applets, an implementation of J2ME on a device affords the option to browse, download and
install Java applications and content.Small consumer electronics have a way of changing our
lives. Mobile phones let us communicate when away from our home or office. Personaldigital
assistants (PDAs) let us access email, browse the internet and run applicationsof all shapes and
forms. With the introduction of Java for such devices, we now have access to the features
inherent to the Java language and platform. That is, a programming language that is easy to
master, a runtimeenvironment that provides a secure and portable platform and access to
dynamic content, not to mention an estimated developer community of over 2million
people.Although it would be nice to have the entire J2SE Application Programming Interface
(API) available on a micro device, it’s not realistic. For example,a mobile phone with its limited
display cannot provide all the functionality available in the Abstract Window Toolkit, the first
graphical user interface released with Java. The “Micro Edition” was introduced to address the
special needs of consumer devices that are outside the scope of J2SE and J2EE.
The capabilities of devices within the “Micro Edition” may vary greatly.An Internet
Screenphone (a hardware device designed to provide access toemail, news, online banking, etc.)
may have a much larger display than a pager. However, even devices that seem similar in size
may vary greatly in their capabilities. A cell phone and PDA are both limited in physical size,yet
a typical cell phone may have a display with a total resolution of 12,288 pixels (96 × 128),
whereas a PDA resolution may start at 20,000 pixels and go up from there. One Java platform
will most definitely not fit all. To better understand how J2ME will accommodate a broad range
of consumer electronics and embedded devices, we need to introduce two new concepts,
configurations and profiles.
Installation of Java Wireless Toolkit(J2ME):
• If the Java Development Kit is not there or only having the Java Runtime
Environment(JRE) installed, install the latest JDK from
java.sun.com/javase/downloads/index.jsp. current stable release of java is JDK6 Update 7
but check the web page in case there are newer non-beta releases available.
• Next, download the Java Wireless Toolkit (formerly called J2ME Wireless Toolkit)
from: java.sun.com/products/sjwtoolkit/download.html.
• Run the installer (for e
• xample, for windows it is: sun_java_wireless_toolkit-2_5_2-windows.exe). The installer
checks whether a compatible java environment has been pre-installed. If not, it is
necessary to uninstall old versions of java and perform step 1 again.
Once after successful installation of java and the toolkit compile this program and run the
following program in the toolkit.
Steps to run this program in toolkit:
• Start -> All Programs -> Sun Java Toolkit -> Wireless Toolkit
• Click new project -> enter project name -> enter class name -> click on create
project.
• Click appropriate API Selection and Configurations.
• Place java source files in WTK2.1/ WTK2.2\apps\projectname\src.
• Build the project.
• Run the project.
1.Start "KToolbar".
2.Create a new project, press button "New Project".

3.Enter the following project details:

Project Name: Login Project

MIDlet Class Name: Login

Press button "Create Project".

4.Change the settings for this project:

Tab: API Selection

Target Platform:JTWI

Configurations: CLDC 1.1


5.Press OK button. The project is created

6.Close KToolbar, menu: File | Exit.


7.You must manually create the project directory: C:\WTK22\apps\Login Project\src

8.Write and Copy the respective java file C:\WTK22\apps\Login Project\src Directory:
9.Start KToolbar and press button "Open Project".

10.Select project "TeapotM3G" and press button "Open Project”.

11.Select the Device. In this example the default device "DefaultColorPhone"

12.Press button "Build" and if no errors are shown, press button "Run".

13.DefaultColorPhone is Displayed on the window.


14.To click "Lunch" Button

WEEK-1
Aim: Write a J2ME program to show how to change the font size and color.
Procedure:
Step1: Create a new J2ME project with the name FontChange and give the MIDlet Class name
as FontChange
Step 2: Create the java program following the Step 3,4,5 and save that program under the src
folder of your project
Step 3: Import required Packages:
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
import java.io.*;
import java.lang.*;
import javax.microedition.io.*;
import javax.microedition.rms.*;
Step 4: Implement the constructor for FontChange class
Step 5: Implement the FontCanvas class by extending Canvas and write the function to change
the font as below:
Font f1 = Font.getFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN,
Font.SIZE_LARGE);
Font f2 = Font.getFont(Font.FACE_SYSTEM,
Font.STYLE_PLAIN,Font.SIZE_MEDIUM);
Font f3 = Font.getFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN,
Font.SIZE_SMALL);
Step 6: Click on Build button in J2ME WT Kit
Step 7: If no errors found then click on Run
Program:
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class FontChange extends MIDlet
{
private Display display=null;
private FontCanvas fontcanvas=null;
public FontChange()
{
display=Display.getDisplay(this);
fontcanvas=new FontCanvas(this);
}
public void startApp()throws MIDletStateChangeException
{
display.setCurrent(fontcanvas);
}
public void pauseApp()
{
}
public void destroyApp(boolean unconditional)
{
}
class FontCanvas extends Canvas
{
private FontChange parent=null;
private int height=getHeight();
private int width=getWidth();
public FontCanvas(FontChange parent)
{
this.parent=parent;
}
public void paint(Graphics g)
{
g.setColor(255,255,255);
g.fillRect(0,0,width,height);
Font
font1=Font.getFont(Font.FACE_SYSTEM,Font.STYLE_PLAIN,Font.SIZE_LARGE);
Font
font2=Font.getFont(Font.FACE_SYSTEM,Font.STYLE_PLAIN,Font.SIZE_MEDIUM);
Font
font3=Font.getFont(Font.FACE_SYSTEM,Font.STYLE_PLAIN,Font.SIZE_SMALL);
int position=0;
g.setColor(255,0,254);
g.setFont(font1);
g.drawString("Large Size Font",0,position,Graphics.LEFT|Graphics.TOP);
position=position+font1.getHeight()+10;
g.setColor(155,0,154);
g.setFont(font2);
g.drawString("Medium Size Font",0,position,Graphics.LEFT|Graphics.TOP);
position=position+font1.getHeight()+10;
g.setColor(0,0,0);
g.setFont(font3);
g.drawString("Small Size Font",0,position,Graphics.LEFT|Graphics.TOP);
}
}
}
OUTPUT:
Viva-Voice:
1.What is J2ME ?
Java 2, Micro Edition is a group of specifications and technologies that pertain to Java on small
devices. The J2ME moniker covers a wide range of devices, from pagers and mobile telephones
through set-top boxes and car navigation systems. The J2ME world is divided into configurations
and profiles, specifications that describe a Java environment for a specific class of device.
2.What is J2ME WTK ?
The J2ME Wireless Toolkit is a set of tools that provides developers with an emulation
environment, documentation and examples for developing Java applications for small devices.
The J2ME WTK is based on the Connected Limited Device Configuration (CLDC) and Mobile
Information Device Profile (MIDP) reference implementations, and can be tightly integrated
with Forte for Java
3.What is 802.11 ?
802.11 is a group of specifications for wireless networks developed by the Institute of Electrical
and Electronics Engineers (IEEE). 802.11 uses the Ethernet protocol and CSMA/CA (carrier
sense multiple access with collision avoidance) for path sharing.
4. What is CDC ?
The Connected Device Configuration (CDC) is a specification for a J2ME configuration.
Conceptually, CDC deals with devices with more memory and processing power than CLDC; it
is for devices with an always-on network connection and a minimum of 2 MB of memory
available for the Java system
5. What is CDPD ?
Developed by Nortel Networks, Cellular Digital Packet Data (CDPD) is an open standard for
supporting wireless Internet access from cellular devices. CDPD also supports Multicast, which
allows content providers to efficiently broadcast information to many devices at the same time
WEEK-2
Aim: Write a J2ME program which creates the following kind of menu.
• cut 2. copy 3. paste 4. delete 5. select all 6. unselect all
Procedure:
Step1: Create a new J2ME project with the name List and give the MIDlet Class name as List
Step 2: Create the java program following the Step 3,4,5 and save that program under the src
folder of your project
Step 3: Import required Packages:
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
Step 4: Implement the constructor for List class by creating the menu with the following options:
ch=new ChoiceGroup("Edit",Choice.EXCLUSIVE);
ch.append("cut",null);
ch.append("copy",null);
ch.append("paste",null);
ch.append("delete",null);
ch.append("select all",null);
ch.append("unselect all",null);
ch.setSelectedIndex(1, true);
Step 5: Assign the action to the Command cmd
Step 6: Click on Build button in J2ME WT Kit
Step 7: If no errors found then click on Run
Program:
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class List extends MIDlet implements CommandListener
{
public Display display;
public Form form;
public ChoiceGroup ch;
public Command cmd;
public StringItem st;
public List()
{
display=Display.getDisplay(this);
ch=new ChoiceGroup("Choices",Choice.EXCLUSIVE);
ch.append("Cut",null);
ch.append("Copy",null);
ch.append("Paste",null);
ch.append("Delete",null);
ch.append("Select all",null);
ch.append("Unselect all",null);
cmd=new Command("Select",Command.OK,1);
form=new Form("List");
form.append(ch);
form.addCommand(cmd);
form.setCommandListener(this);
st=new StringItem("","");
}
public void startApp()
{
display.setCurrent(form);
}
public void pauseApp()
{
}
public void destroyApp(boolean unconditional)
{
}
public void commandAction(Command command,Displayable displayable)
{
if(command==cmd)
{
st.setText("");
st.setText("Your selected option is:"+ch.getString(ch.getSelectedIndex()));
form.append(st);
}
}
}
OUTPUT:

Viva Voice:
1.What is CLDC ?
The Connected, Limited Device Configuration (CLDC) is a specification for a J2ME
configuration. It specifies a stripped-down Java virtual machine1 called the KVM as well as
several APIs for fundamental application services..
2.What is configuration ?
In J2ME, a configuration defines the minimum Java runtime environment for a family of
devices: the combination of a Java virtual machine (either the standard J2SE virtual machine or a
much more limited version called the CLDC VM) and a core set of APIs. CDC and CLDC are
configurations
3.What is CVM ?
The Compact Virtual Machine (CVM) is an optimized Java virtual machine1 (JVM) that is used
by the CDC.
4.What is Deck ?
A deck is a collection of one or more WML cards that can be downloaded, to a mobile phone, as
a single entity.
5.What is EDGE ?
Enhanced Data GSM Environment (EDGE) is a new, faster version of GSM. EDGE is designed
to support transfer rates up to 384Kbps and enable the delivery of video and other high-
bandwidth applications.
WEEK-3
Aim: Create a J2ME menu which has the following options (Event Handling):
• cut - can be on/off
• copy - can be on/off
• paste - can be on/off
• delete - can be on/off
• select all - put all 4 options on
• unselect all - put all

Procedure:
Step1: Create a new J2ME project with the name MenuEvents and give the MIDlet Class name
as MenuEvents
Step 2: Create the java program following the Step 3,4,5 and save that program under the src
folder of your project
Step 3: Import required Packages:
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
Step 4: Implement the constructor for MenuEvents class by creating the menu with the following
options:
ch1=new ChoiceGroup("Options",Choice.MULTIPLE);
ch2=new ChoiceGroup("Events",Choice.EXCLUSIVE);
ch1.append("Cut",null);
ch1.append("Copy",null);
ch1.append("Paste",null);
ch1.append("Delete",null);
ch1.setSelectedIndex(0,true);
form1.append(ch1);
ch2.append("Select all",null);
ch2.append("Unselect all",null);
ch2.setSelectedIndex(0,true);
form1.append(ch2);
Step 5: Assign the action to the Commands View, Exit, Back and assign the command listeners
to the forms.
Step 6: Click on Build button in J2ME WT Kit
Step 7: If no errors found then click on Run
Program:
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class MenuEvents extends MIDlet implements CommandListener,ItemStateListener
{
public ChoiceGroup ch1,ch2;
public Form form1,form2;
public Display display;
public Command View,Exit,Back;
public StringItem options;
public Item item;
public MenuEvents()
{
display=Display.getDisplay(this);
form1=new Form("");
form2=new Form("Selected options:");
ch1=new ChoiceGroup("Options",Choice.MULTIPLE);
ch2=new ChoiceGroup("Events",Choice.EXCLUSIVE);
ch1.append("Cut",null);
ch1.append("Copy",null);
ch1.append("Paste",null);
ch1.append("Delete",null);
ch1.setSelectedIndex(0,true);
form1.append(ch1);
ch2.append("Select all",null);
ch2.append("Unselect all",null);
ch2.setSelectedIndex(0,true);
form1.append(ch2);
View=new Command("View",Command.OK,1);
Exit=new Command("Exit",Command.EXIT,1);
Back=new Command("Back",Command.BACK,1);
form1.addCommand(View);
form1.addCommand(Exit);
form2.addCommand(Back);
form1.setCommandListener(this);
form2.setCommandListener(this);
form1.setItemStateListener(this);
}
public void startApp()
{
display.setCurrent(form1);
}
public void pauseApp()
{
}
public void destroyApp(boolean unconditional)
{
}
public void commandAction(Command command,Displayable displayable)
{
if(displayable==form1)
{
if(command==View)
{
boolean opt[]=new boolean[ch1.size()];
options=new StringItem("","");
String values="";
ch1.getSelectedFlags(opt);
options.setText("");
for(int i=0;i<opt.length;i++)
{
if(opt[i])
{
values+=ch1.getString(i)+"\n";
}
}
options.setText(values);
form2.append(options);
display.setCurrent(form2);
}
else if(command==Exit)
{
destroyApp(true);
notifyDestroyed();
}
}
else if(displayable==form2)
{
if(command==Back)
{
display.setCurrent(form1);
options.setText("");
}
}
}
public void itemStateChanged(Item item)
{
if(item==ch2)
{
int i=0;
int size=ch1.size();
while(i<size)
{
if(ch2.getSelectedIndex()==0)
ch1.setSelectedIndex(i,true);
else
ch1.setSelectedIndex(i,false);
i++;
}
}
}
}

OUTPUT:
VivaVoice:
1.What is iDEN ?
The Integrated Dispatch Enhanced Network (iDEN) is a wireless network system developed by
Motorola. Various carriers support iDEN networks around the world: Nextel is one of the largest
carriers, with networks covering North and South America.
A standard used by Japanese wireless devices to access cHTML (compact HTML) Web sites and
display animated GIFs and other multimedia content.
2.What is 3G ?
Third generation (3G) wireless networks will offer faster data transfer rates than current
networks. The first generation of wireless (1G) was analog cellular. The second generation (2G)
is digital cellular, featuring integrated voice and data communications. 3G networks will offer
dramatically improved data transfer rates, enabling new wireless applications such as streaming
media.
3.What is Java Card ?
The Java Card specification allows Java technology to run on smart cards and other small
devices. The Java Card API is compatible with formal international standards, such as, ISO7816,
and industry-specific standards, such as, Europay/Master Card/Visa (EMV).
4.What is JavaHQ ?
JavaHQ is the Java platform control center on your Palm OS device.
5.What is JCP ?
The Java Community Process (JCP) an open organization of international Java developers and
licensees who develop and revise Java technology specifications, reference implementations, and
technology compatibility kits through a formal process.

WEEK-4
Aim: Create a MIDP application, which draws a bar graph to the display. Data values can
be given at int[] array. You can enter four data (integer) values to the input text field.
Procedure:
Step1: Create a new J2ME project with the name BarGraph and give the MIDlet Class name as
BarGraph
Step 2: Create the java program following the Step 3,4 and save that program under the src
folder of your project
Step 3: Import required Packages:
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
Step 4: Implement the constructor for BarGraph class by following Step 5 and 6
Step 5: Read thevalues into an array as below:
textfield1=new TextField("Value1:-","",30,TextField.ANY);
textfield2=new TextField("Value2:-","",30,TextField.ANY);
textfield3=new TextField("Value3:-","",30,TextField.ANY);
textfield4=new TextField("Value4:-","",30,TextField.ANY);
textfield5=new TextField("Value5:-","",30,TextField.ANY);
Step 6: Add the values into console
form.append(textfield1);
form.append(textfield2);
form.append(textfield3);
form.append(textfield4);
form.append(textfield5);
Step 7: Implement the BarCanvas class by extending Canvas
Step 8: Click on Build button in J2ME WT Kit
Step 9: If no errors found then click on Run

Program:
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class BarGraph extends MIDlet implements CommandListener
{
public Form form;
public Command exitCommand;
public Command okCommand;
public Command backCommand;
public Displayable d;
public Display display;
public TextField textfield1;
public TextField textfield2;
public TextField textfield3;
public TextField textfield4;
public TextField textfield5;
public BarGraph()
{
display=Display.getDisplay(this);
form=new Form("BarGraph");
textfield1=new TextField("Value1:-","",30,TextField.ANY);
textfield2=new TextField("Value2:-","",30,TextField.ANY);
textfield3=new TextField("Value3:-","",30,TextField.ANY);
textfield4=new TextField("Value4:-","",30,TextField.ANY);
textfield5=new TextField("Value5:-","",30,TextField.ANY);
form.append(textfield1);
form.append(textfield2);
form.append(textfield3);
form.append(textfield4);
form.append(textfield5);
okCommand=new Command("Ok",Command.OK,1);
exitCommand=new Command("Exit",Command.EXIT,1);
backCommand=new Command("Back",Command.BACK,1);
form.addCommand(okCommand);
form.addCommand(exitCommand);
form.setCommandListener(this);
}
public void startApp()
{
display.setCurrent(form);
}
public void pauseApp()
{
}
public void destroyApp(boolean unconditional)
{
}
public void commandAction(Command command,Displayable displayable)
{
if(displayable==form)
{
if(command==okCommand)
{
int[] data=new int[5];
data[0]=Integer.parseInt(textfield1.getString());
data[1]=Integer.parseInt(textfield2.getString());
data[2]=Integer.parseInt(textfield3.getString());
data[3]=Integer.parseInt(textfield4.getString());
data[4]=Integer.parseInt(textfield5.getString());
d=new BarCanvas(data);
d.addCommand(backCommand);
d.setCommandListener(this);
display.setCurrent(d);
}
else if(command==exitCommand)
notifyDestroyed();
}
else if(displayable==d)
{
if(command==backCommand)
display.setCurrent(form);
}
}
}
class BarCanvas extends Canvas
{
int[] data;
public int x;
public int y;
public int y1;
public int h;
public BarCanvas(int[] data)
{
this.data=data;
x=10;
}
public void paint(Graphics g)
{
g.setColor(255, 255, 255);
g.fillRect(0, 0, this.getWidth(), this.getHeight());
g.setColor(255, 125, 100);
int i=0;
y1=data[0];
h=200;
while(i<data.length)
{
y=data[i];
h=200+y1-y;
g.fillRect(x, y,25 , h);
x+=30;
i++;
}
}
}
OUTPUT:

VivaVoice:
1.What is Modulation ?
Modulation is the method by which a high-frequency digital signal is grafted onto a lower-
frequency analog wave, so that digital packets are able to ride piggyback on the analog airwave.
2.What is MSC ?
A Mobile Switching Center (MSC) is a unit within a cellular phone network that automatically
coordinates and switches calls in a given cell. It monitors each caller's signal strength, and when
a signal begins to fade, it hands off the call to another MSC that's better positioned to manage the
call.
3.What is optional package
An optional package is a set of J2ME APIs providing services in a specific area, such as database
access or multimedia. Unlike a profile, it does not define a complete application environment,
but rather is used in conjunction with a configuration or a profile. It extends the runtime
environment to support device capabilities that are not universal enough to be defined as part of a
profile or that need to be shared by different profiles. J2ME RMI and the Mobile Media RMI are
examples of optional packages.
4.What is OTA
Over The Air (OTA) refers to any wireless networking technology.
5.What is PCS
Personal Communications Service (PCS) is a suite of second-generation, digitally modulated
mobile-communications interfaces that includes TDMA, CDMA, and GSM. PCS serves as an
umbrella term for second-generation wireless technologies operating in the 1900MHz range
6.What is PDAP
The Personal Digital Assistant Profile (PDAP) is a J2ME profile specification designed for small
platforms such as PalmOS devices. You can think of PDAs as being larger than mobile phones
but smaller than set-top boxes. PDAP is built on top of CLDC and will specify user interface and
persistent storage APIs. PDAP is currently being developed using the Java Community Process
(JCP).
WEEK-5
Aim: Create an MIDP application which examine, that a phone number, which a user has
entered is in the given format (Input checking):
* Area code should be one of the following: 040, 041, 050, 0400, 044
* There should 6-8 numbers in telephone number (+ area code)

Pocedure:
Step1: Create a new J2ME project with the name InputChecking and give the MIDlet Class
name as InputChecking
Step 2: Create the java program following the Step 3,4,5 and save that program under the src
folder of your project
Step 3: Import required Packages:
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
Step 4: Create a menu with two options OK and Exit
exitCommand=new Command("Exit",Command.EXIT,1);
okCommand=new Command("Ok",Command.OK,1);
Step 5: Implement the logic to check the condition action to the Command okCommand
Step 6: Click on Build button in J2ME WT Kit
Step 7: If no errors found then click on Run
Program:
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class InputChecking extends MIDlet implements CommandListener
{
public Form form1;
public TextField textfield1;
public Command exitCommand;
public Command okCommand;
public StringItem st;
public Display display;
public InputChecking()
{
display=Display.getDisplay(this);
form1=new Form("Insert the Phone number");
exitCommand=new Command("Exit",Command.EXIT,1);
okCommand=new Command("Ok",Command.OK,1);
st=new StringItem("Phone Number is ","");
textfield1=new TextField("Phone;","",30,TextField.ANY);
form1.append(textfield1);
form1.addCommand(okCommand);
form1.addCommand(exitCommand);
form1.setCommandListener(this);
}
public void startApp()
{
display.setCurrent(form1);
}
public void pauseApp()
{
}
public void destroyApp(boolean unconditional)
{
}
public void commandAction(Command cmd,Displayable displayable)
{
if(cmd==exitCommand)
notifyDestroyed();
else if(cmd==okCommand)
{
String s=textfield1.getString();
s=s.replace(' ', '.');
int len=s.length();
int i=0;
int c=0;
String s1="";
while(i<len)
{
if(s.charAt(i)=='.')
{
if(c==0)
{
if(s1.equals("040") || s1.equals("041") || s1.equals("050")
||s1.equals("0400") ||s1.equals("044"))
{
c++;
s1="";
}
}
if(c==1)
{
if(s1.length()-1==3)
{
c++;
s1="";
}
}
}
s1=s1+s.charAt(i);
i++;
}
if(s1.length()-1==3 || s1.length()-1==4 || s1.length()-1==5)
c++;
if(c==3)
st.setText("OK");
else
{
st.setText("wrong\n Phone Number Format is xxx xxx xxxx\nArea code
must be

040|050|041|0400|044");
}
form1.append(st);
}
}
}
OUTPUT:
VivaVoice:
1.What is RMI Profile
The RMI Profile is a J2ME profile specification designed to support Java's Remote Method
Invocation (RMI) distributed object system. Devices implementing the RMI Profile will be able
to interoperate via RMI with other Java devices, including Java 2, Standard Edition. The RMI
Profile is based on the Foundation Profile, which in turn is based on CDC.
2.What is RMS
The Record Management System (RMS) is a simple record-oriented database that allows a
MIDlet to persistently store information and retrieve it later. Different MIDlets can also use the
RMS to share data.
3.What is SDK
A Software Development Kit (SDK) is a set of tools used to develop applications for a particular
platform. An SDK typically contains a compiler, linker, and debugger. It may also contain
libraries and documentation for APIs.
4.What is SIM
A Subscriber Identity Module (SIM) is a stripped-down smart card containing information about
the identity of a cell-phone subscriber, and subscriber authentication and service information.
Because the SIM uniquely identifies the subscriber and is portable among handsets, the user can
move it from one kind of phone to another, facilitating international roaming.
5.What is SMS
Short Message Service (SMS) is a point-to-point service similar to paging for sending text
messages of up to 160 characters to mobile phones.
WEEK-6
Aim: Write a sample program to show how to make a SOCKET Connection from J2ME
phone. This J2ME sample program shows how to how to make a SOCKET Connection
from a J2ME Phone. Many a times there is a need to connect backend HTTP server from
the J2ME application. Show how to make a SOCKET connection from the phone to port
80.
Procedure:
Creating the Server project:
Step1: Create a new J2ME project with the name Server and give the MIDlet Class name as
Server
Step 2: Create the java program following the Step from 3 and save that program under the src
folder of your project
Step 3: After clicking OK, the project is created; and the Wireless Toolkit tells that the name of
the folder where source code files are created. The path of the source code folder is displayed in
the debug output window.
Step 4: Create a new java file called Server.java in the source folder of the project. The exact
path of this folder is displayed in the Wireless Toolkit window.
Step 5: Click on Build button in J2ME WT Kit
Step 6: If no errors found then click on Run
Step 7: To start the application, click on the right soft-key (marked with a dot) below the
‘Launch’ command.
Step 8: The phone simulator might ask if it is OK to run the network application. Select ‘Yes’ by
clicking on the appropriate soft-key. The server is now up and running.
Step 9: Keep the server running during the creation, compilation and running of the Client
application.
Creating the Client project:
Use the same instance of the Wireless Toolkit that is used for creating and compiling the Server
project.
Step1: Create a new J2ME project with the name Client and give the MIDlet Class name as
Client
Step 2: Create the java program following the Step from 3 and save that program under the src
folder of your project
Step 3: After clicking OK, the project is created; and the Wireless Toolkit tells that the name of
the folder where source code files are created. The path of the source code folder is displayed in
the debug output window.
Step 4: Create a new java file called Client.java in the source folder of the project. The exact
path of this folder is displayed in the Wireless Toolkit window.
Step 5: Click on Build button in J2ME WT Kit
Step 6: If no errors found then click on Run
Step 7: To start the application, click on the right soft-key (marked with a dot) below the
‘Launch’ command.
Step 8: The phone simulator might ask if it is OK to run the network application. Select ‘Yes’ by
clicking on the appropriate soft-key. The Client is now up and running.
Step 9: Create the java programs for Sender and socketMidlet
Step 10: Click on Build button in J2ME WT Kit
Step 11: If no errors found then click on Run
Programs:
Client.java
import javax.microedition.midlet.*;
import javax.microedition.io.*;
import javax.microedition.lcdui.*;
import java.io.*;
public class socket extends MIDlet {
// StreamConnection allows bidirectional communication
private StreamConnection streamConnection = null;
// use OutputStream to send requests
private OutputStream outputStream = null;
private DataOutputStream dataOutputStream = null;
// use InputStream to receive responses from Web server
private InputStream inputStream = null;
private DataInputStream dataInputStream = null;
// specify the connect string
private String connectString = "socket://www.java-samples.com:80";
// usea StrignBuffe to store the retrieved page contents
private StringBuffer results;
// define GUI components
private Display myDisplay = null;
private Form resultScreen;
private StringItem resultField;
public socket() {
// initializingGUI display
results = new StringBuffer();
myDisplay = Display.getDisplay(this);
resultScreen = new Form("Page Content:");
}
public void startApp() {
try {
// establish a socket connection with remote server
streamConnection =
(StreamConnection) Connector.open(connectString);
// create DataOuputStream on top of the socket connection
outputStream = streamConnection.openOutputStream();
dataOutputStream = new DataOutputStream(outputStream);
// send the HTTP request
dataOutputStream.writeChars("GET /index.htm HTTP/1.0\n");
dataOutputStream.flush();
// create DataInputStream on top of the socket connection
inputStream = streamConnection.openInputStream();
dataInputStream = new DataInputStream(inputStream);
// retrieve the contents of the requested page from Web server
int inputChar;
while ( (inputChar = dataInputStream.read()) !=
-
1) {
results.append((char) inputChar);
}
// display the page contents on the phone screen
resultField = new StringItem(null, results.toString());
resultScreen.append(resultField);
myDisplay.setCurrent(resultScreen);
} catch (IOException e) {
System.err.println("Exception caught:" + e);
} finally {

// free up I/O streams and close the socket connection


try {
if (dataInputStream != null)
dataInputStream.close();
} catch (Exception ignored) {}
try {
if (dataOutputStream != null)
dataOutputStream.close();
} catch (Exception ignored) {}
try {
if (outputStream != null)
outputStream.close();
} catch (Exception ignored) {}
try {
if (inputStream != null)
inputStream.close();
} catch (Exception ignored) {}
try {
if (streamConnection != null)
streamConnection.close();
} catch (Exception ignored) {}
}
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
}

OUTPUT:
Viva voice:

1.What is network socket?

A network socket is one endpoint in a communication flow between two programs running over
a network.Sockets are created and used with a set of programming requests or "function calls"
sometimes called the sockets application programming interface (API). The most common
sockets API is the Berkeley UNIX C interface for sockets

2.What's in an HTTP request?

Whenever your web browser fetches a file (a page, a picture, etc) from a web server, it does so
using HTTP - that's "Hypertext Transfer Protocol". HTTP is a request/response protocol, which
means your computer sends a request for some file (e.g. "Get me the file 'home.html'"), and the
web server sends back a response ("Here's the file", followed by the file itself).

That request which your computer sends to the web server contains all sorts of (potentially)
interesting information. We'll now examine the HTTP request your computer just sent to this
web server, see what it contains, and find out what it tells me about you.

3.What Is an HTTP Response?

A HTTP response is the message a Web server needs to return back to a Web client machine in
response to an HTTP request from the same client machine.

4. What isJava Card?

The Java Card specification allows Java technology to run on smart cards and other small
devices. The Java Card API is compatible with formal international standards, such as, ISO7816,
and industry-specific standards, such as, Europay/Master Card/Visa (EMV)

5. What is MIDP

The Mobile Information Device Profile (MIDP) is a specification for a J2ME profile. It is
layered on top of CLDC and adds APIs for application life cycle, user interface, networking, and
persistent storage.
WEEK- 7
Aim: Authentication with a Web Server
Login to HTTP Server from a J2ME Program
Procedure:
Step1: Create a new J2ME project with the name login and give the MIDlet Class name as login
Step 2: Create the java program for MIDlet save that program under the src folder of your
project
Step 3: Create a web-application project naming 'micro-web'
Step 4: Create a servlet naming 'index.jsp'
Step 5: Run the servlet(in order to start the web server)
Step 6: Run the mobile application...
Programs:
login.java
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import javax.microedition.io.*;
import java.io.*;
public class login extends MIDlet implements CommandListener {
public Form form1;
public Command okCommand;
public Display display;
public HttpConnection ht=null;
public InputStream ist=null;
public StringItem st,st1;
public TextField t1;
public TextField t2;
public Alert alert;
public Form form2;
public login()
{
display=Display.getDisplay(this);
alert =new Alert(" ","Wrong UserName or Password",null,AlertType.INFO);
t1=new TextField("UserName"," ",30,TextField.ANY);
t2=new TextField("Password"," ",30,TextField.PASSWORD);
st=new StringItem(" "," You are authenticated!!");
st1=new StringItem(" ","hi");
form1=new Form("Login Here");
form2=new Form("Welcome");
okCommand=new Command("Login",Command.OK,1);
form1.addCommand(okCommand);
form1.setCommandListener(this);
form1.append(t1);
form1.append(t2);
form2.append(st);
form2.append(st1);
}
public void startApp() {
display.setCurrent(form1);
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
notifyDestroyed();
}
public void commandAction(Command cmd,Displayable d)
{
if(cmd==okCommand)
{
try
{
new Thread(new Runnable()
{
public void run()
{
try
{
String
url="http://172.18.19.65:8081/WebApplication7/index.jsp?t1="+t1.getString().trim()+"&t2="+t2
.getString().trim();
ht=(HttpConnection)Connector.open(url);
ist=ht.openInputStream();
byte[] b=new byte[900];
ist.read(b);
String s=new String(b);
s=s.trim();
if(s.equals("ok"))
{
display.setCurrent(form2);
String s1=t1.getString();
st1.setText("Welcome"+s1);
}
else
{
alert.setTimeout(Alert.FOREVER);
display.setCurrent(alert);
}
}
catch(IOException e)
{
}
}
}).start();
}
catch(Exception e)
{
System.out.println("Error :"+e);
}
}
}
}
index.jsp
<%@page import="java.sql.*" %>
<%
String Htno=request.getParameter("t1");
String Sname=request.getParameter("t2");
String sql="select * from stu where sno="+"'"+Htno+"'"+" and sname="+"'"+Sname+"'";
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection cn=DriverManager.getConnection("jdbc:odbc:database","system","tiger");
Statement st=cn.createStatement();
ResultSet rs=st.executeQuery(sql);
if(rs.next())
{
out.println("ok");
out.close();
}
else
{
out.println("0");
out.close();
}
}
catch(Exception ex)
{
out.println(ex.toString());
out.close();
}
out.close();
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
</html>

OUTPUT:
Viva voice:
1.What is web server?
A Web server is a program that uses HTTP (Hypertext Transfer Protocol) to serve the files that
form Web pages to users, in response to their requests, which are forwarded by their computers'
HTTP clients. Dedicated computers and appliances may be referred to as Web servers as wel
2.What is MySQL?
MySQL is an open source relational database management system (RDBMS) based on
Structured Query Language (SQL).
3.What is midlet?
A MIDlet is an application that uses the Mobile Information Device Profile (MIDP) of
the Connected Limited Device Configuration (CLDC) for the Java ME environment.
4. What is MSC ?
A Mobile Switching Center (MSC) is a unit within a cellular phone network that automatically
coordinates and switches calls in a given cell. It monitors each caller's signal strength, and when
a signal begins to fade, it hands off the call to another MSC that's better positioned to manage the
call.
5. What is Personal Profile ?
The Personal Profile is a J2ME profile specification. Layered on the Foundation Profile and
CDC, the Personal Profile will be the next generation of PersonalJava technology. The
specification is currently in development under the Java Community Process (JCP
WEEK-8
AIM: Create a MIDP application on students marks enquiry form.
Procedure:
Step1: Create a new J2ME project with the name Marks and give the MIDlet Class name as
Marks
Step 2: Create the java program for MIDlet save that program under the src folder of your
project
Step 3: Create a web-application which contains the three jspfiles for accessing the SSC, Inter,
EAMCET marks formthe databases and retiren to the MIDlet program
Step 4: Create the database named as Marks in Mysql as below:
CREATION OF TABLES IN MYSQL:
1. Create the Database name as Marks in Mysql.
2. Create tables for SSC, Inter and Emcet under Marks Database.
3. Insert the data into tables.
• create Database Maks;
• use Marks;
• create table SSC(htno varchar(20), sname varchar(20), english int ,telugu int,hindi
int,maths int,science int, social int);

• insert into SSC values(‘101’,’phani’,78,85,94,88,76,80);


• insert into SSC values(‘102’,’kumar’,50,60,88,99,78,98);
• select * from table SSC;

htno Sname english telugu hindi maths science social


101 Phani 78 85 94 88 76 80
102 Kumar 50 60 88 99 78 98
• create table inter(htno varchar(20),name varchar(20),branch varchar(20),Sanskrit1
int,English1 int,maths1 int,maths2 int,physics1 int,chemistry1 int);

• insert into inter values(‘111’,’phani’,’mpc’,85,74,69,75,96,88);


• insert into inter values(‘112’,’kumar’,’bipc’,86,97,89,69,89,60);
• select * from inter;

htno name branch sanskrit1 english1 maths1 maths2 physics1 chemistry1


111 phani mpc 85 74 69 75 96 88
112 kumar bipc 86 97 89 69 89 60

• create table eamcet(htno varchar(20),name varchar(20),branch varchar(20),rank int);

• insert into eamcet values(‘101’,’phani’,’mpc’,22);


• insert into eamcet values(‘102’,’kumar’,’bipc’,1500);
• select * from eamcet;
Htno name branch rank
101 phani mpc 22
102 kumar bipc 1500

Step 6: Run the mobile application...


Programs:
Program for SSC
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="java.sql.*"%>
<%
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/marks","root","anurag");
String a=request.getParameter("u");
String sql="select * from ssc where htno='"+a+"'";
Statement st=con.createStatement();
ResultSet rs=st.executeQuery(sql);
while(rs.next())
{
out.println("htno"+"\t"+rs.getString("htno")+"sname"+"\t"+rs.getString("sname")+"english"+"\t"
+rs.getString("eng")+"telugu"+"\t"+rs.getString("telugu")+"hindi\t"+rs.getString("hindi")+"math
s\t"+rs.getString("maths")+"science\t"+rs.getString("science")+"social\t"+rs.getString("social"));
}
out.close();
st.close();
con.close();
%>

Program for INTER


<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="java.sql.*"%>
<%
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/marks","root","anurag");
String a=request.getParameter("p");
String b=request.getParameter("q");
String sql="select * from inter1 where htno='"+a+"'"+" and branch="+"'"+b+"'";
Statement st=con.createStatement();
ResultSet rs=st.executeQuery(sql);
while(rs.next())
{
out.println("htno"+"\t"+rs.getString("htno")+"name"+"\t"+rs.getString("name")+"branch"+"\t"+r
s.getString("branch")+"snskrit1"+"\t"+rs.getString("sanskrit1")+"english1\t"+rs.getString("englis
h1")+"maths1\t"+rs.getString("maths1")+"maths2\t"+rs.getString("maths2")+"physics1\t"+rs.get
String("physics1")+"chemistry1\t"+rs.getString("chemistry1"));
}
out.close();
st.close();
con.close();
%>
Program for EAMCET
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="java.sql.*" %>
<%
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/Marks","root","anurag");
String h=request.getParameter("p");
String sql="select * from emcet where htno="+"'"+h+"'";
Statement st=con.createStatement();
ResultSet rs=st.executeQuery(sql);
while(rs.next())
{
out.println("htno"+"\t"+rs.getString("htno")+"sname"+"\t"+rs.getString("name")+"branch"+"\t"+
rs.getString("branch")+"rank"+"\t"+rs.getString("rank"));
}
out.close();
st.close();
con.close();
%>
Program for USERINTERFACE(MIDlet)
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import javax.microedition.io.*;
import java.io.*;
public class Marks extends MIDlet implements CommandListener
{
public TextField tf,tf1,tf2;
public ChoiceGroup cg;
public StringItem st,st1,st2;
public Command show,show1,show2,show3;
public Display d;
public Form f,f1,f2,f3;
public HttpConnection ht;
public InputStream ist;
public Marks()
{
d=Display.getDisplay(this);
f=new Form("marks enquiry");
f1=new Form("home");
f2=new Form("ssc");
f3=new Form("inter");
tf=new TextField("HTNO","",30,TextField.ANY);
tf1=new TextField("HTNO","",30,TextField.ANY);
tf2=new TextField("HTNO","",30,TextField.ANY);
f.append(tf);
f2.append(tf1);
f3.append(tf2);
cg=new ChoiceGroup("select",Choice.EXCLUSIVE);
cg.append("emcet",null);
cg.append("ssc",null);
cg.append("inter",null);
f1.append(cg);
st2=new StringItem("","");
f3.append(st2);
st=new StringItem("","");
st1=new StringItem("","");
f.append(st);
f2.append(st1);
show=new Command("show",Command.OK,1);
show1=new Command("show",Command.OK,1);
show2=new Command("show",Command.OK,1);
show3=new Command("show",Command.OK,1);
f1.addCommand(show1);
f.addCommand(show);
f2.addCommand(show2);
f3.addCommand(show3);
f2.setCommandListener(this);
f1.setCommandListener(this);
f3.setCommandListener(this);
f.setCommandListener(this);
}
public void startApp()
{
d.setCurrent(f1);
}
public void pauseApp()
{
}
public void destroyApp(boolean unconditional)
{
}
public void commandAction(Command cmd,Displayable dis)
{
try
{
if(dis==f1)
{
if(cmd==show1)
{
if(cg.getSelectedIndex()==0)
d.setCurrent(f);
else if(cg.getSelectedIndex()==1)
d.setCurrent(f2);
else if(cg.getSelectedIndex()==2)

d.setCurrent(f3);
}
}
else if(dis == f)
{
if(cmd==show)
{
String url="http://192.168.5.20:8080/WebApplication5/index.jsp?p="+tf.getString();
ht =(HttpConnection)Connector.open(url);
ist=ht.openInputStream();
byte[] b=new byte[2096];
ist.read(b);
String s=new String(b);
st.setText(s);
}
}
else if(dis==f2)
{
if(cmd==show2)
{
String url="http://192.168.5.20:8080/WebApplication7/index.jsp?u="+tf1.getString();
ht =(HttpConnection)Connector.open(url);
ist=ht.openInputStream();
byte[] b=new byte[2096];
ist.read(b);
String s=new String(b);
st1.setText(s);
}
}
else if(dis==f3)
{
if(cmd==show3)
{
String url="http://192.168.5.20:8080/WebApplication7/index2.jsp?p="+tf2.getString();
ht =(HttpConnection)Connector.open(url);
ist=ht.openInputStream();
byte[] b=new byte[2096];
ist.read(b);
String s=new String(b);
st2.setText(s);
}
}
}
catch(Exception e)
{
}
}
}

Output:
Viva voice:
1.What is domain name?

Domain names are used to identify one or more IP addresses. For example, the domain
name microsoft.com represents about a dozen IP addresses. Domain names are used in URLs to
identify particular Web pages

2.What is database?

A database is a collection of information that is organized so that it can be easily


accessed, managed and updated

3.what is mobile client?

The Application Center mobile client is the application that runs on your Android, iOS,
Windows Phone, Windows, or BlackBerry device. (Only Windows Phone 8 and BlackBerry OS
6 and OS 7 are supported by the current version of the Application Center.) You use the mobile
client to list the catalog of available applications in the Application Center

4.What is RMI Profile

The RMI Profile is a J2ME profile specification designed to support Java's Remote Method
Invocation (RMI) distributed object system. Devices implementing the RMI Profile will be able
to interoperate via RMI with other Java devices, including Java 2, Standard Edition. The RMI
Profile is based on the Foundation Profile, which in turn is based on CDC.

5.What is RMS

The Record Management System (RMS) is a simple record-oriented database that allows
a MIDlet to persistently store information and retrieve it later. Different MIDlets can also use the
RMS to share data
What is Android?

Android is a software stack for mobile devices that includes an operating system,
middleware and key applications. The Android SDK provides the tools and APIs necessary to
begin developing applications on the Android platform using the Java programming language.

Features

• Application framework enabling reuse and replacement of components

• Dalvik virtual machine optimized for mobile devices

• Integrated browser based on the open source WebKit engine

• Optimized graphics powered by a custom 2D graphics library; 3D graphics based on the


OpenGL ES 1.0 specification (hardware acceleration optional)

• SQLite for structured data storage

• Media support for common audio, video, and still image formats (MPEG4, H.264, MP3,
AAC, AMR, JPG, PNG, GIF)

• GSM Telephony (hardware dependent)

• Bluetooth, EDGE, 3G, and WiFi (hardware dependent)

• Camera, GPS, compass, and accelerometer (hardware dependent)


• Rich development environment including a device emulator, tools for debugging,
memory and performance profiling, and a plugin for the Eclipse IDE

Android Architecture

The following diagram shows the major components of the Android operating system.
Each section is described in more detail below.

Applications

Android will ship with a set of core applications including an email client, SMS program,
calendar, maps, browser, contacts, and others. All applications are written using the Java
programming language.

Application Framework
By providing an open development platform, Android offers developers the ability to
build extremely rich and innovative applications. Developers are free to take advantage of the
device hardware, access location information, run background services, set alarms, add
notifications to the status bar, and much, much more.

Developers have full access to the same framework APIs used by the core applications.
The application architecture is designed to simplify the reuse of components; any application can
publish its capabilities and any other application may then make use of those capabilities (subject
to security constraints enforced by the framework). This same mechanism allows components to
be replaced by the user.

Underlying all applications is a set of services and systems, including:

• A rich and extensible set of Views that can be used to build an application, including
lists, grids, text boxes, buttons, and even an embeddable web browser

• Content Providers that enable applications to access data from other applications (such as
Contacts), or to share their own data

• A Resource Manager, providing access to non-code resources such as localized strings,


graphics, and layout files

• A Notification Manager that enables all applications to display custom alerts in the status
bar

• An Activity Manager that manages the lifecycle of applications and provides a common
navigation backstack

For more details and a walkthrough of an application, see the Notepad Tutorial.

Libraries

Android includes a set of C/C++ libraries used by various components of the Android
system. These capabilities are exposed to developers through the Android application
framework. Some of the core libraries are listed below:

• System C library - a BSD-derived implementation of the standard C system library


(libc), tuned for embedded Linux-based devices
• Media Libraries - based on PacketVideo's OpenCORE; the libraries support playback
and recording of many popular audio and video formats, as well as static image files,
including MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG

• Surface Manager - manages access to the display subsystem and seamlessly composites
2D and 3D graphic layers from multiple applications

• LibWebCore - a modern web browser engine which powers both the Android browser
and an embeddable web view

• SGL - the underlying 2D graphics engine

• 3D libraries - an implementation based on OpenGL ES 1.0 APIs; the libraries use either
hardware 3D acceleration (where available) or the included, highly optimized 3D
software rasterizer

• FreeType - bitmap and vector font rendering

• SQLite - a powerful and lightweight relational database engine available to all


applications

WEEK-9
Aim: Write an Android application program that displays Hello World using Terminal.
Procedure:
Launch Eclipse
• From "File" menu ⇒ New ⇒ Project.. ⇒ Android Application Project ⇒ Next.
• The "New Android Project" dialog appears:
• In "Application Name", enter "Helloworld" (this is the Android appliation name
that shows up on the real device).
• In "Project Name", enter "Helloworld" (this is the Eclipse's project name).
• In "Package Name", enter "example.helloworld".
• In "Build SDK", select the latest version (e.g., Android 4.0 (API 14)).
• In "Minimum Required SDK", select "API 8 Android 2.2 (Froyo)" - almost all of
the Android devices meet this minimum requirement ⇒ Next.
• The "Configure Launcher Icon" dialog appears, which allows you to set the application's
icon to be displayed on the devices ⇒ Next.
• The "Create Activitiy" dialog appears. Check "Create Activity" Box ⇒ Select
"BlankActivity" ⇒ Next.
• The "New Blank Activity" dialog appears.
• In "Activity Name", enter "HelloActivity".
• In "Layout Name", enter "activity_hello" (default).
• In "Title", enter "HelloWorld!!" (this title will appear as the screen title) ⇒ Finish.
• Export the project as .apk file
• Open the Emulator by using the command ‘Emulator –avd <name of the AVD>
• Install the android application in the AVD by using the command ‘adb install <name of
the apk file>.apk’
• Run the app by using the following commands:
• Enter the command ‘adb shell’ then press enter key after that enter the following
command,
# am start –a android.intent.MAIN –n <package name>/.<activity name> after
enter the command press enter key then application will be launched.

Program:
HellowordActivity.java:
package example.Helloword;
import android.app.Activity;
import android.os.Bundle;
public class HellowordActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}

Main.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Week10" />
<TextView
android:id="@+id/textView1"
android:layout_width="194dp"
android:layout_height="wrap_content"
android:text="HelloWorld" />
</LinearLayout>

Output:
Viva voice:

1.What is Android?

Android is a software stack for mobile devices that includes an operating system,
middleware and key applications. The Android SDK provides the tools and APIs necessary to
begin developing applications on the Android platform using the Java programming language.

2.Expalin about Application Framework

By providing an open development platform, Android offers developers the ability to


build extremely rich and innovative applications. Developers are free to take advantage of the
device hardware, access location information, run background services, set alarms, add
notifications to the status bar, and much, much more.

3. Expalain about Libraries in android


Android includes a set of C/C++ libraries used by various components of the Android system.
These capabilities are exposed to developers through the Android application framework. Some
of the core libraries are listed below:

• System C library - a BSD-derived implementation of the standard C system library


(libc), tuned for embedded Linux-based devices

• Media Libraries - based on PacketVideo's OpenCORE; the libraries support playback


and recording of many popular audio and video formats, as well as static image files,
including MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG

• Surface Manager - manages access to the display subsystem and seamlessly composites
2D and 3D graphic layers from multiple applications

• LibWebCore - a modern web browser engine which powers both the Android browser
and an embeddable web view

• SGL - the underlying 2D graphics engine

• 3D libraries - an implementation based on OpenGL ES 1.0 APIs; the libraries use either
hardware 3D acceleration (where available) or the included, highly optimized 3D
software rasterizer

• FreeType - bitmap and vector font rendering

• SQLite - a powerful and lightweight relational database engine available to all


applications

4.What items are important in every Android project?

These are the essential items that are present each time an Android project is created:
– AndroidManifest.xml
– build.xml
– bin/
– src/
– res/
– assets/

5. What is the importance of Android in the mobile market?


Developers can write and register apps that will specifically run under the Android environment.
This means that every mobile device that is Android enabled will be able to support and run
these apps. With the growing popularity of Android mobile devices, developers can take
advantage of this trend by creating and uploading their apps on the Android Market for
distribution to anyone who wants to download it

WEEK-10
Aim: Write an Android application program that displays Hello World using Eclipse.
Procedure:
Launch Eclipse
• From "File" menu ⇒ New ⇒ Project.. ⇒ Android Application Project ⇒ Next.
• The "New Android Project" dialog appears:
• In "Application Name", enter "Hello World" (this is the Android appliation name
that shows up on the real device).
• In "Project Name", enter "Helloworld" (this is the Eclipse's project name).
• In "Package Name", enter "example.helloworld".
• In "Build SDK", select the latest version (e.g., Android 4.0 (API 14)).
• In "Minimum Required SDK", select "API 8 Android 2.2 (Froyo)" - almost all of
the Android devices meet this minimum requirement ⇒ Next.
• The "Configure Launcher Icon" dialog appears, which allows you to set the application's
icon to be displayed on the devices ⇒ Next.
• The "Create Activitiy" dialog appears. Check "Create Activity" Box ⇒ Select
"BlankActivity" ⇒ Next.
• The "New Blank Activity" dialog appears.
• In "Activity Name", enter "HelloActivity".
• In "Layout Name", enter "activity_hello" (default).
• In "Title", enter "Hello" (this title will appear as the screen title) ⇒ Finish.
Eclipse ADT creates a default Hello-world Android app.
Run the application by right-click on the project node ⇒ "Run As" ⇒ "Android Application".
Once the emulator started, unlock the device by holding and sweeping the "lock" to the right (or
left). It shall launch your Hello-world app, and displays "Hello, world!" on the screen with a title
"Hello".
If your program is not launched automatically, try launching it from the "app menu" manually,
after the emulator is started. Look for the icon "Hello".
Program:
HellowordActivity.java:
package example.Helloword;
import android.app.Activity;
import android.os.Bundle;

public class HellowordActivity extends Activity {


/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}

Main.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Week10" />
<TextView
android:id="@+id/textView1"
android:layout_width="194dp"
android:layout_height="wrap_content"
android:text="HelloWorld!" />
</LinearLayout>

Output:

Viva voice:
1.What is eclipse?
Eclipse is a Java-based open source platform that allows a software developer to create a
customized development environment (IDE) from plug-in components built
by Eclipse members. Eclipse is managed and directed by the Eclipse.org Consortium.
2.What is android application?
An Android app is a software application running on the Android platform. Because
the Android platform is built for mobile devices, a typical Android app is designed for a
smartphone or a tablet PC running on the Android OS.
3. What is ANR?

ANR is short for Application Not Responding. This is actually a dialog that appears to the user
whenever an application have been unresponsive for a long period of time.

4. When is the onStop() method invoked?

A call to onStop method happens when an activity is no longer visible to the user, either because
another activity has taken over or if in front of that activity.

5. What are the different states wherein a process is based?

There are 4 possible states:


– foreground activity
– visible activity
– background activity
– empty process
WEEK-11
Aim: Write an Android application program that accepts a name from the user and
displays the hello name to the user in response as output using Eclipse.
Procedure:
Step1: Create a new project by choosing it from File menu.
Step2:First give the project name and then select the build target as Android 4.0
Step3: After that give the package name is the format as “name1.name2.name3” and choose the
minimum SDK as 14(Android 4.0)
Step4:Then click on FINISH button then android project is created.
Step5:Open the layout file under the res folder then open main.xml file
Step6: Generate the interface code for the project
Step7: Open the java file and capture all the user interface components
Step8:Assign the action listenet to the button and write the logic for appending the ‘hello’ to the
name which is entered by the user
Step9:Run the project by clicking on the Run button.
Run the application by right-click on the project node ⇒ "Run As" ⇒ "Android Application".
Once the emulator started, unlock the device by holding and sweeping the "lock" to the right (or
left). If your program is not launched automatically, try launching it from the "app menu"
manually, after the emulator is started. Look for the icon "Wk11".
Program:
main.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >

<TextView
android:id="@+id/tv1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Week11" />

<TextView
android:id="@+id/tv2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Enter your name:"
android:textAppearance="?android:attr/textAppearanceMedium" />

<EditText
android:id="@+id/et1"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<requestFocus />
</EditText>
<Button
android:id="@+id/btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
<TextView
android:id="@+id/tv3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textAppearance="?android:attr/textAppearanceLarge" />

</LinearLayout>
Activity.java:
package cse.wk11;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
public class Wk11Activity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TextView tv1=(TextView) findViewById(R.id.tv1);
TextView tv2=(TextView) findViewById(R.id.tv2);
final TextView tv3=(TextView) findViewById(R.id.tv3);
final EditText et=(EditText) findViewById(R.id.et1);
Button btn=(Button) findViewById(R.id.btn);
btn.setOnClickListener(new OnClickListener() {

public void onClick(View arg0) {


// TODO Auto-generated method stub
String s1=et.getText().toString();
tv3.setText("Hello "+s1);

}
});

}
}

Output:
Viva voice:
1.What is SDK ?
A software development kit (SDK or devkit) is typically a set of software development tools
that allows the creation of applications for a certain software package, software framework,
hardware platform, computer system, video game console, operating system, or similar
development platform.
2.What is api?
In computer programming, an Application Programming Interface (API) is a set
of subroutine definitions, protocols, and tools for building application software. In general terms,
it is a set of clearly defined methods of communication between various software components. A
good API makes it easier to develop a computer program by providing all the building blocks,
which are then put together by the programmer.
3.What is AIDL?
AIDL, or Android Interface Definition Language, handles the interface requirements between a
client and a service so both can communicate at the same level through interprocess
communication or IPC. This process involves breaking down objects into primitives that
Android can understand. This part is required simply because a process cannot access the
memory of the other process.

4. What data types are supported by AIDL?

AIDL has support for the following data types:


-string
-charSequence
-List
-Map
-all native Java data types like int,long, char and Boolean

5. What is a Fragment?
A fragment is a part or portion of an activity. It is modular in a sense that you can move around
or combine with other fragments in a single activity. Fragments are also reusable
WEEK-12
Aim: Write an Android application program that demonstrates the following:
(i) LinearLayout
(ii) RelativeLayout
(iii) TableLayout
(iv) GridView layout

Android supports the following ViewGroups:


• LinearLayout
• AbsoluteLayout
• TableLayout
• RelativeLayout
• FrameLayout
Figure 1 Creating a new Android project using Eclipse
.

LinearLayout
The LinearLayout arranges views in a single column or single row. Child views can either be
arranged vertically or horizontally.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
</LinearLayout>
In the main.xml file, observe that the root element is <LinearLayout> and it has a <TextView>
element contained within it. The <LinearLayout> element controls the order in which the views
contained within it appear.
Each View and ViewGroup has a set of common attributes, some of which are shown in Table 1.
Attribute Description
layout_width Specifies the width of the View or ViewGroup
layout_height Specifies the height of the View or ViewGroup
layout_marginTop Specifies extra space on the top side of the View or ViewGroup
layout_marginBottom Specifies extra space on the bottom side of the View or ViewGroup
layout_marginLeft Specifies extra space on the left side of the View or ViewGroup
layout_marginRight Specifies extra space on the right side of the View or ViewGroup
layout_gravity Specifies how child Views are positioned
Specifies how much of the extra space in the layout to be allocated to the
layout_weight
View
layout_x Specifies the x-coordinate of the View or ViewGroup
layout_y Specifies the y-coordinate of the View or ViewGroup
Table 1 Common attributes of views and viewgroups
Note that some of these attributes are only applicable when a View is in certain specific
ViewGroup(s). For example, the layout_weight and layout_gravity attributes are only applicable
if a View is either in a LinearLayout or TableLayout.
For example, the <TextView> element above has its width filling up the entire width of its parent
(which is the screen in this case) using the fill_parent constant. Its height is indicated by the
wrap_content constant, which means that its height is the height of its content (in this case, the
text contained within it). If you do not wish to have the <TextView> view occupy the entire row,
you can set its layout_width attribute to wrap_content, like this:
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
This will set the width of the view to be equal to the width of the text contained within it. You
can also set the width to an absolute value, like this:
<TextView
android:layout_width="105px"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
In this case, the width is set to 105 pixels wide. modify the main.xml file by adding a <Button>
view as shown below:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
>
<TextView
android:layout_width="105px"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
<Button
android:layout_width="100px"
android:layout_height="wrap_content"
android:text="Button"
/>
</LinearLayout>
Figure 3 shows the views laid out from left to right.
Figure 3 The views laid out in LinearLayout

The default orientation of LinearLayout is set to horizontal. If you want to change its orientation
to vertical, set the orientation attribute to vertical, like this:
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
xmlns:android="http://schemas.android.com/apk/res/android"
>
Figure 4 shows the effect of changing the orientation to vertical.
Figure 4 Changing the orientation to vertical

InLinearLayout, you can apply the layout_weight and layout_gravity attributes to views
contained within it, as the following modifications to main.xml shows:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
>
<TextView
android:layout_width="105px"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
<Button
android:layout_width="100px"
android:layout_height="wrap_content"
android:text="Button"
android:layout_gravity="right"
android:layout_weight="0.2"
/>
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="18sp"
android:layout_weight="0.8"
/>
</LinearLayout>
Figure 5 shows that the button is aligned to the right of its parent (which is the LinearLayout)
using the layout_gravity attribute. At the same time, you use the layout_weight attribute to
specify the ratio in which the Button and EditText views occupy the remaining space on the
screen. The total value for the layout_weight attribute must be equal to 1.

Figure 5 Applying the layout_weight and layout_gravity attributes


Figure 7 Using the TableLayout
Note that in the above example, there are two columns and four rows in the TableLayout. The
cell directly under the Password TextView is populated with an empty element. If you don't do
this, the Remember Password checkbox will then appear under the Password TextView, like that

shown in Figure 8.
Figure 8 Note the change in the position of the Remember Password view

RelativeLayout
The RelativeLayout lets you specify how child views are positioned relative to each other.
Consider the following main.xml file:
<?xml version="1.0" encoding="utf-8"?>
Figure 9 Using RelativeLayout to layout views
FrameLayout
The FrameLayout is a placeholder on screen that you can use to display a single view. Views that
you add to a FrameLayout is always anchored to the top left of the layout. Consider the
following content in main.xml:
You can add multiple views to a FrameLayout, but each will stack on top of the previous one.
Program:
LLActivity.java:
package cse.LL;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
public class LLActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button btn1=(Button) findViewById(R.id.LLbtn);
Button btn2=(Button) findViewById(R.id.RLbtn);
Button btn3=(Button) findViewById(R.id.TLbtn);
Button btn4=(Button) findViewById(R.id.GLbtn);
btn1.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
Intent i1=new Intent(LLActivity.this,LL.class);
startActivity(i1);

}
});
btn2.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
Intent i2=new Intent(LLActivity.this,RL.class);
startActivity(i2);

}
});
btn3.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
Intent i3=new Intent(LLActivity.this,TL.class);
startActivity(i3);
}
});
btn4.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
Intent i4=new Intent(LLActivity.this,GL.class);
startActivity(i4);
}
});
}
}
LL.java:
package cse.LL;
import android.app.Activity;
import android.os.Bundle;
public class LL extends Activity{
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.ll);
}
}
RL.java:
package cse.LL;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.GridView;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;
public class GL extends Activity{
static final String[] numbers = new String[] {
"1", "2", "3", "4", "5",
"6", "7", "8", "9", "*",
"0", "#"};
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.gl);
GridView gridView=(GridView) findViewById(R.id.gridView1);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, numbers);
gridView.setAdapter(adapter);
gridView.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
long arg3) {
// TODO Auto-generated method stub
Toast.makeText(getApplicationContext(),
((TextView) arg1).getText(),
Toast.LENGTH_SHORT).show();
}
});
}
}
TL.java:
package cse.LL;
import android.app.Activity;
import android.os.Bundle;
public class TL extends Activity{
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.tl);
}

}
GL.java:
package cse.LL;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.GridView;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;
public class GL extends Activity{
static final String[] numbers = new String[] {
"1", "2", "3", "4", "5",
"6", "7", "8", "9", "*",
"0", "#"};
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.gl);
GridView gridView=(GridView) findViewById(R.id.gridView1);

ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,


android.R.layout.simple_list_item_1, numbers);
gridView.setAdapter(adapter);
gridView.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
long arg3) {
// TODO Auto-generated method stub
Toast.makeText(getApplicationContext(),
((TextView) arg1).getText(), Toast.LENGTH_SHORT).show();

}
});
}
}
Main.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
>

<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Select one Layout"
android:textAppearance="?android:attr/textAppearanceLarge" />
<Button
android:id="@+id/LLbtn"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:text="Linear" />
<Button
android:id="@+id/RLbtn"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:text="Relative" />
<Button
android:id="@+id/TLbtn"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:text="Table" />
<Button
android:id="@+id/GLbtn"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:text="Grid" />
</LinearLayout>
ll.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
>
<TextView
android:id="@+id/logtv1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Login Here"
android:textSize="30dp" />
<TextView
android:id="@+id/logtv3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Password"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/logtv2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="UserID"
android:textAppearance="?android:attr/textAppearanceLarge" />
<EditText
android:id="@+id/logidet1"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:text="" >
<requestFocus />
</EditText>
<EditText
android:id="@+id/logidet2"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:text=""
/>
<TextView
android:id="@+id/logreg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Register here" />
<Button
android:id="@+id/canclbtn"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:text="Cancel" />
<TextView
android:id="@+id/logforgot"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Forgot ur password???" />
<Button
android:id="@+id/logbtn"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:text="Login" />
<TextView
android:id="@+id/textView1log"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textAppearance="?android:attr/textAppearanceLarge" />

<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_launcher" />

</LinearLayout>
rl.xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/logtv1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="Login Here"
android:textSize="30dp" />
<TextView
android:id="@+id/logtv3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/logtv2"
android:layout_marginTop="30dp"
android:text="Password"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/logtv2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/logtv1"
android:text="UserID"
android:textAppearance="?android:attr/textAppearanceLarge" />
<EditText
android:id="@+id/logidet1"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignRight="@+id/logtv1"
android:layout_alignTop="@+id/logtv2"
android:text="" />
<EditText
android:id="@+id/logidet2"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignTop="@+id/logtv3"
android:inputType="textPassword" />
<Button
android:id="@+id/logbtn"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="150dp"
android:text="Login" />
</RelativeLayout>
tl.xml:
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:stretchColumns="1" >
<TableRow>
<TextView
android:id="@+id/db_tv1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Name "
android:textSize="25dp"
android:inputType="textPersonName"/>
<EditText
android:id="@+id/db_ed1"
android:layout_width="130dp"
android:layout_height="wrap_content"
/>
</TableRow>
<TableRow>
<TextView
android:id="@+id/db_tv2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Age "
android:textSize="25dp"
/>
<EditText
android:id="@+id/db_ed2"
android:layout_width="130dp"
android:layout_height="wrap_content"
/>
</TableRow>
<TableRow>
<TextView
android:id="@+id/db_tv3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Blood Group "
android:textSize="25dp" />
<Spinner
android:id="@+id/db_ed3"
android:layout_width="150dp"
android:layout_height="30dp"
/>
</TableRow>
<TableRow>
<TextView
android:id="@+id/db_tv4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Weight "
android:textSize="25dp" />
<EditText
android:id="@+id/db_ed4"
android:layout_width="130dp"
android:layout_height="wrap_content" />
</TableRow>
<TableRow>
<TextView
android:id="@+id/db_tv5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="City"
android:textSize="25dp" />
<EditText
android:id="@+id/db_ed5"
android:layout_width="130dp"
android:layout_height="wrap_content"
/>
</TableRow>
<TableRow>
<TextView
android:id="@+id/db_tv6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Mobile no "
android:textSize="25dp"
/>
<EditText
android:id="@+id/db_ed6"
android:layout_width="130dp"
android:layout_height="wrap_content"
android:inputType="phone"/>
</TableRow>
</TableLayout>
gl.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<GridView
android:id="@+id/gridView1"
android:numColumns="3"
android:gravity="center"
android:columnWidth="50dp"

android:verticalSpacing="40dp"
android:stretchMode="columnWidth"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
</GridView>
</LinearLayout>
NOTE:
Add the following code in the AndroidManifest.xml file:
<activity android:name=".LL"/>
<activity android:name=".RL"/>
<activity android:name=".TL"/>
<activity android:name=".GL"/>

OUTPUT:
Viva voice:
1.What is Linear layout?
LinearLayout is a view group that aligns all children in a single direction, vertically or
horizontally. You can specify the layout direction with theandroid:orientation attribute. ...
A LinearLayoutrespects margins between children and the gravity (right, center, or left
alignment) of each child.
2.What is Relative layout?
RelativeLayout is a view group that displays child views in relative positions. The position of
each view can be specified as relative to sibling elements (such as to the left-of or below another
view) or in positions relative to the parent RelativeLayoutarea (such as aligned to the bottom, left
or center).
3.What is table layout?
layout that arranges its children into rows and columns. A TableLayout consists of a number
of TableRow objects, each defining a row (actually, you can have other children, which will be
explained below). TableLayout containers do not display border lines for their rows, columns, or
cells. Each row has zero or more cells; each cell can hold one View object. The table has as
many columns as the row with the most cells. A table can leave cells empty. Cells can span
columns, as they can in HTML.

4.What is gridview layout?


A layout that places its children in a rectangular grid. The grid is composed of a set of infinitely
thin lines that separate the viewing area into cells. Throughout the API, grid lines are referenced
by grid indices.
5. What is an action?
In Android development, an action is what the intent sender wants to do or expected to get as a
response. Most application functionality is based on the intended action.
WEEK-13
Aim: Write an android application program that converts the temperature from Celsius to
Fahrenheit. Compile and build the project.
Procedure:
1.Import Packages
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.Toast;
2.Read the Temperature
3.Convert it into Celsius
return ((fahrenheit - 32) * 5 / 9);
4.Convert it into Fahrenheit
return ((celsius * 9) / 5) + 32;
Program:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/tv1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Week13" />
<TextView
android:id="@+id/tv2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Celsius to Fahrenheit"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/tv3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Enter the temperature"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/et"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<requestFocus />
</EditText>
<TextView
android:id="@+id/tv4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textAppearance="?android:attr/textAppearanceMedium" />
<Button
android:id="@+id/btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="CONVERT" />
</LinearLayout>
Wk13Activity.java:
package cse.wk13;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
public class Wk13Activity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TextView tv1=(TextView) findViewById(R.id.tv1);
TextView tv2=(TextView) findViewById(R.id.tv2);
TextView tv3=(TextView) findViewById(R.id.tv3);
final TextView tv4=(TextView) findViewById(R.id.tv4);
final EditText et=(EditText) findViewById(R.id.et);
Button btn=(Button) findViewById(R.id.btn);
btn.setOnClickListener(new OnClickListener() {
public void onClick(View arg0) {
// TODO Auto-generated method stub
String s1=et.getText().toString();
int cel=Integer.parseInt(s1);
float faren=(float) ((cel*1.8)+32);
String res=Float.toString(faren);
tv4.setText("Temperature in Fahrenheit is "+res);

}
});

Output:
Viva voice:
1.Expalin android application development
A layout that places its children in a rectangular grid. The grid is composed of a set of infinitely
thin lines that separate the viewing area into cells. Throughout the API, grid lines are referenced
by grid indices.

2. What are the code names of android?


• Aestro

• Blender

• Cupcake

• Donut

• Eclair

• Froyo

• Gingerbread

• Honycomb

3. What are the life cycle methods of android activity?


There are 7 life-cycle methods of activity. They are as follows:
onCreate()
onStart()
onResume()
onPause()
onStop()
onRestart()
onDestroy()
4. What is NDK?
NDK stands for Native Development Kit. By using NDK, you can develop a part of app using
native language such as C/C++ to boost the performanc
5. Which types of flags are used to run an application on Android?
Following are two types of flags to run an application in Android:
FLAG_ACTIVITY_NEW_TASK
FLAG_ACTIVITY_CLEAR_TOP
WEEK-14
Aim: Write an Android application program that demonstrates intent in mobile
application development.
Procedure:
Intents are a powerful concept as they allow the creation of loosely coupled applications. Intents
can be used to communicate between any installed application components on the device.
Step1: Create a new project by choosing it from File menu.
Step2:First give the project name and then select the build target as Android 4.0
Step3: After that give the package name is the format as “name1.name2.name3” and choose the
minimum SDK as 14(Android 4.0)
Step4:Then click on FINISH button then android project is created.
Step5:Create a new class file and xml file with the names wk14sub and submain respectively
under the project node
Step6:Open the layout folder under the res folder then open main.xml file
Step7: Generate the interface code for the first page of project
Step8: Generate the interface code for the second page of project
Step9: Capture all the required components from the first xml file in the first class file and assign
the action listener to the button
Step10:Create an intent within in the action listener block of the button by using the following
syntax,
Intent <intent name>=new Intent(<senderclassname>.this,<reveiverclassname>.class);
startActivity(<intentname>);
Step11:Capture all the required components from the second xml file in the second class file and
get the intent by using the following syntax:
Intent <intent name>=getIntent();
Step12:Assign the values received to the text filed components of the second xml file
Step13:Run the project by clicking on the Run button.
Run the application by right-click on the project node ⇒ "Run As" ⇒ "Android Application".
Once the emulator started, unlock the device by holding and sweeping the "lock" to the right (or
left). If your program is not launched automatically, try launching it from the "app menu"
manually, after the emulator is started. Look for the icon "Wk14".
Note: Add the newclass name in the androidmanifest.xml file under the project node.

Program:
package cse.wk14;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
public class Wk14Activity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TextView tv1=(TextView) findViewById(R.id.tv1);
TextView tv2=(TextView) findViewById(R.id.tv2);
TextView tv3=(TextView) findViewById(R.id.tv3);
TextView tv4=(TextView) findViewById(R.id.tv4);
Button btn=(Button) findViewById(R.id.btn1);
final EditText et1=(EditText) findViewById(R.id.et1);
final EditText et2=(EditText) findViewById(R.id.et2);
btn.setOnClickListener(new OnClickListener() {
public void onClick(View arg0) {
// TODO Auto-generated method stub
String name=et1.getText().toString();
String num=et2.getText().toString();
Intent i=new Intent(Wk14Activity.this,wk14sub.class);
i.putExtra("name",name);
i.putExtra("num",num);
startActivity(i);

}
});
}
}
wk14sub.java:
package cse.wk14;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class wk14sub extends Activity {


/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.submain);
TextView tv1=(TextView) findViewById(R.id.tv1);
TextView tv2=(TextView) findViewById(R.id.tv2);
final TextView tv3=(TextView) findViewById(R.id.tv3);
TextView tv4=(TextView) findViewById(R.id.tv4);
final TextView tv5=(TextView) findViewById(R.id.tv5);
Button btn=(Button) findViewById(R.id.btn);
btn.setOnClickListener(new OnClickListener() {

public void onClick(View arg0) {


// TODO Auto-generated method stub

Intent i1=getIntent();
String name=i1.getStringExtra("name");
String num=i1.getStringExtra("num");
tv3.setText(name);
tv5.setText(num);

}
});
}
}
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >

<TextView
android:id="@+id/tv1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Week14" />
<TextView
android:id="@+id/tv2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Enter your details:"
android:textAppearance="?android:attr/textAppearanceLarge" />

<TextView
android:id="@+id/tv3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Name:"
android:textAppearance="?android:attr/textAppearanceMedium" />

<EditText
android:id="@+id/et1"
android:layout_width="match_parent"
android:layout_height="wrap_content" >

<requestFocus />
</EditText>

<TextView
android:id="@+id/tv4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Regd.No:"
android:textAppearance="?android:attr/textAppearanceMedium" />

<EditText
android:id="@+id/et2"
android:layout_width="match_parent"
android:layout_height="wrap_content" />

<Button
android:id="@+id/btn1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="SEND" />

</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

<TextView
android:id="@+id/tv1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Entered Details"
android:textAppearance="?android:attr/textAppearanceLarge" />

<TextView
android:id="@+id/tv2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="NAME:"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/tv3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/tv4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Regd.No:"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/tv5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textAppearance="?android:attr/textAppearanceMedium" />
<Button
android:id="@+id/btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="RECEIVE" />
</LinearLayout>
Output:
Viva voice:
1.What are the advantages of android?

Open-source: It means no licence, distribution and development fee.


Platform-independent: It supports windows, mac and linux platforms.
Supports various technologies: It supports camera, bluetooth, wifi, speech, EDGE etc.
technologies.
Highly optimized Virtual Machine: Android uses highly optimized virtual machine for mobile
devices, called DVM (Dalvik Virtual Machine).
2.What are the core building blocks of android?
The core building blocks of android are:
• Activity

• View

• Intent

• Service

• Content Provider

• Fragment etc.
3. Why cannot you run standard Java bytecode on Android?
Android uses Dalvik Virtual Machine (DVM) which requires a special bytecode. First of all, we
have to convert Java class files into Dalvik Executable files using an Android tool called “dx”. In
normal circumstances, developers will not be using this tool directly and build tools will care for
the generation of DVM compatible files.
4. Can Android application only be programmed in Java?
No, it is not necessary. You can program Android apps can be created using NDK in C/C++. The
NDK is a toolset that allows you to implement parts of your app using native-code languages
such as C and C++. Typically, good use cases for the NDK are CPU-intensive applications such
as game engines, signal processing, and physics simulation
5. Where will you declare your activity so the system can access it?
Activity is to be declared in the manifest file. For example:
<manifest></manifest>
<application></application>
<activity android:name=”.MyIntellipaat”>

Week15

Additional Experiment:
Aim: To implement code division multiple access
Procedure:
Step1: Create a new project by choosing it from File menu.
Step2:First give the project name and then select the build target as Android 4.0
Step3: After that give the package name is the format as “name1.name2.name3” and choose the
minimum SDK as 14(Android 4.0)
Step4:Then click on FINISH button then android project is created.
Step5:Create a new class file and xml file with the names wk14sub and submain respectively
under the project node
Step6:Open the layout folder under the res folder then open main.xml file
Step7: Generate the interface code for the first page of project
Step8: Generate the interface code for the second page of project
Step9: Capture all the required components from the first xml file in the first class file and assign
the action listener to the button
Step10:Create an intent within in the action listener block of the button by using the following
syntax,
Intent <intent name>=new Intent(<senderclassname>.this,<reveiverclassname>.class);
startActivity(<intentname>);
Step11:Capture all the required components from the second xml file in the second class file and
get the intent by using the following syntax:
Intent <intent name>=getIntent();
Step12:Assign the values received to the text filed components of the second xml file
Step13:Run the project by clicking on the Run button.
Program:
importjava.io.*;
class cdma1
{
BufferedReader br=new BufferedReader(new
InputStreamReader(System.in));
int dataa,datab;
int keya[]=new int [6];
int keyb[]=new int [6];
int key1[]=new int [6];
int key2[]=new int [6];
int key3[]=new int[6];
int ina ,inb;

public void getdata()throws IOException


{
System.out.println("A-Enter data bit");
ina=Integer.parseInt(br.readLine());
if(ina>1 ||ina<0)
System.out.println("Error enter binary");

System.out.println("B-Enter data bit");


inb=Integer.parseInt(br.readLine());
if(inb>1 ||inb<0)
System.out.println("Error enter binary");

System.out.println("A-Enter the 6bit binary key");


for(int i=0;i<6;i++)
{keya[i]=Integer.parseInt(br.readLine());
if(keya[i]>1 ||keya[i]<0)
{System.out.println("Error enter binary");
}
}
System.out.println("B-Enter the 6 bit binary key");
for(int i=0;i<6;i++)
{keyb[i]=Integer.parseInt(br.readLine());
if(keyb[i]>1 ||keyb[i]<0)
{System.out.println("Error enter binary");
}
}
}

public void compute()throws IOException


{

if (ina==0)
dataa=-1;
else
dataa=1;
if(inb==0)
datab=-1;
else
datab=1;

for(int i=0;i<6;i++)
{
if(keya[i]==0)
{
key1[i]=-1;
}
else
{
key1[i]=1;
}
}

for(int i=0;i<6;i++)
{
if(keyb[i]==0)
{
key2[i]=-1;
}
else
{
key2[i]=1;
}
}

for(int i=0;i<6;i++)
{
keya[i]=key1[i]*dataa;
keyb[i]=key2[i]*datab;
key3[i]=keya[i]+keyb[i];
}

for(int i=0;i<6;i++)
{
keya[i]=key3[i]*key1[i];
keyb[i]=key3[i]*key2[i];
}
int totala=0;
int totalb=0;
for(int i=0;i<6;i++)
{
totala=totala+keya[i];
totalb=totalb+keyb[i];
}

System.out.println("Transformed key a");


for(int i=0;i<6;i++)
System.out.print(key1[i]+" ");

System.out.println("Transformed key b");


for(int i=0;i<6;i++)
System.out.print(key2[i]+" ");
System.out.println("The sum of a is "+totala);
System.out.println("The sum of b is "+totalb);
if(totala>=0)
System.out.println("The data entered by A is 1");
else
System.out.println("The data entered by A is 0");

if(totalb>=0)
System.out.println("The data entered by B is 1");
else
System.out.println("The data entered by B is 0");

}
class cdma
{
public static void main(String args[])throws IOException
{
cdma1 c=new cdma1();
c.getdata();
c.compute();
}
}

Output:
Viva voice:

1.What is intent?
It is a kind of message or information that is passed to the components. It is used to launch an
activity, display a web page, send sms, send email etc. There are two types of intents in android:
• Implicit Intent

• Explicit Intent

2.What is ADB in android?


It is acts as bridge between emulator and IDE, it executes remote shell commands to run
applications on an emulator
3. What is ANR in android?
ANR stands for application is not responding, basically it is a dialog box that appears when the
application is not responding.
4. What is ADB?

ADB stands for Android Debug Bridge. It is a command line tool that is used to communicate
with the emulator instance. ADB can control your device over USB from a computer, copy files
back and forth, install and uninstall apps, run shell commands, and more. It is a client-server
program that includes three components:
• A client, which runs on your development machine. You can invoke a client from a shell by
issuing an ADB command. Other Android tools such as DDMS also create ADB clients.
5. What are the different storage methods in Android?

Android offers several different options for data persistence. Shared Preferences – Store private
primitive data in key-value pairs. This sometimes gets limited as it offers only key-value pairs.
You cannot save your own java types. Internal Storage – Store private data on the device
memory.

Week16

Aim: Detailed study of wireless Application protocols


WAP stands for Wireless Application Protocol. Per the dictionary definition for each of these

words we have:
• Wireless: Lacking or not requiring a wire or wires pertaining to radio

transmission.

• Application: A computer program or piece of computer software that is designed

to do a specific task.

• Protocol: A set of technical rules about how information should be transmitted

and received using computers.

WAP is the set of rules governing the transmission and reception of data by computer

applications on or via wireless devices like mobile phones. WAP allows wireless devices to

view specifically designed pages from the Internet using only plain text and very simple black-

and-white pictures.

WAP is a standardized technology for cross-platform, distributed computing very similar to the

Internet's combination of Hypertext Markup Language (HTML) and Hypertext Transfer

Protocol (HTTP), except that it is optimized for:

• low-display capability

• low-memory

• low-bandwidth devices, such as personal digital assistants (PDAs), wireless

phones, and pagers.

Who is behind WAP?


The Wireless Application Protocol (WAP) is a result of joint efforts taken by companies

teaming up in an industry group called WAP Forum (www.wapforum.org).


On June 26, 1997, Ericsson, Motorola, Nokia, and Unwired Planet took the initiative to start a

rapid creation of a standard for making advanced services within the wireless domain a reality.

In December 1997, WAP Forum was formally created and after the release of the WAP 1.0

specifications in April 1998, WAP Forum membership was opened to all.

The WAP Forum now has over 500 members and represents over 95 percent of the global

handset market. Companies such as Nokia, Motorola and Ericsson are all members of the

forum.

The objective of the forum is to create a license-free standard that brings information and

telephony services to wireless devices.

Why is WAP Important?


Until the first WAP devices emerged, the Internet was a Internet and a mobile phone was a
mobile phone. You could surf the Net, do serious research, or be entertained on the Internet
using your computer, but this was limited to your computer.

Now with the appearance of WAP, the scene is that we have the massive information,
communication, and data resources of the Internet becoming more easily available to anyone
with a mobile phone or communications device.

WAP being open and secure, is well suited for many different applications including, but not
limited to stock market information, weather forecasts, enterprise data, and games.

Despite the common misconception, developing WAP applications requires only a few
modifications to existing web applications. The current set of web application development
tools will easily support WAP development, and in the future more development tools will be
announced

Viva voice:
1.Why is WAP used in the browser?

- WAP is also known ad Wireless Application Protocol that is used for the technical standards.

- This provides the accessing of the information over the wireless network of the mobile
services.

- WAP is used for the mobile devices and act as a browser for the mobile phones that uses the
protocol used only in phones.

2.What are the differences being brought from WAP 1.1 to WAP 1.3?
- WAP has developed in providing the software and the releases being made by using the WAP
specifications.

- WAP provides the software protocol that can be used to enhance the specification over time.

- WAP supports group of large number of mobile operators and market and consists of no in-
built technology.

3.What is Wireless Application Protocol(WAP)?

Meaning really arises from the full form itself-

Wireless– that does not require wires, enabling radio transmission.

Application– a software designed to complete a particular task.

Protocol– means a set of rules.

4.Why do we need WAP?


Long before the first WAP devices came, Internet was limited to your computer only. Now with
WAP, you can communicate to your friends using Internet through your mobile phone too.
Thus globally expanding massive communication and sharing of data.

5.What is a Micro WAP Browser?

Similar to your own internet browser, there is a browser for WAP too. This browser is called
Micro WAP Browser that is used for visiting web-sites through a WAP device. What’s special
about it is, it makes minimal demands on hardware, memory and CPU and it displays the
information in WML(it a restricted mark-up language

S-ar putea să vă placă și