58
Wireless Technology & Mobile Communication Practical Journal INDEX Sr. No. Topic Date Page Sign PART I – J2ME 1 Write a program in J2ME to perform the following tasks: A] Draw a text box on the device screen. B] Change the background colour of the device screen. C] Change the colour of the text. D] Change the font style and font size of the displayed text. 20/07/2009 2 Wrie a program in J2ME to perform the simple calculator operations such as a. Addition b. Subtraction c. Multiplication d. Division 27/07/2009 3 Write a program in J2ME to create a simple Quiz which content 3 to 4 questions and also display the score. 03/08/2009 4 Write a program in J2ME to create a currency converter and also display the result. 10/08/2009

Wireless Tech Pract Journal(1)

Embed Size (px)

DESCRIPTION

wt journal

Citation preview

Page 1: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

INDEX

Sr. No.

Topic Date Page Sign

PART I – J2ME

1

Write a program in J2ME to perform the following tasks:

A] Draw a text box on the device screen.

B] Change the background colour of the device screen.

C] Change the colour of the text.

D] Change the font style and font size of the displayed text.

20/07/2009

2

Wrie a program in J2ME to perform the simple calculator operations such as

a. Additionb. Subtraction c. Multiplicationd. Division

27/07/2009

3Write a program in J2ME to create a simple Quiz which content 3 to 4 questions and also display the score.

03/08/2009

4Write a program in J2ME to create a currency converter and also display the result.

10/08/2009

5.Write a program in J2ME to generate a calendar.

17/08/2009

Page 2: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

Sr. No.

Topic Date Page Sign

6

Write a program in J2ME to demonstrate simple animation through snake movement

.

07/09/2009

7 Write a program in J2ME to create a simple database application with an address book with the following operations:

a. Insertb. Deletec. Updated. Retrieve

14/09/2009

PART II – XHTML & WML

8 Develop a simple website using XHTML 05/10/2009

9 Develop a simple website using WML 12/10/2009

PART III – Demo Steps

10File transfer between Laptop & Mobile phone using Bluetooth

26/10/2009

Page 3: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

PRACTICAL No. 1

Que: Write a program in J2ME to perform the following tasks:

A] Draw a text box on the device screen.B] Change the background colour of the device screen.C] Change the colour of the text.D] Change the font style and font size of the displayed text.

Program 1:

import javax.microedition.midlet.*;import javax.microedition.lcdui.*;import java.io.*;import java.util.*;

Program 2:

import javax.microedition.lcdui.*;import javax.microedition.media.*;import java.io.*;

public class ColorCanvas extends Canvas implements CommandListener {

private int i; private Display display; private int width, height; String str2;

int j=1,bcol,fcol,sty;

private Command background = new Command("BACKGROUND",

Command.SCREEN,1);private Command textcolor = new Command("TEXTCOLOR",

Command.SCREEN,1);private Command fontstyle = new Command("CHANGE

FONTSTYLE", Command.SCREEN,1);private Command fontsize = new Command("CHANGE

FONTSIZE", Command.SCREEN,1);

Page 4: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

private Command change=new Command("CHANGE",

Command.SCREEN,1);static java.util.Random random = new java.util.Random();

public ColorCanvas(Display d,String str) {

display = d;str2= str;this.addCommand(background);this.addCommand(textcolor);this.addCommand(fontstyle);this.addCommand(fontsize);setCommandListener(this);bcol=random.nextInt()>>>1;fcol=random.nextInt()>>>1;repaint();

}protected void paint(Graphics g) {

width = getWidth();height = getHeight();g.setColor(bcol);g.fillRect(0,0, width, height);g.setColor(fcol);g.drawString(str2,4,4,Graphics.TOP |Graphics.LEFT);System.out.println("Case : "+i);switch(i){

case 1:bcol=random.nextInt()>>>1;g.setColor(bcol);g.fillRect(0,0,width,height);g.setColor(fcol);g.drawString(str2,4,4,Graphics.TOP

|Graphics.LEFT);break;

case 2:g.setColor(bcol);g.fillRect(0,0,width,height);

fcol=random.nextInt()>>>1;g.setColor(fcol);g.drawString(str2,4,4,Graphics.TOP

|Graphics.LEFT);break;

Page 5: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

case 3:g.setColor(bcol);g.fillRect(0,0,width,height);g.setFont(Font.getFont(Font.FACE_MO

NOSPACE,Font.STYLE_ITALIC,Font.SIZE_SMALL));sty=0;

g.setColor(fcol);g.drawString(str2,4,4,Graphics.TOP

|Graphics.LEFT); break;

case 4:g.setColor(bcol);g.fillRect(0,0,width,height);g.setFont(Font.getFont(Font.FACE_

MONOSPACE,Font.STYLE_PLAIN,Font.SIZE_SMALL));sty=1;g.setColor(fcol);g.drawString(str2,4,4,Graphics.TOP

|Graphics.LEFT); break;

case 5:g.setColor(bcol);g.fillRect(0,0,width,height);

g.setFont(Font.getFont(Font.FACE_MONOSPACE,Font.STYLE_ITALIC,Font.SIZE_SMALL));g.setColor(fcol);

g.drawString(str2,4,4,Graphics.TOP |Graphics.LEFT);

break;

case 6:g.setColor(bcol);g.fillRect(0,0,width,height);

g.setFont(Font.getFont(Font.FACE_MONOSPACE,Font.STYLE_ITALIC,Font.SIZE_LARGE));g.setColor(fcol);g.drawString(str2,4,4,Graphics.TOP

|Graphics.LEFT);

Page 6: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

break;

case 7:g.setColor(bcol);g.fillRect(0,0,width,height);g.setFont(Font.getFont(Font.FACE_MONOSPACE,Font.STYLE_PLAIN,Font.SIZE_SMALL));g.setColor(fcol);g.drawString(str2,4,4,Graphics.TOP

|Graphics.LEFT); break;

case 8:g.setColor(bcol);g.fillRect(0,0,width,height);g.setFont(Font.getFont(Font.FACE_MONOSPACE,Font.STYLE_PLAIN,t.SIZE_LARGE));g.setColor(fcol);g.drawString(str2,4,4,Graphics.TOP

|Graphics.LEFT); break;

default:break;

}}public void commandAction(Command c, Displayable d){

if (c==background){

i=1;repaint();

}else if(c==textcolor){

i=2;repaint();

}else if(c==fontstyle){

if(j==1){

i=3;sty=0;

Page 7: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

j=0;}else{

j=1;sty=1;i=4;

}repaint();

}else if(c==fontsize){

if(j==1 && sty==1){

i=5;sty=0;

}else if(j==1 && sty==0){

i=6;sty=1;

}else if(j==0 && sty==1){

i=7;sty=0;

}else if(j==0 && sty==0){

i=8;sty=1;

} }

}public void pauseApp() {}public void destroyApp(boolean unconditional) {}

}

Page 8: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

OUTPUT:

Page 9: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

Page 10: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

Page 11: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

PRACTICAL No. 2

Que: Wrie a program in J2ME to perform the simple calculator operations such as -

a. Additionb. Subtraction c. Multiplicationd. Division

Program:

import javax.microedition.midlet.*;import javax.microedition.lcdui.*;public class Calc extends MIDlet implements CommandListener{

Display disp;TextField tf1,tf2,tf3;Form form;Command add,sub,mul,div,mod,exit;

public Calc(){

disp=Display.getDisplay(this);form=new Form("Addition of two nos");tf1=new TextField("First no.","0",30,TextField.ANY);tf2=new TextField("Second no.","0",30,TextField.ANY);tf3=new TextField("Result","0",30,TextField.ANY);form.append(tf1);form.append(tf2);form.append(tf3);add=new Command("add",Command.SCREEN,1);sub=new Command("subtract",Command.SCREEN,1);mul=new Command("multiply",Command.SCREEN,1);div=new Command("Divide",Command.SCREEN,1);mod=new Command("modulus",Command.SCREEN,1);exit=new Command("Exit",Command.EXIT,2);form.addCommand(add);form.addCommand(sub);form.addCommand(mul);form.addCommand(div);form.addCommand(mod);form.addCommand(exit);form.setCommandListener(this);

}public void startApp(){

Page 12: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

disp.setCurrent(form);}public void pauseApp(){}public void destroyApp(boolean unconditional){}

public void commandAction(Command c,Displayable d){

if(c==add){

int a=Integer.parseInt(tf1.getString());int b=Integer.parseInt(tf2.getString());int c1=a+b;tf3.setString(String.valueOf(c1));

}if(c==sub){

int a=Integer.parseInt(tf1.getString());int b=Integer.parseInt(tf2.getString());int c1=a-b;tf3.setString(String.valueOf(c1));

}if(c==mul){

int a=Integer.parseInt(tf1.getString());int b=Integer.parseInt(tf2.getString());int c1=a*b;tf3.setString(String.valueOf(c1));

}if(c==div){

int a=Integer.parseInt(tf1.getString());int b=Integer.parseInt(tf2.getString());if(b==0)

tf3.setString("Divisor cannot be zero");else{int c1=a/b;tf3.setString(String.valueOf(c1));}

}if(c==mod){

int a=Integer.parseInt(tf1.getString());int b=Integer.parseInt(tf2.getString());

Page 13: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

if(b==0)tf3.setString("Divisor cannot be zero");

else{int c1=a%b;tf3.setString(String.valueOf(c1));}

}if(c==exit){

destroyApp(false);notifyDestroyed();

}}

}

OUTPUT:

Page 14: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

PRACTICAL No. 3

Que: Write a program in J2ME to create a simple Quiz which content 3 to 4 questions and also display the score.

Program:

import javax.microedition.midlet.*;import javax.microedition.lcdui.*;import java.lang.*;

public class QuizDemo extends MIDlet implements CommandListener, ItemStateListener{

private Display disp;private Form form1,form2,form3,form4;private Command exit,next1,next2,next3,submit;private TextBox msg;private Item selection;private ChoiceGroup radiobuttons,rdb2,rdb3,rdb4;StringItem ms1,ms2,ms3,ms4;private int defaultIndex;private int radioButtonIndex;int flag=0;

public QuizDemo(){

disp=Display.getDisplay(this);

ms1=new StringItem(null,"Which following city is capital of India ?");

radiobuttons=new ChoiceGroup("Select your answer",Choice.EXCLUSIVE);

radiobuttons.append("Bangalore",null);radiobuttons.append("Delhi",null);radiobuttons.append("Mumbai",null);radiobuttons.append("Pune",null);

ms2=new StringItem(null,"Which following city is capital of Japan? ");

rdb2=new ChoiceGroup("Select your answer",Choice.EXCLUSIVE);

rdb2.append("Ya ka nua",null);rdb2.append("Bijieng",null);rdb2.append("Tokiyo",null);rdb2.append("ku do su",null);

Page 15: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

ms3=new StringItem(null,"Which following city is capital of UK? ");

rdb3=new ChoiceGroup("Select your answer",Choice.EXCLUSIVE);

rdb3.append("Amsterdam",null);rdb3.append("London",null);rdb3.append("New York",null);rdb3.append("Mexico",null);

ms4=new StringItem(null,"Which following city is capital of Egypt? ");

rdb4=new ChoiceGroup("Select your answer",Choice.EXCLUSIVE);

rdb4.append("Peru",null);rdb4.append("Rome",null);rdb4.append("Kairo",null);rdb4.append("Sydney",null);

form1=new Form("Question 1");form1.append(ms1);radioButtonIndex=form1.append(radiobuttons);form2=new Form("Question 2");form2.append(ms2);radioButtonIndex=form2.append(rdb2);form3=new Form("Question 3");form3.append(ms3);radioButtonIndex=form3.append(rdb3);form4=new Form("Question 4");form4.append(ms4);radioButtonIndex=form4.append(rdb4);

exit=new Command("Exit",Command.EXIT,1);submit=new Command("Submit",Command.SCREEN,2);next1=new Command("Next",Command.SCREEN,1);next2=new Command("Next",Command.SCREEN,1);next3=new Command("Next",Command.SCREEN,1);msg=new TextBox("Message","Congrats",80,0);

form1.addCommand(next1);form2.addCommand(next2);form3.addCommand(next3);form4.addCommand(submit);form4.addCommand(exit);form1.setCommandListener(this);form2.setCommandListener(this);

Page 16: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

form3.setCommandListener(this);form4.setCommandListener(this);

form1.setItemStateListener(this);form2.setItemStateListener(this);form3.setItemStateListener(this);form4.setItemStateListener(this);

}

public void startApp(){

disp.setCurrent(form1);}

public void pauseApp(){

}public void destroyApp(boolean unconditional){

}

public void itemStateChanged(Item item){

if(item==radiobuttons){

String ans=(radiobuttons.getString(radiobuttons.getSelectedIndex()));

if(ans.equals("Delhi")){

flag++;}

}if(item==rdb2){

String ans=(rdb2.getString(rdb2.getSelectedIndex()));if(ans.equals("Tokiyo")){

flag++;}

Page 17: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

}if(item==rdb3){

String ans=(rdb3.getString(rdb3.getSelectedIndex()));if(ans.equals("London")){

flag++;}

}if(item==rdb4){

String ans=(rdb4.getString(rdb4.getSelectedIndex()));if(ans.equals("Kairo")){

flag++;}

}

}

public void commandAction(Command com,Displayable disp1){

if(com==next1){

disp.setCurrent(form2);}if(com==next2){

disp.setCurrent(form3);}if(com==next3){

disp.setCurrent(form4);}if(com==exit){

destroyApp(false);notifyDestroyed();

}if(com==submit){

//disp.setCurrent(msg);StringItem msg1=new StringItem(null,"Flag value

is"+flag);

Page 18: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

form4.append(msg1);}

}

}

Page 19: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

PRACTICAL No. 4

Que: Write a program in J2ME to create a currency converter and also display the result.

Program:

import javax.microedition.midlet.*;import javax.microedition.lcdui.*;public class Currency extends MIDlet implements CommandListener{

Display disp;TextField tf1,tf2;Form form;Command US,UK,Japan,exit;public Currency(){

disp=Display.getDisplay(this);form=new Form("Conversion of Currency");tf1=new TextField("Indian Currency","0",30,TextField.ANY);tf2=new TextField("Foreign Currency","0",30,TextField.ANY);form.append(tf1);form.append(tf2);US=new Command("US",Command.SCREEN,1);UK=new Command("UK",Command.SCREEN,1);Japan=new Command("Japan",Command.SCREEN,1);exit=new Command("Exit",Command.EXIT,2);form.addCommand(US);form.addCommand(UK);form.addCommand(Japan);form.addCommand(exit);form.setCommandListener(this);

}public void startApp(){

disp.setCurrent(form);}public void pauseApp(){}public void destroyApp(boolean unconditional){}

public void commandAction(Command c,Displayable d){

if(c==US)

Page 20: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

{float a=Float.parseFloat(tf1.getString());float c1=a/48;tf2.setString(String.valueOf(c1)+"Dollars");

}if(c==UK){

float a=Float.parseFloat(tf1.getString());float c1=a/85;tf2.setString(String.valueOf(c1)+"Pounds");

}if(c==Japan){

int a=Integer.parseInt(tf1.getString());int c1=a*2;tf2.setString(String.valueOf(c1)+"Yen");

}if(c==exit){

destroyApp(false);notifyDestroyed();

}}

}

Page 21: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

OUTPUT

Page 22: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

PRACTICAL No. 5

Que: Write a program in J2ME to generate a calendar.

Program:

import javax.microedition.lcdui.*;import javax.microedition.midlet.MIDlet;import java.util.Date;

public class CalenderMIDlet extends MIDlet{

private Form form;private Display disp;private DateField cal;private static final int DATE=0;

public CalenderMIDlet(){

cal=new DateField("Date In",DateField.DATE);

}

public void startApp(){

disp=Display.getDisplay(this);form=new Form("Calender");form.append(cal);disp.setCurrent(form);

}

public void pauseApp(){

}

public void destroyApp(boolean unconditional){

}}

Page 23: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

OUTPUT

Page 24: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

PRACTICAL No. 6

Que: Write a program in J2ME to demonstrate simple animation through snake movement

import javax.microedition.midlet.*;import javax.microedition.lcdui.*;

public class MySnake extends MIDlet implements CommandListener{

DrawSnake ds;Display dis;

public MySnake(){

dis=Display.getDisplay(this);ds=new DrawSnake();

}

public void startApp(){

dis.setCurrent(ds);}

public void commandAction(Command c,Displayable d){}

public void pauseApp(){}

public void destroyApp(boolean unconditional){}

}

class DrawSnake extends Canvas implements Runnable, CommandListener{

int x,y,dir;Thread th;Command quit;

public DrawSnake(){x=0;y=0;dir=0;

Page 25: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

quit=new Command("QUIT",Command.SCREEN,1);addCommand(quit);setCommandListener(this);th=new Thread(this);th.start();}

public void commandAction(Command c,Displayable d){

if(c==quit){}//notifyDestroyed();

}

public void keyPressed(int cd){

switch(getGameAction(cd)){

case Canvas.UP:y-=5;dir=1;

break;case Canvas.DOWN: y+=5;dir=2; break;case Canvas.LEFT:x-=5;dir=3; break; case Canvas.RIGHT: x+=5;dir=4; break;}

}

public void run(){while(true){if(dir==1)y-=5;else if(dir==2)y+=5;

Page 26: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

else if(dir==3)x-=5;else if(dir==4)x+=5;

repaint();try{th.sleep(500);}catch (Exception ee){

}

}}

public void paint(Graphics g){

g.setColor(0x1F2F1F); g.fillRect(x, y, 10, 10);

g.drawString("RUPAK RAUSHAN",25,25, Graphics.TOP | Graphics.LEFT); }}

Page 27: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

PRACTICAL No. 7

Que: Write a program in J2ME to create a simple database application with an address book with the following operations:

a. Insert

Program:import java.io.*;import java.util.*;import javax.microedition.midlet.*;import javax.microedition.lcdui.*;import javax.microedition.io.*;

public class MySQLConn extends MIDlet implements CommandListener { private String username; private String url = "http://localhost:8086/servlets-examples/get"; private Display display; private Command exit = new Command("EXIT", Command.EXIT, 1);; private Command connect = new Command("Connect", Command.SCREEN, 1); private Form menu; private TextField tb1;

Page 28: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

private TextField tb2; DBConn db;

public MySQLConn() throws Exception { display = Display.getDisplay(this);

}

public void startApp() { displayMenu(); }

public void displayMenu() { menu = new Form("Connect"); tb1 = new TextField("Please input username: ","",30,TextField.ANY); tb2 = new TextField("Please input password: ","",30,TextField.PASSWORD); menu.append(tb1); menu.append(tb2); menu.addCommand(exit); menu.addCommand(connect); menu.setCommandListener(this); display.setCurrent(menu); }

public void pauseApp() {}

public void destroyApp(boolean unconditional) {}

public void commandAction(Command command, Displayable screen) { if (command == exit) { destroyApp(false); notifyDestroyed(); } else if (command == con) { db = new DBConn(this); db.start(); db.connectDb(tb1.getString(),tb2.getString()); } }

public class DBConn implements Runnable { MySQLConn midlet; private Display display; String db;

Page 29: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

String user; String pwd; public DBConn(MySQLConn midlet) { this.midlet = midlet; display = Display.getDisplay(midlet); }

public void start() { Thread t = new Thread(this); t.start(); }

public void run() { StringBuffer sb = new StringBuffer(); try { HttpConnection c = (HttpConnection) Connector.open(url); c.setRequestProperty("User-Agent","Profile/MIDP-1.0, Configuration/CLDC-1.0"); c.setRequestProperty("Content-Language","en-US"); c.setRequestMethod(HttpConnection.POST); DataOutputStream os = (DataOutputStream)c.openDataOutputStream();

//os.writeUTF(db.trim()); os.writeUTF(user.trim()); os.writeUTF(pwd.trim()); os.flush(); os.close();

// Get the response from the servlet page. DataInputStream is =(DataInputStream)c.openDataInputStream(); //is = c.openInputStream(); int ch; sb = new StringBuffer(); while ((ch = is.read()) != -1) { sb.append((char)ch); } showAlert(sb.toString()); is.close(); c.close(); } catch (Exception e) { showAlert(e.getMessage()); } }

Page 30: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

/* This method takes input from user like db,user and pwd and pass to servlet */ public void connectDb(String user,String pwd) { //this.db = db; this.user = user; this.pwd = pwd; }

/* Display Error On screen*/ private void showAlert(String err) { Alert a = new Alert(""); a.setString(err); a.setTimeout(Alert.FOREVER); display.setCurrent(a); } };}

Servlet Code import java.io.*;import javax.servlet.*;import javax.servlet.http.*;import java.sql.*;

public class GetConnection extends HttpServlet{ Connection conn;

public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html");

PrintWriter out = response.getWriter();DataInputStream in = new DataInputStream((InputStream)request.getInputStream());

String user = in.readUTF();String pwd = in.readUTF(); System.out.println("received data is==>"+user+pwd); try {

// connect(user.toLowerCase().trim(), pwd.toLowerCase().trim());

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

Page 31: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

conn = DriverManager.getConnection("jdbc:odbc:Harshad"); Statement stmt = conn.createStatement(); int i = stmt.executeUpdate("insert into Login values('"+user+"','"+pwd+"')"); if(i!=0){out.println("data has been inserted");}else{out.println("data is not inserted");} }catch(Exception e) { e.printStackTrace(); }

out.println("Data:"+user+pwd);in.close();

out.close();out.flush();

}public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doPost(request,response);

}

/* private void connect( String user,String pwd) throws Exception {

}*/}

Page 32: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

Page 33: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

Page 34: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

PRACTICAL No. 8

Que: Develop a simple website using XHTML

Program:<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.w3.org/MarkUp/SCHEMA/xhtml11.xsd"xml:lang="en" >

<head> <title>This is the document title</title> </head>

<body> <p>Moved to <a href="http://example.org/">example.org</a>.</p> </body>

</html>

Page 35: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

Page 36: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

PRACTICAL No. 9

Que: Develop a simple website using WML

Program:<?xml version="1.0"?><!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN""http://www.wapforum.org/DTD/wml_1.1.xml">

<wml>  <card title="Anchor Tag">    <p><anchor>Next page <go href="text.wml"/></anchor></p>  </card></wml> First page

Second Page

Page 37: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

Page 38: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

<?xml version="1.0"?><!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN""http://www.wapforum.org/DTD/wml_1.1.xml">

<wml><card title="Input">

<p>Name: <input name="Name" size="15"/><br/>Age: <input name="Age" size="15" format="*N"/><br/>Sex: <input name="Sex" size="15"/></p>

</card></wml>

Page 39: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

<?xml version="1.0"?><!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN""http://www.wapforum.org/DTD/wml_1.1.xml">

<wml>  <card>    <p>      <anchor>Go To Test<go href="text.wml"/></anchor>    </p>  </card></wml>

Page 40: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

<?xml version="1.0"?><!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN""http://www.wapforum.org/DTD/wml_1.1.xml">

<wml>  <card>    <p>      <anchor>Previous Page<go href="pre.wml"/></anchor>    </p>  </card></wml>

Page 41: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

<?xml version="1.0"?><!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN""http://www.wapforum.org/DTD/wml_1.1.xml">

<wml>  <card id="card1" title="Tutorial">    <do type="accept" label="Answer">      <go href="#card2"/>    </do>    <p><select name="name">      <option value="HTML">HTML Tutorial</option>      <option value="XML">XML Tutorial</option>      <option value="WAP">WAP Tutorial</option>    </select></p>  </card>  <card id="card2" title="Answer">    <p>You selected: $(name)</p>  </card></wml>

Page 42: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

After Selecting option XML and Clicking Ok

Page 43: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

Page 44: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

PRACTICAL No. 10

Que: File transfer between Laptop & Mobile phone using Bluetooth

Instructions:

Things will Need: Bluetooth enabled PC Bluetooth enabled cell phone

Step 1

Enable Bluetooth on the PC. To enable Bluetooth on the PC visit your control panel. We should see an option for Bluetooth devices. Select this option and make sure the technology is enabled. If you are installing a USB module, we should be able to plug it in and use it right away. If not, it should come with drivers to install (insert the disc, and install the software).

Step 2

Enable bluetooth on the cell phone. Each phone is different, but you should be able to go to a settings menu, and select bluetooth. There should be an option to enable bluetooth on the phone. Enable it, and make sure the phone is visible.

Step 3

Allow the PC to search for devices. It should find the cell phone. If not, we can try searching for the computer with the cell phone. Many times, with the USB modules, they have trouble finding the cell, but the cell can find the computer. The important part is that the devices connect, regardless of which device finds which.

Step 4

Approve the devices to connect. Sometimes, the devices will automatically connect, and we will be ready to go. However, if this is not the case, refer to step 5.

Step 5

Enter any necessary security codes. If you do not know these codes, try the defaults, (1234, last 4 digits of your phone number, etc.).

Step 6

Page 45: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

Select the files on the computer that we want, and we should be able to right click and select "send via bluetooth". Click this option, and let the files send.

OR

Another way is with windows XP and blutooth enabled mobile

a) Setup on the Device

Step 1: On the device, press Menu.

Step 2: Scroll to Connect. and press the scroll key.

Step 3: Scroll to Bluetooth and press the scroll key.

Step 4: Scroll to Bluetooth and press the scroll key till On is displayed.

Step 5: Scroll to My phone’s visibility and press the scroll key till Shown to all

is displayed.

Step 6: Scroll to My phone’s name and press the scroll key..

Step 7: Enter Nokia in the field provided and press Ok.

Step 8: Press Exit and End key to go back to main screen.

b) Setup on the Laptop

Step 1: On the laptop, click on Start.

Step 2: Select Control Panel.

Step 3: Select and click on Bluetooth Devices.

Step 4: Click on Add.. and a pop-up “Add Bluetooth Device Wizard” would displayed.

Step 5: Checked on “My device is set up and ready to be found” and press Next.

Step 6: Select on Nokia New device and press Next.

Page 46: Wireless Tech Pract Journal(1)

Wireless Technology & Mobile Communication Practical Journal

Step 7: Checked “Let me choose my own passkey” and enter an 8 to 16 digit passkey.

Step 8: Press Next..

Step 9: On your device, “Add to My Devices?” is displayed, press Yes.

Step 10: Enter the same 8 to 16 digit passkey that you have entered previously and Press Ok.

Step 11: Please wait while your laptop is installing the Bluetooth.

Step 12: Press Finish when the Completing the “Add Bluetooth Device Wizard” is displayed.