Introduction




Name of Experiment: To Print Variable Demo With Minimum And Maximum Range of NOKIA ASHA 501

Exp No: 5

Background: Student should have a basic knowledge of Java Programming.

Summary: After going through this experiment, student should be able to print variable demo with minimum and maximum range on Nokia Asha 501 device.

Learning Objective: Here, Student should learn the procedure to able to print variable demo with minimum and maximum range on nokia Asha Device . After, doing this experiment user himself will be able to make an app to able to print variable demo with minimum and maximum range on nokia Asha Device.

Target

Target Platform:This experiment is tested on Nokia Asha Device 501.

Procedure

SourceCode

Source Code:

package variable;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Form;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
public class Variable extends MIDlet {
Form vardemo;
byte by;
int in; short sh; double db;
long lg; boolean bo; float fl;
public Variable() {
// TODO Auto-generated constructor stub
vardemo=new Form("VARIABLE DEMO");
by=56;
in=96;sh=76;lg=15699;
fl=(float) 3.874; db=4577; bo=true;
vardemo.append("Byte:"+by);
vardemo.append("Maximum Byte Size:"+Byte.MAX_VALUE+"\n Minimum Byte Size:"+
Byte.MIN_VALUE);
vardemo.append("Short:"+sh);
vardemo.append("Maximum Short Size:"+Short.MAX_VALUE+"\n Minimum Short Size:"+
Short.MIN_VALUE);
vardemo.append("Integer:"+in);
vardemo.append("Maximum Integer Size:"+Integer.MAX_VALUE+"\n Minimum Integer Size:"+
Integer.MIN_VALUE);
vardemo.append("Long:"+lg);
vardemo.append("Maximum Long Size:"+Long.MAX_VALUE+"\n Minimum Long Size:"+
Long.MIN_VALUE);
vardemo.append("Float:"+fl);
vardemo.append("Maximum Float Size:"+Float.MAX_VALUE+"\n Minimum Float Size:"+
Float.MIN_VALUE);
vardemo.append("Double:"+db);
vardemo.append("Maximum Double Size:"+Double.MAX_VALUE+"\n Minimum Double Size:"+
Double.MIN_VALUE);
vardemo.append("Boolean:"+bo);
vardemo.append("Maximum Boolean Value:"+Boolean.FALSE+"\n Minimum Boolean Value:"+
Boolean.TRUE);
vardemo.append("By: Nicy Kaur Taneja \n Vandana Kumari");
}
protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
// TODO Auto-generated method stub
}
protected void pauseApp() {
// TODO Auto-generated method stub
}
protected void startApp() throws MIDletStateChangeException {
Display.getDisplay(this).setCurrent(vardemo);
// TODO Auto-generated method stub
}
}

Snapshots



This is how the output appears on the emulator of NOKIA Asha SDK 1.0 on successful compilation of source code.

Observation

Observation: A program of variable demo is operated in which variables of different datatypes are displayed along with its minimum and maximum values.

Video Link

Download