Introduction




Name of Experiment: Display Current Date and Time of NOKIA ASHA 501

Exp No: 9

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

Summary: After going through this experiment, student should be able to display current date and time of NOKIA Asha 501 device.

Learning Objective: Here, Student should learn the procedure to display current date and time of NOKIA Asha 501 device.. After, doing this experiment user himself will be able to display current date and time of NOKIA Asha 501 device.

Target

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

Procedure

SourceCode

Source Code:

package date;
import javax.microedition.lcdui.DateField;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Form;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
public class Date extends MIDlet {
Form current;
DateField currentdate;
public Date() {
current=new Form("Current Date & Time");
currentdate=new DateField("OK",DateField.DATE_TIME);
current.append(currentdate);
current.append("\n"+"By:Nicy Kaur Taneja");
current.append("Vandana Kumari");
}
protected void destroyApp(boolean unconditional)
throws MIDletStateChangeException {}
protected void pauseApp() {
// TODO Auto-generated method stub
}
protected void startApp()throws MIDletStateChangeException {
Display.getDisplay(this).setCurrent(current);

Snapshots



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

Observation

Observation: Students have successfully displayed the date and time of NOKIA Asha 501.

Video Link

Download