CHADALAWADA RAMANAMMA ENGINEERING COLLEGE
|
|
- Sheena Shields
- 5 years ago
- Views:
Transcription
1 1 MOBILE APPLICATION DEVELOPMENT LABORATORY MANUAL Subject Code : 9F00506 Regulations : JNTUA R09 Class : V Semester (MCA) CHADALAWADA RAMANAMMA ENGINEERING COLLEGE (AUTONOMOUS) Chadalawada Nagar, Renigunta Road, Tirupati Department of Master of computer Applications 1
2 CHADALAWADA RAMANAMMA ENGINEERING COLLEGE (AUTONOMOUS) Chadalawada Nagar, Renigunta Road, Tirupati Department of Master of computer Applications 2 INDEX S. No Name of the Experiment Page No 1 Installation of J2ME Hello World Display Class Command Class Radio Buttons Alert Class Date and Time Text Field Round Rectangle Filled Arc Record Enumeration Sorting RMS Searching RMS Bar Graph & Pie Chart Working on Drawing and images Client Server
3 3 AIM: Installation of J2ME Wireless Toolkit PROCEDURE: Download the J2ME Wireless Toolkit from the Sun web site. The Toolkit file is a self-extracting executable file. Run this executable after downloading the file, and the installation program creates all the directories required to run the Toolkit. 3
4 4 The installed J2MEWirelessToolkit is placed in thewtk104 directory, although the directory might have a variation of this name depending on the version of the Toolkit that you download. press Next Next Install 4
5 5 Now installing the Wireless Toolkit After Complete the Installation press Finish 5
6 6 Then go to start menu->select Sun Java Wireless Toolkit 2.5.2_01 Select Wireless Toolkit under Sun Java Wireless Toolkit 2.5.2_01 6
7 7 We can Create a new project select New Project Option Then select the project from the list Project loads here 7
8 8 Then click on build to compile the project Click Run to see the output in mobile emulator It will display mobile emulator. 8
9 9 HELLO WORLD AIM: To write and implement the J2ME program to Display a Hello world program. 9
10 10 CREATING AN INSTANCE OF THE HELLO WORLD: 1. Declare reference. 2. Obtain a reference to the instance of the Display class. 3. Create an instance of the command class. 4. Create an instance of the command class to exit the MIDlet. 5. Create an instance of the form class. 6. Create an instance of the textbox class that contains the hello world. 7. Associate the instance of the back-command class with the instance of the textbox class. JAR FILE: MIDlet-1 : Hello World, greeting Hello World MIDlet-Name : Hello World MIDlet-Version : 1.0 MIDlet-Vendor : Jim MIDlet-1 : HelloWorld, /greeting/ mylogo.png Micro Edition-Configuration : CLDC-1.0 Micro Edition-Profile : MIDP-1.0 SOURCE CODE: import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class HelloWorld extends MIDlet implements CommandListener private Display display ; private TextBoxtextBox ; private Command quitcommand; public void startapp() display = Display.getDisplay(this); quitcommand = new Command("Quit", Command.SCREEN, 1); textbox = new TextBox("Hello World", "My first MIDlet", 40, 0); textbox.addcommand(quitcommand); textbox.setcommandlistener(this); display.setcurrent(textbox ); public void pauseapp() public void destroyapp(boolean unconditional) public void commandaction(command choice, Displayable displayable) if (choice == quitcommand) destroyapp(false); notifydestroyed(); 10
11 11 OUTPUT: DISPLAY CLASS AIM: To write and implement the J2ME program to display check color on screen by using 11
12 12 display class. CREATING AN INSTANCE OF THE COLOR ATTRIBUTE OF A DEVICE: 1. Create references. 2. Create a Display object. 3. Create an instance of the Command class to exit the MIDlet. 4. Call iscolor() method. 5. Evaluate the return value of iscolor() method. 6. Create an instance of the TextBox class that describes results of iscolor() method. 7. Associate the instances of the Command class with the instances of the TextBox class. 8. Associate a Command Listener with the instance of the TextBox class. 9. Display the instance of the TextBox class on the screen. 10. Terminate the MIDlet when the Exit command is entered. JAD FILE: MIDlet-Name : Check Color MIDlet-Version : 1.0 MIDlet-Vendor : My Company MIDlet-Jar-URL : CheckColor.jar MIDlet-1 : Check Color, CheckColor.png, Check Color Micro Edition-Configuration : CLDC-1.0 Micro Edition-Profile : MIDP-1.0 MIDlet-JAR-SIZE : 100 SOURCE CODE: import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class CheckColor extends MIDlet implements CommandListener private Display display; private Form form; private TextBox textbox; private Command exit; public CheckColor() display = Display.getDisplay(this); exit = new Command("Exit", Command.SCREEN, 1); String message=null; if (display.iscolor()) message="color display."; else message="no color display"; textbox = new TextBox("Check Colors", message, 17, 0); 12
13 13 textbox.addcommand(exit); textbox.setcommandlistener(this); public void startapp() display.setcurrent(textbox); public void pauseapp() public void destroyapp(boolean unconditional) public void commandaction(command command, Displayable displayable) if (command == exit) destroyapp(true); notifydestroyed(); OUTPUT: 13
14 14 ONLINE HELP AIM: To write and implement J2ME program in Creating Online Help. 14
15 15 CREATING AN INSTANCE OF THE ONLINE CLASS: 1. Declare references 2. Obtain a reference to the instance of the Display class 3. Create an instance of the command class to return from the help page 4. Create an instance of the command class to exit the MIDlet 5. Create an instance of the form class 6. Create an instance of the textbox class that contains the help text 7. Associate the instance of the back-command class with the instance of the textbox class 8. If the command is the back command, display the form 9. If the command is the exit command, terminate the MIDlet 10. If the command is the help command, display the textbox JADFILE: MIDlet-Name : online MIDlet version : 1.0 MID-vendor : My computer MID-jar-URL : online. Java MIDlet-1 : Display Alert, Display Alert Micro edition configuration: CLDC 1.0 Micro edition profile : MIDP 1.0 MIDlet JAR Size : 100 SOURCE CODE: import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class onlinehelp extends MIDlet implements CommandListener private Display display; private Command back; private Command exit; private Command help; private Form form; private TextBox msg; public onlinehelp() display=display.getdisplay(this); back=new Command("back",Command.BACK,2); exit=new Command("exit",Command.EXIT,1); help=new Command("help",Command.HELP,3); form=new Form("online help message"); msg=new TextBox("onlinehelp","press back to view the previous screen or press exit to view the first screen",81,0); msg.addcommand(back); form.addcommand(exit); form.addcommand(help); form.setcommandlistener(this); 15
16 16 msg.setcommandlistener(this); public void startapp() display.setcurrent(form); public void pauseapp() public void destroyapp(boolean unconditional) public void commandaction(command command,displayable displayable) if(command==back) display.setcurrent(form); else if(command==exit) destroyapp(false); notifydestroyed(); else if(command==help) display.setcurrent(msg); 16
17 17 OUTPUT: RADIOBUTTONS 17
18 18 AIM: To write and implement the J2ME program to Display a Radio Buttons. CREATING AN INSTANCE OF THE RADIOBUTTONS 1. Declare reference to classes. 2. Declare an instance of the display class. 3. Create an instance of the choice group class. 4. Associate option with the instance of the choice group class. 5. Set the default class. 6. Create an exit command. 7. Create an instance of the form class. 8. Associate the instance of choice group class to the instance of the form class. 9. Associate the exit command with the form. 10. Associate the command listener with form. 11. Associate an item state listener with the form. 12. Display the form. 13. Evaluate the command entered by the user. 14. If the command is the exit command, terminate the Midlet. 15. If an instance of the item class change state, read the selection form the instance of the choice group class. 16. Display the selection on the screen. JAD FILE: MIDlet-Name : Display Alert MIDlet version : 1.0 MID-vendor : My computer MID-jar-URL : displayalert.java MIDlet-1 : Display Alert, Display Alert Micro edition configuration: CLDC 1.0 Micro edition profile : MIDP 1.0 MIDlet JAR Size : 100 SOURCE CODE: import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class RadioButton extends MIDlet implements ItemStateListener,CommandListener private Display display; private Form form; private Command exit; private Item selection; private ChoiceGroupradioButtons; private int defaultindex; private int radiobuttonsindex; public RadioButton() 18
19 19 display=display.getdisplay(this); radiobuttons=new ChoiceGroup("select your color",choice.exclusive); radiobuttons.append("red",null); radiobuttons.append("green",null); radiobuttons.append("blue",null); radiobuttons.append("yellow",null); defaultindex=radiobuttons.append("all",null); radiobuttons.setselectedindex(defaultindex,true); exit=new Command("Exit",Command.EXIT,1); form=new Form(" "); radiobuttonsindex=form.append(radiobuttons); form.addcommand(exit); form.setcommandlistener(this); form.setitemstatelistener(this); public void startapp() display.setcurrent(form); public void pauseapp() public void destroyapp(boolean unconditional) public void commandaction(command command,displayable displayable) if(command==exit) destroyapp(true); notifydestroyed(); public void itemstatechanged(item item) if(item==radiobuttons) StringItemmsg=newStringItem("yourcoloris",radioButtons.getString (radiobuttons.getselectedindex())); form.append(msg); OUTPUT: 19
20 20 20
21 21 21
22 22 Threads & High-Level UI 22
23 23 ALERT CLASS AIM: To Write and implement a J2ME program to perform a alert class CREATING AN INSTANCE FOR ALERT CLASS: 1. Declare references 2. Set default values for exit flag of false 3. Create an instance of command class and exit the midlet 4. Create an instance of form class 5. Associate the command listener and form class 6. To display the instance of form class in screen 7. To display the instance of form class in screen 8. Exit command for terminate the middle 9. Display the instance of alert class as screen 10. Call the destroy App() 11. Trap exception throe within the command Action() 12. The midlet state change exception is thrown indicate the conditions are now safe to terminate the midlet by assigning a true value to the exit flag variables 13.Terminate the midlet when the exit command is entered the second time. JAD FILE: MIDlet-name : alert MIDlet-version :1.0 MIDlet-vendor : my first MIDlet-1 : alert, alert MIDlet-jar-URL : alert.jar/alert Midlet-jar-size : 100 Microedition-configuration : CLDC1.0 Microedition profile : MIDP-1.0 SOURCE CODE: import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class displayalert extends MIDlet implements CommandListener private Display display; private Form form; private Alert alert; private Command exit; private booleanee; public displayalert() ee=false; display=display.getdisplay(this); exit=new Command("exit",Command.SCREEN,1); form=new Form("Throw exception"); 23
24 24 form.addcommand(exit); form.setcommandlistener(this); public void startapp() display.setcurrent(form); public void pauseapp() public void destroyapp(boolean unconditional)throws MIDletStateChangeException if(unconditional==false) throw new MIDletStateChangeException(); public void commandaction(command command,displayable displayable) if(command==exit) try if(ee==false) alert=new Alert("Busy","please try again",null,alerttype.warning); alert.settimeout(alert.forever); display.setcurrent(alert,form); destroyapp(false); else destroyapp(true); notifydestroyed(); catch(midletstatechangeexception exception) ee=true; 24
25 25 OUTPUT: 25
26 26 DATE AND TIME AIM:To write and implement a J2ME program for display date and time in emulator. CREATING AN INSTANCE FOR DATE AND TIME 1. Create an instance of command class and exit midlet 2. Create a instance of frame class 3. Associate the instance of command class and form class 4. To associate the command listener and frame class 5. To display instance of frame class in display screen 6. Evaluate command selected by user 7. Exit command for terminate the midlet 8. Date field was taken as today 9. Display the today date and time 10.To start App() 11. Call the display screen 12. Pause the App() 13. Destroy the App() 14. To perform the commandaction display the screen 15. Exit from the MIDP JADFILE: MIDlet-NAME : TodatDate MIDlet-Vendor : My second MIDlet-Version : 1,2 MIDlet-1 : todaydate.data MIDlet-jar-url : todaydate.jar MIDlet-jar-size : 100 Microedition configuration : CLDC-1.0 Microedition Profile : MIDP-2.0 SOURCE CODE: import java.util.*; import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class DateToday extends MIDlet implements CommandListener private Display display; private Form form; private Date today; private Command exit; private DateFielddatefield; public DateToday() display=display.getdisplay(this); form=new Form("Today's Date"); today=new Date(System.currentTimeMillis()); 26
27 27 datefield=new DateField("",DateField.DATE_TIME); datefield.setdate(today); exit=new Command("exit",Command.EXIT,1); form.append(datefield); form.addcommand(exit); 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(command==exit) destroyapp(false); notifydestroyed(); 27
28 28 OUTPUT: 28
29 29 Text Field Class AIM: To Write and implement a J2ME program to perform a TextField. CREATING AN INSTANCE FOR DATE AND TIME 1. Declare references. 2. Obtain a reference to the instance of the Display class. 3. Create an instance of a Command class for the Submit class. 4. Create an instance of a Command class to exit the MIDlet. 5. Create an instance of the TextField class. 6. Create an instance of the Form class. 7. Associate the instance of the TextField class to the instance of the Form class. 8. Associate instances of the Command class to the instance of the Form class. 9. Associate a CommandListener with the instance of the Form class. 10. Display the instance of the Form class on the screen. 11. Evaluate the command selected by the user. 12. If the Exit command is selected, terminate the MIDlet. 13. If the Submit command is selected, process the instance of the TextField class. 14. Retrieve the text of the instance. 15. Concatenate the text to the Hello, greeting. 16. Replace the text in the instance. 17. Remove the Submit command. JADFILE: MIDlet-NAME :TextFieldCapture MIDlet-Vendor : My second MIDlet-Version : 1.0 MIDlet-1 :TextFieldCapture,, TextFieldCapture MIDlet-jar-url : textfield.jar MIDlet-jar-size : 100 Microedition configuration : CLDC-1.0 Microedition Profile : MIDP-2.0 SOURCE CODE: import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class TextFieldCapture extends MIDlet implements CommandListener private Display display; private Form form; private Command submit; private Command exit; 29
30 30 private TextFieldtextfield; public TextFieldCapture() display = Display.getDisplay(this); submit = new Command("Submit", Command.SCREEN, 1); exit = new Command("Exit", Command.EXIT, 1); textfield = new TextField("First Name:", "", 30, TextField.ANY); form = new Form("Sign In Please"); form.addcommand(exit); form.addcommand(submit); form.append(textfield); 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 (command == submit) textfield.setstring("hello, " + textfield.getstring()); form.removecommand(submit); else if (command == exit) destroyapp(false); notifydestroyed(); 30
31 31 OUTPUT: 31
32 32 Threads & Low-Level UI 32
33 33 FILLED RECTANGLE AIM:To write and implement a J2ME program for draw a rectangle. CREATING AN INSTANCE FOR FILLED RECTANGLE: 1. Declare references to classes. 2. Create instances of classes and assign those instances to references. 3. Display the instance of the Canvas class whenever the MIDlet is started. 4. Terminate the MIDlet when the Exit command is selected. 5. Define a class derived from the Canvas class that implementsa Command Listener. 6. Within the derived class, declare references. 7. Within the derived class, create an instance of the Command class. 8. Within the derived class, associate the instance of the Command classwith the canvas. 9. Within the derived class, associate the CommandListener with the canvas. 10. Within the derived class, define a paint() method to define the rectangulararea of the canvas where the rectangle is to be drawn. Specify the horizontaland vertical diameters of the arc if rounded corners are used in the rectangle.specify the color to be used to drawand fill the rectangle unless the defaultcolor is being used. 11. Within the derived class, define a commandaction() method to process the Exit command. JAD FILE: MIDlet-Name : RectangleExample MIDlet-Version : 1.0 MIDlet-Vendor : MyCompany MIDlet-Jar-URL : RectangleExample.jar MIDlet-1 : RectangleExample,,RectangleExample MicroEdition-Configuration : CLDC-1.0 MicroEdition-Profile : MIDP-1.0 MIDlet-JAR-SIZE : 100 SOURCE CODE: import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class RectangleExample extends MIDlet private Display display; private MyCanvas canvas; public RectangleExample () display = Display.getDisplay(this); canvas = new MyCanvas (this); protected void startapp() display.setcurrent( canvas ); 33
34 34 protected void pauseapp() protected void destroyapp( boolean unconditional ) public void exitmidlet() destroyapp(true); notifydestroyed(); class MyCanvas extends Canvas implements CommandListener private Command exit; private RectangleExamplerectangleExample; public MyCanvas (RectangleExamplerectangleExample) this.rectangleexample = rectangleexample; exit = new Command("Exit", Command.EXIT, 1); addcommand(exit); setcommandlistener(this); protected void paint(graphics graphics) graphics.setcolor(255,255,255); graphics.fillrect(0, 0, getwidth(), getheight()); graphics.setcolor(255,0,0); graphics.drawrect(2, 2, 20, 20); graphics.drawroundrect(20, 20, 60, 60, 15, 45); public void commandaction(command command, Displayable displayable) if (command == exit) rectangleexample.exitmidlet(); 34
35 35 OUTPUT: 35
36 36 FILLED ARC AIM: To write and implement a j2me program for filled Arc. CREATING AN INSTANCE FOR FILLED ARC: 1. Declare reference to classes 2. Create instance of classes and assign those instance to reference 3. Display the instance of the classes whenever the midlet is started 4. Terminate the midlet when the exit command is selected 5. Define a class derived from the canvas class that implements command listener 6. within the derived class, declare references 7. within the derived class associate the instance of command class 8. within the derived class create an instance of command class 9. within the derived class declare paint() method 10. within the derived class define a command Action() method to press the exit command 11. to terminate the midlet JAD FILE: MIDlet-Name :ArcExample MIDlet-Version : 1.0 MIDlet-Vendor : Ramesh MIDlet-Jar-URL : ArcExample.jar MIDlet-1 :ArcExample,, ArcExample MicroEdition-Configuration : CLDC-1.0 MicroEdition-Profile : MIDP-1.0 MIDlet-JAR-SIZE : 100 SOURCE CODE: import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class myfill extends MIDlet private Display d; private Mycanvas c; public myfill() d=display.getdisplay(this); c=new Mycanvas(); public void startapp() d.setcurrent(c); protected void pauseapp() 36
37 37 protected void destroyapp(boolean unconditional) public void exitmidlet() destroyapp(true); notifydestroyed(); class Mycanvas extends Canvas implements CommandListener private Command exit; private myfillcr; public void Mycanvas(myfillcr) this.cr=cr; exit=new Command("exit",Command.EXIT,1); addcommand(exit); setcommandlistener(this); public void paint(graphics g) g.setcolor(255,255,255); g.fillrect(0,0,getwidth(),getheight()); g.setcolor(255,0,0); g.fillarc(0,0,getwidth(),getheight(),180,180); public void commandaction(command cc,displayable dd) if(cc==exit); cr.exitmidlet(); 37
38 38 OUTPUT: 38
39 39 RECORD MANAGEMENT SYSTEM 39
40 40 Record Enumeration AIM: To write and implement the J2ME program to Display a Radio Buttons. CREATING AN INSTANCE OF THE RADIOBUTTONS 1. Declare references to classes. 2. Create instances of classes and assign those instances to references. 3. Open a record store and create a new record store if the record store doesn t exist. 4. Display any errors that occur when opening/creating a record store. 5. Create data in the appropriate data type. 6. Convert data to a byte array. 7. Write the record to the record store. 8. Display any errors that might occur while writing to the record store. 9. Create a RecordEnumeration. 10. Loop through the RecordEnumeration, copying each record to a variable. 11. Display the data in a dialog box. 12. Display any errors that occur when reading records from the RecordEnumeration. 13. Close and remove the RecordEnumeration and the record store. JAD FILE: MIDlet-Name : RecordEnumerationExample MIDLET version : 1.0 MID-vendor : My computer MID-jar-URL : RecordEnumerationExample.jar MIDlet-1 : RecordEnumerationExample,,RecordEnumerationExample Micro edition configuration: CLDC 1.0 Micro edition profile : MIDP 1.0 MIDlet JAR Size : 100 SOURCE CODE: import javax.microedition.rms.*; import javax.microedition.midlet.*; import javax.microedition.lcdui.*; import java.io.*; public class RecordEnumerationExample extends MIDlet implements CommandListener private Display display; private Alert alert; private Form form; private Command exit; private Command start; 40
41 41 private RecordStorerecordstore = null; private RecordEnumerationrecordEnumeration = null; public RecordEnumerationExample () display = Display.getDisplay(this); exit = new Command("Exit", Command.SCREEN, 1); start = new Command("Start", Command.SCREEN, 1); form = new Form("RecordEnumeration"); form.addcommand(exit); form.addcommand(start); 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 (command == exit) destroyapp(true); notifydestroyed(); else if (command == start) try recordstore = RecordStore.openRecordStore("myRecordStore", true ); catch (Exception error) alert = new Alert("Error Creating",error.toString(), null, AlertType.WARNING); alert.settimeout(alert.forever); display.setcurrent(alert); 41
42 42 try String outputdata[] = "First Record","Second Record", "Third Record"; for (int x = 0; x < 3; x++) byte[] byteoutputdata = outputdata[x].getbytes(); recordstore.addrecord(byteoutputdata,0, byteoutputdata.length); catch ( Exception error) alert = new Alert("Error Writing", error.tostring(), null, AlertType.WARNING); alert.settimeout(alert.forever); display.setcurrent(alert); try StringBuffer buffer = new StringBuffer(); recordenumeration = recordstore.enumeraterecords(null, null, false); while (recordenumeration.hasnextelement()) buffer.append(new String(recordEnumeration.nextRecord())); buffer.append("\n"); alert = new Alert("Reading", buffer.tostring(), null, AlertType.WARNING); alert.settimeout(alert.forever); display.setcurrent(alert); catch (Exception error) alert = new Alert("Error Reading",error.toString(), null, AlertType.WARNING); alert.settimeout(alert.forever); display.setcurrent(alert); try recordstore.closerecordstore(); 42
43 43 catch (Exception error) alert = new Alert("Error Closing",error.toString(), null, AlertType.WARNING); alert.settimeout(alert.forever); display.setcurrent(alert); if (RecordStore.listRecordStores()!= null) try RecordStore.deleteRecordStore("myRecordStore"); recordenumeration.destroy(); catch (Exception error) alert = new Alert("Error Removing", error.tostring(), null, AlertType.WARNING); alert.settimeout(alert.forever); display.setcurrent(alert); OUTPUT: 43
44 44 44
45 45 SORTING AIM:To write a j2me program for the sorting records from the file display on the Midlet. CREATING AN INSTANCE FOR SORTING: 1. Declare references for the classes 2. Create instance as classes and assign those the instances to references 3. Open a record store and create new record store with the record store does t exist 4. Display any errors that occurred in opening /creating a record store 5. Create a data in appropriate data type 6. Convert data to byte array 7. Write the record to the record store 8. Display any errors that might occurred while writing to the record store 9. Create a comparator class with a method that compares two records 10. Create an instances of comparator class and use the instance then creating record enumeration 11. Loop through the record enumeration 12. Display the data in dialog box 13. Display any errors that occurred reading records 14. Close the record enumeration JAD FILE: MIDlet-name : mysort MIDlet-version : 1.0 MIDlet-vendor : myname MIdlet-1 : mysort,,mysort MIDlet-JAR-URL : mysort.jar MIDlet-JAR-SIZE : 100 Microedition-profile : MIDP-1.0 Microedition-configuration : CLDC-1.0 SOURCE CODE: import javax.microedition.midlet.*; import javax.microedition.lcdui.*; import javax.microedition.rms.*; import java.io.*; public class mysort extends MIDlet implements CommandListener private Display d; private Alert a; private Form f; private Command exit; 45
46 46 private Command start; private RecordStorers=null; private RecordEnumeration rm=null; private Comparator cs; public mysort() d=display.getdisplay(this); exit=new Command("exit",Command.EXIT,1); start=new Command("start",Command.START,1); f=new Form("my records"); f.addcommand(exit); f.addcommand(start); f.setcommandlistener(this); public void startapp() d.setcurrent(f); public void pauseapp() public void destroyapp(boolean unconditional) public void commandaction(command cc,displayable dd) if(cc==exit) destroyapp(true); notifydestroyed(); else if(cc==start) try rs=recordstore.openrecordstore("my records",true); catch(exception error) a=new Alert("error creating",error.tostring(),null,alerttype.warning); a.settimeout(alert.forever); d.setcurrent(a); try String opd[]="hari","vamsi","anusha"; for(int x=0;x<=3;x++) 46
47 47 byte[] bod=opd[x].getbytes(); rs.addrecord(bod,0,bod.lenght); catch(exception error) a=new Alert("open a record",error.tostring(),null,alerttype.warning); a.settimeout(alert.forever); d.setcurrent(a); try StringBuffer s=new StringBuffer(); Comparator cs=new Comparator(); rm=rs.enumeraterecords(null,cs,null); while(rm.hasnextrecord()) s.append(new String(rm.NextRecord())); s.append("\n"); a=new Alert("error creating",s.tostring(),null,alerttype.warning); a.settimeout(alert.forever); d.setcurrent(a); catch(exception error) a=new Alert("reading",error.toString(),null,AlertType.WARNING); a.settimeout(alert.forever); d.setcurrent(a); try rs.closerecordstore(); catch(exception error) a=new Alert("error closing",error.tostring(),null,alerttype.warning); a.settimeout(alert.forever); d.setcurrent(a); if(recordstore.listrecordstores()!=null) try RecordStore.deleteRecordStore("my record deetes"); rm.destroy(); 47
48 48 catch(exception error) a=new Alert("error closed",error.tostring(),null,alerttype.warning); a.settimeout(alert.forever); d.setcurrent(a); class Comparator implements RecordComparator public int Compare(byte[] record1,byte[] record2); String s1=new String(record1); String s2=new String(record2); int c=s1.compareto(s1); if(c==0) return RecordComparator.EQUIVALENT; else if(c<0) return RecordComparator.PRECEDES; else return RecordComparator.FOLLOWS; 48
49 49 OUTPUT: 49
50 50 SEARCHING AIM:To write a j2me program for the searching records and then display on the midlet. CREATING AN INSTANCE FOR SEARCHING: 1. Declare references for the classes 2. Create instance as classes and assign those the instances to references 3. Open a record store and create new record store with the record store does t exist 4. Display any errors that occurred in opening /creating a record store 5. Create a data in appropriate data type 6. Convert data to byte array output stream 7. Create a data output stream using the byte array output stream 8. Write the record to the record store 9. Display any errors that might occurred while writing to the record store 10. Create a buffer as byte sufficient to hold a record 11. Create a byte array input stream and data input stream 12. Display any errors that occurred then reading records from the record store 13. Close and remove enumeration and record store JAD FILE: MIDlet-name : mysearch MIDlet-version : 1.0 MIDlet-vendor : myname MIdlet-1 : mysearch,,mysearch MIDlet-JAR-URL : mysort.jar MIDlet-JAR-SIZE : 100 Microedition-profile : MIDP-1.0 Microedition-configuration : CLDC-1.0 SOURCE CODE: import javax.microedition.midlet.*; import javax.microedition.lcdui.*; import javax.microedition.rms.*; import java.io.*; public class mysearch extends MIDlet implements CommandListener private Display d; private Alert a; private Form f; private Command exit; private Command start; private RecordStorers=null; private RecordEnumeration rm=null; 50
51 51 private Comparator cs; public mysort() d=display.getdisplay(this); exit=new Command("exit",Command.EXIT,1); start=new Command("start",Command.START,1); f=new Form("my records"); f.addcommand(exit); f.addcommand(start); f.setcommandlistener(this); public void startapp() d.setcurrent(f); public void pauseapp() public void destroyapp(boolean unconditional) public void commandaction(command cc,displayable dd) if(cc==exit) destroyapp(true); notifydestroyed(); else if(cc==start) try rs=recordstore.openrecordstore("my records",true); catch(exception error) a=new Alert("error creating",error.tostring(),null,alerttype.warning); a.settimeout(alert.forever); d.setcurrent(a); try String opd[]="hari","vamsi","anusha"; for(int x=0;x<=3;x++) byte[] bod=opd[x].getbytes(); rs.addrecord(bod,0,bod.lenght); 51
52 52 catch(exception error) a=new Alert("open a record",error.tostring(),null,alerttype.warning); a.settimeout(alert.forever); d.setcurrent(a); try StringBuffer s=new StringBuffer(); Comparator cs=new Comparator(); rm=rs.enumeraterecords(null,cs,null); while(rm.hasnextrecord()) s.append(new String(rm.NextRecord())); s.append("\n"); a=new Alert("error creating",s.tostring(),null,alerttype.warning); a.settimeout(alert.forever); d.setcurrent(a); catch(exception error) a=new Alert("reading",error.toString(),null,AlertType.WARNING); a.settimeout(alert.forever); d.setcurrent(a); try rs.closerecordstore(); catch(exception error) a=new Alert("error closing",error.tostring(),null,alerttype.warning); a.settimeout(alert.forever); d.setcurrent(a); if(recordstore.listrecordstores()!=null) try RecordStore.deleteRecordStore("my record deetes"); rm.destroy(); catch(exception error) a=new Alert("error closed",error.tostring(),null,alerttype.warning); 52
53 53 a.settimeout(alert.forever); d.setcurrent(a); class Comparator implements RecordComparator public int Compare(byte[] record1,byte[] record2); String s1=new String(record1); String s2=new String(record2); int c=s1.compareto(s1); if(c==0) return RecordComparator.EQUIVALENT; else if(c<0) return RecordComparator.PRECEDES; else return RecordComparator.FOLLOWS; 53
54 54 OUTPUT: 54
55 55 BARGRAPH AIM: To write and implement j2me program for displaying bar graph in our MIDP. CREATING AN INSTANCE FOR BARGRAPH: 1. Declare references for the classes 2. Create instance as classes and assign those the instances to references 3. Declaring the canvas class and implements the canvas 4. Open a record store and create new record store with the record store does t exist 5. Display any errors that occurred in opening /creating a record store 6. Create a data in appropriate data type 7. Convert data to byte array output stream 8. Create a data output stream using the byte array output stream 9. Write the record to the record store 10. Display any errors that might occurred while writing to the record store 11. Create a buffer as byte sufficient to hold a record 12. Create a byte array input stream and data input stream 13. Display any errors that occurred then reading records from the record store 14. Close and remove enumeration and record store 15. Create a bar chart according to our given values based on canvas class JAD FILE: MIDlet-name :bar chart MIDlet-version :1.0 MIDlet-vendor :myname MIdlet-1 :bar chart, bar chart MIDlet-JAR-URL :bar chart.jar MIDlet-JAR-SIZE :100 Microedition-profile :MIDP-1.0 Microedition-configuration :CLDC-1.0 SOURCE CODE: import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class BarGraph extends MIDlet implements CommandListener public Form form; public Command exit; public Command ok; public Command back; public Displayable d; public Display display; public TextField textfield1; public TextField textfield2; public TextField textfield3; public TextField textfield4; 55
56 56 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); ok=new Command("Ok",Command.OK,1); exit=new Command("Exit",Command.EXIT,1); back=new Command("Back",Command.BACK,1); form.addcommand(ok); form.addcommand(exit); 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==ok) 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(back); d.setcommandlistener(this); 56
57 57 display.setcurrent(d); else if(command==exit) notifydestroyed(); else if(displayable==d) if(command==back) 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, this.getheight()-y,25, h); x+=30; i++; 57
58 58 OUTPUT: 58
59 59 PIE CHART AIM: To write and implement an j2me program for creating an pie chart. CREATING AN INSTANCE FOR PIECHART: 1. Declare references for the classes 2. Create instance as classes and assign those the instances to references 3. Declaring the canvas class and implements the canvas 4. Open a record store and create new record store with the record store does t exist 5. Display any errors that occurred in opening /creating a record store 6. Create a data in appropriate data type 7. Convert data to byte array output stream 8. Create a data output stream using the byte array output stream 9. Write the record to the record store 10. Display any errors that might occurred while writing to the record store 11. Create a buffer as byte sufficient to hold a record 12. Create a byte array input stream and data input stream 13. Display any errors that occurred then reading records from the record store 14. Close and remove enumeration and record store 15. Create a PIE chart according to our given values based on canvas class JAD FILE: MIDlet-name :bar chart MIDlet-version :1.0 MIDlet-vendor :myname MIdlet-1 :bar chart, bar chart MIDlet-JAR-URL :bar chart.jar MIDlet-JAR-SIZE :100 Microedition-profile :MIDP-1.0 Microedition-configuration :CLDC-1.0 SOURCE CODE: importjavax.microedition.lcdui.canvas; importjavax.microedition.lcdui.command; importjavax.microedition.lcdui.commandlistener; importjavax.microedition.lcdui.display; importjavax.microedition.lcdui.displayable; importjavax.microedition.lcdui.graphics; importjavax.microedition.midlet.midlet; publicclasspiechartmidletextends MIDlet implementscommandlistener private Command exitcommand; publicvoidstartapp() Display display = Display.getDisplay(this); 59
60 60 int[] data = 10, 20, 30, 40, 20 ; Displayable d = newpiechartcanvas(data); exitcommand = newcommand("exit", Command.EXIT, 1); d.addcommand(exitcommand); d.setcommandlistener(this); display.setcurrent(d); publicvoidpauseapp() publicvoiddestroyapp(boolean unconditional) publicvoidcommandaction(command c, Displayable s) notifydestroyed(); classpiechartcanvasextends Canvas int[] data; intcolors[] = 0xFF0000, 0xA9E969, 0x00FFFF, 0xC675EC, 0x008800, 0x00C400 ; publicpiechartcanvas(int[] data) this.data = data; publicvoidpaint(graphics g) int width = this.getwidth(); int height = this.getheight(); g.setcolor(255, 255, 255); g.fillrect(0, 0, width, height); int sum = 0; for (inti = 0; i<data.length; i++) sum += data[i]; intdeltaangle = 360 * 100 / sum / 100; int x = 4; int y = 4; int diameter; if (width > height) diameter = height - y * 2; else diameter = width - x * 2; intstartangle = 0; for (inti = 0; i<data.length; i++) g.setcolor(colors[i]); g.fillarc(x, y, diameter, diameter, startangle, deltaangle * data[i]); startangle += deltaangle * data[i]; 60
61 61 OUTPUT: 61
62 62 IMAGE AIM: To write and implement a j2me program for draw an image in midpmidlet. CRAETING AN INSTANCE FOR IMAGE: 1. Declare references to classes. 2. Create instances of classes and assign those instances to references. 3. Display the instance of the Canvas class whenever the MIDlet is started. 4. Terminate the MIDlet when the Exit command is selected. 5. Define a class derived from the Canvas class that implements a CommandListener. 6. Within the derived class, declare references. 7. Within the derived class, create an instance of the Command class. 8. Within the derived class, associate the instance of the Command class with the canvas. 9. Within the derived class, associate the CommandListener with the canvas. 10. Request a block of memory sufficient to hold the image, and then create the image, if you are using a mutable image. Otherwise, identify the file namethat contains the immutable image. Display an error message if there is a problem creating the image or opening the file that contains the image. 11. Within the derived class, define a paint() method that determines whether the image was successfully created or the image file was successfully opened. If so, then draw the image on the canvas. 12.Within the derived class, define a commandaction() method to process the Exit command. JAD FILE: MIDlet-name :image MIDlet-version :1.0 MIDlet-vendor :myimage MIdlet-1 :image, my image MIDlet-JAR-URL :image.jar MIDlet-JAR-SIZE :100 Microedition-profile :MIDP-1.0 Microedition-configuration :CLDC-1.0 SOURCE CODE: import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class MutableImageExample extends MIDlet private Display display; private MyCanvas canvas; public MutableImageExample () display = Display.getDisplay(this); canvas = new MyCanvas (this); 62
63 63 protected void startapp() display.setcurrent( canvas ); protected void pauseapp() protected void destroyapp( boolean unconditional ) public void exitmidlet() destroyapp(true); notifydestroyed(); class MyCanvas extends Canvas implements CommandListener private Command exit; private MutableImageExamplemutableImageExample; private Image image = null; public mycanvas(mutableimageexamplemutableimageexample) this. mutableimageexample = mutableimageexample; exit = new Command("Exit", Command.EXIT, 1); addcommand(exit); setcommandlistener(this); try image = Image.createImage(70, 70); Graphics graphics = image.getgraphics(); graphics.setcolor(255, 0, 0); graphics.fillarc(10, 10, 60, 50, 180, 180); catch (Exception error) Alert alert = new Alert( Failure, Creating Image, null, null); alert.settimeout(alert.forever); display.setcurrent(alert); protected void paint(graphics graphics) if (image!= null) graphics.setcolor(255,255,255); graphics.fillrect(0, 0, getwidth(), getheight()); 63
64 64 graphics.drawimage(image, 30, 30, Graphics.VCENTER Graphics.HCENTER); public void commandaction(command command, Displayable display) if (command == exit) mutableimageexample.exitmidlet(); OUTPUT: 64
65 65 AIM: Design a client server communication in j2me Retrieving Information from a Web Server Here are the steps required to retrieve information from a web server: 1. Declare references. 2. Obtain a reference to the instance of the Display class. 3. Create an instance of a Command class to exit the MIDlet. 4. Create an instance of a Command class to start the MIDlet. 5. Create an instance of the Form class. 6. Associate the instance of the Command class to the instance of the Form class. 7. Associate a CommandListener with the instance of the Form class. 8. Display the instance of the Form class on the screen. 9. If the Start command is selected, create references to a StreamConnection and InputStream. 10. Create a StringBuffer to store characters read from the input stream. 11. Open a connection to the server. 12. Open an input stream. 13. Read each byte from the input stream and append the byte to the StringBuffer. 14. Assign the contents of the StringBuffer to a String after the last character is read from the input stream. 15. Parse the string if necessary, and display the string in an alert dialog box. 16. If the Exit command is selected, terminate the MIDlet. 17. Trap exceptions thrown within the commandaction() method. 18. If the MIDletStateChangeException is thrown, indicate that conditions are now safe to terminate the MIDlet by assigning a true value to the exit flag variable. 19. Terminate the MIDlet when the Exit command is entered the second time. import javax.microedition.midlet.*; import javax.microedition.lcdui.*; import java.io.*; import javax.microedition.io.*; import java.util.*; public class HttpExample extends MIDlet implements CommandListener private Command exit, start; private Display display; private Form form; private StringItem stars; public HttpExample () display = Display.getDisplay(this); exit = new Command("Exit", Command.EXIT, 1); start = new Command("Start", Command.EXIT, 1); form = new Form("Customer Ranking"); form.addcommand(exit); form.addcommand(start); form.setcommandlistener(this); 65
66 66 public void startapp() throws MIDletStateChangeException display.setcurrent(form); public void pauseapp() public void destroyapp(boolean unconditional) public void commandaction(command command, Displayable displayable) if (command == exit) destroyapp(false); C h a p t e r 1 3 : G e n e r i c C o n n e c t i o n F r a m e w o r k 587 Listing 13-1 Retrieving information from a web server notifydestroyed(); else if (command == start) StreamConnection connection = null; InputStream in = null; StringBuffer buffer = new StringBuffer(); try connection = (StreamConnection) Connector.open( " in = connection.openinputstream(); int ch; while ((ch = in.read())!= -1) if (ch!= '\n') buffer.append((char)ch); else String line = new String (buffer.tostring()); if(line.equals("out of 5 stars")) 66
67 67 int position = line.indexof("alt="); Alert alert = new Alert( "Rating", line.substring(position + 5, position + 8), null, null); alert.settimeout(alert.forever); alert.settype(alerttype.error); display.setcurrent(alert); buffer = new StringBuffer(); catch (IOException error) Alert alert = new Alert("Error", "Cannot connect", null, null); alert.settimeout(alert.forever); alert.settype(alerttype.error); display.setcurrent(alert); OUTPUT 67
TAMZ. JavaME. MIDlets. Department of Computer Science VŠB-Technical University of Ostrava
MIDlets 1 MIDlet A MIDlet is a Java program for embedded devices, more specifically the virtual machine. Generally, these are games and applications that run on a cell phone. MIDlets will (should) run
More informationLab Exercise 4. Please follow the instruction in Workshop Note 4 to complete this exercise.
Lab Exercise 4 Please follow the instruction in Workshop Note 4 to complete this exercise. 1. Turn on your computer and startup Windows XP (English version), download and install J2ME Wireless Toolkit
More informationJ2ME crash course. Harald Holone
J2ME crash course Harald Holone 2006-01-24 Abstract This article gives a short, hands-on introduction to programming J2ME applications on the MIDP 2.0 platform. Basic concepts, such as configurations,
More informationMobile Devices in Software Engineering. Lab 2
Mobile Devices in Software Engineering Lab 2 Objective The objective of this lab is to: 1. Get you started with network based mobile applications 2. Get you started with persistent storage on mobile devices
More informationMobile Information Device Profile (MIDP) Alessandro Cogliati. Helsinki University of Technology Telecommunications Software and Multimedia Laboratory
Multimedia T-111.5350 Mobile Information Device Profile (MIDP) Alessandro Cogliati Helsinki University of Technology Telecommunications Software and Multimedia Laboratory 1 Outline Java Overview (Editions/Configurations/Profiles)
More informationMobile Devices in Software Engineering. Lab 3
Mobile Devices in Software Engineering Lab 3 Objective The objective of this lab is to: 1. Test various GUI components on your device 2. Continue to develop application on mobile devices Experiment 1 In
More informationFaculty of Computer Science and Information Systems Jazan University MOBILE COMPUTING (CNET 426) LAB MANUAL (MOBILE APPLICATION DEVELOPMENT LAB)
Faculty of Computer Science and Information Systems Jazan University MOBILE COMPUTING (CNET 426) LAB MANUAL (MOBILE APPLICATION DEVELOPMENT LAB) (Updated February 2017) Revised and Updated By: Dr SHAMS
More informationChapter 13 Add Multimedia to Your MIDlets
Chapter 13 Add Multimedia to Your MIDlets The Mobile Media API (MMAPI), which extends the functions of Java 2 Platform, Micro Edition (J2ME), allows easy and simple access and control of basic audio and
More informationLAB MANUAL MOBILE APPLICATION DEVELOPMENT LAB. Mr. D.RAHUL Assistant Professor
LAB MANUAL ON MOBILE APPLICATION DEVELOPMENT LAB IV B. Tech I semester (JNTUH-R15) Mr. D.RAHUL Assistant Professor INFORMATION TECHNOLOGY INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) DUNDIGAL, HYDERABAD
More informationLAB MANUAL ON MOBILE APPLICATION DEVELOPMENT LAB
LAB MANUAL ON MOBILE APPLICATION DEVELOPMENT LAB Objective: In this lab, a student is expected to design, implement, document and present a mobile client/server system using standard Java and Java 2 Micro
More informationJ2ME With Database Connection Program
J2ME With Database Connection Program Midlet Code: /* * To change this template, choose Tools Templates * and open the template in the editor. package hello; import java.io.*; import java.util.*; import
More informationBVRIT HYDERABAD College of Engineering for Women Department of Information Technology. Hand Out
BVRIT HYDERABAD College of Engineering for Women Department of Information Technology Hand Out Subject Name: Mobile Application Development Prepared by: 1. S. Rama Devi, Assistant Professor, IT Year and
More informationObjects. Phone. Programming. Mobile DAY 3 J2ME. Module 2. In real world: object is your car, your bicycle, your cat.. Object has state and behavior
DAY 3 J2ME Mobile Phone Programming Module 2 J2ME DAY 3 in aj2me nutshell Objects In real world: object is your car, your bicycle, your cat.. Object has state and behavior State: variables (car: color,
More informationDAY 3 J2ME March 2007 Aalborg University, Mobile Device Group Mobile Phone Programming
DAY 3 J2ME Mobile Phone Programming Module 2 Micro (J2ME) Overview Introduction J2ME architecture Introduction 1 J2ME Key Factors Portability: Write once run anywhere Security: Code runs within the confines
More informationLab Exercise 7. Please follow the instruction in Workshop Note 7 to complete this exercise.
Lab Exercise 7 Please follow the instruction in Workshop Note 7 to complete this exercise. 1. Turn on your computer and startup Windows XP (English version), download and install J2ME Wireless Toolkit
More informationAcknowledgments Introduction p. 1 The Wireless Internet Revolution p. 1 Why Java Technology for Wireless Devices? p. 2 A Bit of History p.
Figures p. xiii Foreword p. xv Preface p. xvii Acknowledgments p. xxi Introduction p. 1 The Wireless Internet Revolution p. 1 Why Java Technology for Wireless Devices? p. 2 A Bit of History p. 3 J2ME Standardization
More informationMobile Phone Programming
Mobile Phone Programming Free Study Activity Day 3 Part 2 J2ME in a nutshell J2ME in a nutshell Objects In real world: object is your car, your bicycle, your cat.. Object has state and behavior State:
More informationMobile Application Development. Introduction. Dr. Christelle Scharff Pace University, USA
Mobile Application Development Introduction Dr. Christelle Scharff cscharff@pace.edu Pace University, USA Objectives Getting an overview of the mobile phone market, its possibilities and weaknesses Providing
More informationWho am I? Wireless Online Game Development for Mobile Device. What games can you make after this course? Are you take the right course?
Who am I? Wireless Online Game Development for Mobile Device Lo Chi Wing, Peter Lesson 1 Email: Peter@Peter-Lo.com I123-1-A@Peter Lo 2007 1 I123-1-A@Peter Lo 2007 2 Are you take the right course? This
More informationProgramming Wireless Devices with the Java 2 Platform, Micro Edition
Programming Wireless Devices with the Java 2 Platform, Micro Edition J2ME Connected Limited Device Configuration (CLDC) Mobile Information Device Profile (MIDP) Roger Riggs Antero Taivalsaari Mark VandenBrink
More informationWireless Java Technology
Wireless Java Technology Pao-Ann Hsiung National Chung Cheng University Ref: http://developers.sun.com/techtopics/mobility/learning/tutorial/ 1 Contents Overview of Java 2 Platform Overview of J2ME Scope
More informationCS434/534: Topics in Networked (Networking) Systems
CS434/534: Topics in Networked (Networking) Systems WSN/Mobile Systems Yang (Richard) Yang Computer Science Department Yale University 208A Watson Email: yry@cs.yale.edu http://zoo.cs.yale.edu/classes/cs434/
More information... 2...3 1...6 1.1...6 1.2... 10 1.3... 16 2...20 2.1... 20 2.2...28... 33... 35... 40...45...49....53 2 ,,.,,., ё.[37],.,. [14] «-». [19] - (..,..,..,..,..,..,..,..,....) (.,.,.,...). -..,..,... [19].
More information3.3.4 Connection Framework
108 MIDP 2.0 AND THE JTWI 3.3.4 Connection Framework 3.3.4.1 What s Optional and What s Not The CLDC provides a Generic Connection Framework (GCF), which is an extensible framework that can be customized
More informationUniversity of Osnabrueck
University of Osnabrueck Google maps on mobile devices with J2ME Li Wang Supervisor: Prof. Dr. Oliver Vornberger Prof. Dr. Helmar Gust Department of Cognitive Science University of Osnabrueck 07. 27. 2006
More informationNutiteq Maps SDK tutorial for Java ME (J2ME)
Nutiteq Maps SDK tutorial for Java ME (J2ME) Version 1.1.1 (updated 29.08.2011) 2008-2011 Nutiteq LLC Nutiteq LLC www.nutiteq.com Skype: nutiteq support@nutiteq.com Page2 1 Contents 2 Introduction... 3
More informationCHAPTER 18 MIDLETS JAVA PROGRAMS FOR MOBILE DEVICES
Although this document is written so that it slightly resembles a chapter of a book, this does not belong to my Java book A Natural Introduction to Computer Programming in Java. This document is additional
More informationThe network connection
C H A P T E R 1 3 The network connection 13.1 About the Generic Connection Framework 366 13.2 Using the Generic Connection Framework 372 13.3 HTTP-based connections 372 13.4 Socket-based connections 377
More informationSUN. Sun Certified Mobile Application Developer for the Java 2 Platform, Micro Edition, Version 1.0
SUN 310-110 Sun Certified Mobile Application Developer for the Java 2 Platform, Micro Edition, Version 1.0 Download Full Version : https://killexams.com/pass4sure/exam-detail/310-110 QUESTION: 332 Given:
More informationINSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad
INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad - 500 043 INFORMATIONTECHOGY TUTORIAL QUESTION BANK ACADEMIC YEAR - 2018-19 Course Title Mobile Application Development Course Code
More informationDAY 3 J2ME Aalborg University, Mobile Device Group. Mobile. Mobile Phone Programming
DAY 3 J2ME Mobile Phone Programming Java 2 Micro Edition (J2ME) Overview Introduction J2ME architecture MIDlets Application development Introduction J2ME Key Factors Portability: Write once run anywhere
More informationJava 2 Micro Edition Server socket and SMS
Java 2 Micro Edition Server socket and SMS F. Ricci Content Other Connection Types Responding to Incoming Connections Security Permissions Security domains Midlet signing Wireless Messaging Responding
More informationSortware Comprehension and Μaintenance
Department of Management and Technology Sortware Comprehension and Μaintenance Wireless IRC project Design of a new feature Wireless Irc s Design Presentation Brief explanation of Midlet Suites function
More informationAccessing DB2 Everyplace using J2ME devices, part 1
Accessing DB2 Everyplace using J2ME devices, part 1 Skill Level: Intermediate Naveen Balani (naveenbalani@rediffmail.com) Developer 08 Apr 2004 This two-part tutorial assists developers in developing DB2
More informationJAVA. Java Micro Edition
JAVA Java Micro Edition Overview predecessors Personal Java (1997) Embedded Java (1998) JME definition via JCP JCP Java Community Process JME is not a single SW package a set of technologies and specifications
More informationWhat have we learnt last week? Wireless Online Game Development for Mobile Device. Introduction to Thread. What is Thread?
What have we learnt last week? Wireless Online Game Development for Mobile Device Lesson 5 Introduction to Low-level API Display Image in Canvas Configure color, line style, font style for Drawing Drawing
More informationST.MARTIN'S ENGINEERING COLLEGE Dhulapally,Secunderabad-014
ST.MARTIN'S ENGINEERING COLLEGE Dhulapally,Secunderabad-014 INFORMATION TECHNOLOGY TUTORIAL QUESTION BANK Course Title Course Code Regulation Course Structure Team of Instructors Mobile Application Development
More informationMobile application development J2ME U N I T I
Mobile application development J2ME U N I T I Mobile Application Development Prepared By : Ms. G Chaitanya Assistant Professor Information Technology Overview Introduction of Mobile Technology What is
More informationDeveloping mobile UI
Vorlesung Advanced Topics in HCI (Mensch-Maschine-Interaktion 2) Ludwig-Maximilians-Universität München LFE Medieninformatik Albrecht Schmidt & Andreas Butz WS2003/2004 http://www.medien.informatik.uni-muenchen.de/
More informationDeveloping Mobile Applications
Developing Mobile Applications J2ME Java 2 Micro Edition 1 Virtual machines portable apps virtual machine native apps operating system hardware 2 Java - important issues Symbolic language not a random
More informationNOKIA 12 GSM MODULE JAVA TM IMLET PROGRAMMING GUIDE. Copyright Nokia. All rights reserved. Issue
NOKIA 12 GSM MODULE JAVA TM IMLET PROGRAMMING GUIDE Copyright 2004-2005 Nokia. All rights reserved. Issue 1.1 9231715 Contents ACRONYMS AND TERMS...1 1. ABOUT THIS DOCUMENT...4 2. INTRODUCTION...6 3. NOKIA
More informationWhat remains? Median in linear time, randomized algorithms (Monte Carlo, Las Vegas), other programming languages.
What remains? Median in linear time, randomized algorithms (Monte Carlo, Las Vegas), other programming languages. Median in linear time in fact not just median If we wanted the algorithm finding only median,
More informationJava 2 Micro Edition Server socket and SMS. F. Ricci
Java 2 Micro Edition Server socket and SMS F. Ricci Content Other Connection Types Responding to Incoming Connections Socket and Server Socket Security Permissions Security domains Midlet signing Wireless
More informationGUIDELINES FOR GAME DEVELOPERS USING NOKIA JAVA MIDP DEVICES Version Nov 02
GUIDELINES FOR GAME DEVELOPERS USING NOKIA JAVA MIDP DEVICES 07 Nov 02 Table of Contents 1. INTRODUCTION...3 1.1 PURPOSE...3 1.2 REFERENCES...4 2. GAME GUIDELINES...5 2.1 USE OF GAME ACTIONS...5 2.2 NOTES
More informationMobile Application Development. J2ME - Forms
Mobile Application Development J2ME - Forms Dr. Christelle Scharff cscharff@pace.edu Pace University, USA http://mobilesenegal.com Objectives Understand and manipulate: Display Displayable Command Form
More informationMobile Systeme Grundlagen und Anwendungen standortbezogener Dienste. Location Based Services in the Context of Web 2.0
Mobile Systeme Grundlagen und Anwendungen standortbezogener Dienste Location Based Services in the Context of Web 2.0 Department of Informatics - MIN Faculty - University of Hamburg Lecture Summer Term
More informationMobile Messaging Using Bangla
1 Mobile Messaging Using Bangla Tofazzal Rownok ID# 01101040 Department of Computer Science and Engineering December 2005 BRAC University, Dhaka, Bangladesh 2 DECLARATION I hereby declare that this thesis
More informationJUGAT meeting. Roman Waitz Development. MATERNA Information & Communications
JUGAT meeting Roman Waitz Development MATERNA Information & Communications 22/04/2002 Agenda +What the J2ME Platform is +How to build and deploy J2MEbased wireless applications +J2ME programming techniques
More informationProduct Information Retrieval. over Cellular Networks. Author: John Delaney
Product Information Retrieval over Cellular Networks Author: John Delaney A dissertation submitted to the University of Dublin, in partial fulfillment of the requirements for the degree of Master of Science
More informationMensch-Maschine-Interaktion 2
Mensch-Maschine-Interaktion 2 Übung 5 (12./14./15. Juni 2007) Arnd Vitzthum - arnd.vitzthum@ifi.lmu.de Amalienstr. 17, Raum 501 Dominic Bremer - bremer@cip.ifi.lmu.de Java ME Overview (I) Java ME slim
More informationPASS4TEST. IT Certification Guaranteed, The Easy Way! We offer free update service for one year
PASS4TEST IT Certification Guaranteed, The Easy Way! \ We offer free update service for one year Exam : 310-110 Title : Sun Certified Mobile Application Developer for J2ME. v1.0 Vendors : SUN Version :
More informationExam : : Sun Certified Mobile Application Developer for J2ME. v1.0. Title. Version : DEMO
Exam : 310-110 Title : Sun Certified Mobile Application Developer for J2ME. v1.0 Version : DEMO 1.During a MIDlet suite installation, a JTWI-compliant device performs the following actions: downloads and
More informationActual4Test. Actual4test - actual test exam dumps-pass for IT exams
Actual4Test Actual4test - actual test exam dumps-pass for IT exams Exam : 1Z0-869 Title : Java Mobile Edition 1 Mobile Application Developer Certified Professional Exam Vendors : Oracle Version : DEMO
More informationCreating a Java ME Embedded Project That Uses GPIO
Raspberry Pi HOL. Note: IP: 10.0.0.37 User: pi Password: raspberry Part I Creating a Java ME Embedded Project That Uses GPIO In this section, you create a project by using NetBeans and you test it locally
More information7. Concurrency. Motivation Infrastructure Faking concurrency Mobile Java implementation Symbian OS implementation. Maemo implementation Summary
7. Concurrency Motivation Infrastructure Faking concurrency Mobile Java implementation Symbian OS implementation Threads Active objects Maemo implementation Summary 1 Motivation Mobile devices are fundamentally
More informationProject Overview. Readings and References. Initial project motivation. Opportunity. References. CSE 403, Winter 2003 Software Engineering
Readings and References Project Overview CSE 403, Winter 2003 Software Engineering http://www.cs.washington.edu/education/courses/403/03wi/ References» What will people pay for? Dan Bricklin.» Accessing
More informationJava 2 Micro Edition
Java 2 Micro Edition F.Ricci Content Why Java on mobile devices Three main Java environments Java 2 Micro Edition Configurations and profiles Optional packages Generic connection framework Application
More informationUsing XML in Wireless Applications
Using XML in Wireless Applications CHAPTER 10 IN THIS CHAPTER Overview 336 XML and Parsing XML Documents 337 XML Parsers for Wireless Applications 340 SAX 1.0 Java API For J2ME MIDP 342 TinyXML Parser
More informationProject Overview. CSE 403, Spring 2003 Software Engineering.
Project Overview CSE 403, Spring 2003 Software Engineering http://www.cs.washington.edu/education/courses/403/03sp/ 2-Apr-2003 Cse403-02-ProjectOverview 2003 University of Washington 1 References Readings
More informationProject Overview. Readings and References. Opportunity. Initial project motivation. References. CSE 403, Spring 2003 Software Engineering
Readings and References Project Overview CSE 403, Spring 2003 Software Engineering References» What will people pay for? Dan Bricklin.» Accessing a whole new world via multimedia phones. Dan Gillmor.»
More informationMaster Project. Push To Chat. Realized by. The Quang Nguyen. Supervisor. Professor Jean-Yves Le Boudec (EPFL, LCA) Assistant
Master Project Push To Chat Realized by The Quang Nguyen Supervisor Professor Jean-Yves Le Boudec (EPFL, LCA) Assistant Alaeddine El Fawal (EPFL, LCA) Ecole Polytechnique Fédérale de Lausanne (EPFL) Winter
More informationInternet and Mobile Services 2 - Java 2 Micro Edition. F. Ricci 2009/2010
Internet and Mobile Services 2 - Java 2 Micro Edition F. Ricci 2009/2010 Content Mobile applications Why Java on mobile devices Three main Java environments Java 2 Micro Edition Configurations and profiles
More informationMobile Services 2 - Java 2 Micro Edition. F. Ricci
Mobile Services 2 - Java 2 Micro Edition F. Ricci Content Why Java on mobile devices Three main Java environments Java 2 Micro Edition Configurations and profiles Optional packages Generic connection framework
More informationJava 2 Micro Edition Socket, SMS and Bluetooth. F. Ricci 2008/2009
Java 2 Micro Edition Socket, SMS and Bluetooth F. Ricci 2008/2009 Content Other Connection Types Responding to Incoming Connections Socket and Server Socket Security Permissions Security domains Midlet
More informationMobile Services 2 - Java 2 Micro Edition. F. Ricci 2008/2009
Mobile Services 2 - Java 2 Micro Edition F. Ricci 2008/2009 Content Mobile applications Why Java on mobile devices Three main Java environments Java 2 Micro Edition Configurations and profiles Optional
More informationSoftware Development & Education Center. Java Platform, Micro Edition. (Mobile Java)
Software Development & Education Center Java Platform, Micro Edition (Mobile Java) Detailed Curriculum UNIT 1: Introduction Understanding J2ME Configurations Connected Device Configuration Connected, Limited
More informationTWO-DIMENSIONAL FIGURES
TWO-DIMENSIONAL FIGURES Two-dimensional (D) figures can be rendered by a graphics context. Here are the Graphics methods for drawing draw common figures: java.awt.graphics Methods to Draw Lines, Rectangles
More informationRadical GUI Makeover with Ajax Mashup
Radical GUI Makeover with Ajax Mashup Terrence Barr Senior Technologist and Community Ambassador Java Mobile & Embedded Community TS-5733 Learn how to turn a 'plain old' Java Platform, Micro Edition (Java
More informationمريم سعد جعفر رانيا عبد السجاد علي سامي سمادير عبد العباس ياسمين عبد االمير
مريم سعد جعفر رانيا عبد السجاد علي سامي سمادير عبد العباس ياسمين عبد االمير 1 Introduction of J2ME Introduction of Mobile Technology The goals Mobile Technology Connecting people Information sharing Internet
More information1Z0-869
1Z0-869 Passing Score: 800 Time Limit: 4 min Exam A QUESTION 1 How would a MIDlet that uses a GameCanvas efficiently update only a small region of the screen, from the data in the off-screen buffer? A.
More informationM257 Past Paper Oct 2007 Attempted Solution
M257 Past Paper Oct 2007 Attempted Solution Part 1 Question 1 The compilation process translates the source code of a Java program into bytecode, which is an intermediate language. The Java interpreter
More informationWhat have we learnt last week? Wireless Online Game Development for Mobile Device Lesson 7 Generic Connection Framework Generic Connection Framework
What have we learnt last week? Wireless Online Game Development for Mobile Device Lesson 7 Introduction to MMAPI Play Audio files (Wav and Midi format) Play MPEG movie from Internet Design and play your
More informationOracle Exam 1z0-869 Java Mobile Edition 1 Mobile Application Developer Certified Professional Exam Version: 6.0 [ Total Questions: 340 ]
s@lm@n Oracle Exam 1z0-869 Java Mobile Edition 1 Mobile Application Developer Certified Professional Exam Version: 6.0 [ Total Questions: 340 ] Topic 1, Volume A Question No : 1 - (Topic 1) How would a
More informationMobile Station Execution Environment (MExE( MExE) Developing web applications for PDAs and Cellphones. WAP (Wireless Application Protocol)
Developing web applications for PDAs and Cellphones Mobile Station Execution Environment (MExE( MExE) MExE is a standard for defining various levels of wireless communication These levels are called classmarks
More informationJava Programming for Wireless devices using J2ME - CLDC/MIDP APIs
Slide 1 Java Programming for Wireless devices using J2ME - CLDC/MIDP APIs Srikanth Raju Srikanth.raju@sun.com Staff Engineer Technology Evangelism Sun Microsystems, Inc. 2001, Sun Microsystems, Inc. All
More informationOverview. Applets. A Java GUI inside your browser! Important methods Drawing images Playing audio Getting input parameters Double buffering
Java Applets don't panic about frogs!
More informationProgramming mobile devices with J2ME
Claude Fuhrer Bern University of Applied Sciences School of Engineering and Information Technology October 2010 1 Introduction The Connected Limited Device Configuration Part I Introduction Introduction
More informationCÔNG NGHỆ KHÔNG DÂY VÀ ỨNG DỤNG. Biên tập bởi: Khoa CNTT ĐHSP KT Hưng Yên
CÔNG NGHỆ KHÔNG DÂY VÀ ỨNG DỤNG Biên tập bởi: Khoa CNTT ĐHSP KT Hưng Yên CÔNG NGHỆ KHÔNG DÂY VÀ ỨNG DỤNG Biên tập bởi: Khoa CNTT ĐHSP KT Hưng Yên Các tác giả: Khoa CNTT ĐHSP KT Hưng Yên Phiên bản trực
More informationF O R U M N O K I A. MIDP 2.0 Introduction. Version 1.0; May Technology
F O R U M N O K I A MIDP 2.0 Introduction Version 1.0; May 2003 Technology Contents 1 Introduction...4 2 javax.microedition.lcdui...4 2.1 Display...4 2.2 Displayable...5 2.3 Screen...5 2.4 Command...5
More informationFaculty Summit September 28 th, Bandung
Faculty Summit September 28 th, Bandung rayrizaldy@gits.co.id Network and Location Location, Maps Bluetooth Traditional location APIs use GPS Location Network- based location is faster to give a result,
More informationBangla Text Input and Rendering Support for Short Message Service on Mobile Devices
Bangla Text Input and Rendering Support for Short Message Service on Mobile Devices Tofazzal Rownok, Md. Zahurul Islam and Mumit Khan Department of Computer Science and Engineering, BRAC University, Dhaka,
More informationWildingMcBride.book Page 229 Monday, May 19, :15 AM. Index
WildingMcBride.book Page 229 Monday, May 19, 2003 9:15 AM Index A Abstract Window Toolkit. See AWT (Abstract Window Toolkit) actionperformed method, HttpNetworking class, 141 Active state MIDlets, 7 Xlets,
More informationFirst Name: AITI 2004: Exam 2 July 19, 2004
First Name: AITI 2004: Exam 2 July 19, 2004 Last Name: JSP Track Read Instructions Carefully! This is a 3 hour closed book exam. No calculators are allowed. Please write clearly if we cannot understand
More informationCS434/534: Topics in Networked (Networking) Systems
CS434/534: Topics in Networked (Networking) Systems Mobile System: Android (Single App/Process) Yang (Richard) Yang Computer Science Department Yale University 208A Watson Email: yry@cs.yale.edu http://zoo.cs.yale.edu/classes/cs434/
More informationGetting started with Java
Getting started with Java by Vlad Costel Ungureanu for Learn Stuff Programming Languages A programming language is a formal constructed language designed to communicate instructions to a machine, particularly
More informationFirst Name: AITI 2004: Exam 2 July 19, 2004
First Name: AITI 2004: Exam 2 July 19, 2004 Last Name: Standard Track Read Instructions Carefully! This is a 3 hour closed book exam. No calculators are allowed. Please write clearly if we cannot understand
More informationEE219 Object Oriented Programming I (2005/2006) SEMESTER 1 SOLUTIONS
Q1(a) Corrected code is: EE219 Object Oriented Programming I (2005/2006) SEMESTER 1 SOLUTIONS 01 #include 02 using namespace std; 03 04 class Question1 05 06 int a,b,*p; 07 08 public: 09 Question1(int
More informationJava Intro 3. Java Intro 3. Class Libraries and the Java API. Outline
Java Intro 3 9/7/2007 1 Java Intro 3 Outline Java API Packages Access Rules, Class Visibility Strings as Objects Wrapper classes Static Attributes & Methods Hello World details 9/7/2007 2 Class Libraries
More informationDynabook Vision. Mobile User Interfaces. Chapter 3: Mobile HCI Vorlesung Advanced Topics in HCI (Mensch-Maschine-Interaktion 2)
08/07/04 LMU München Mensch -Maschine-Interaktion 2 SoSe04 Schmidt/Hußmann 1 Chapter 3: Mobile HCI Vorlesung Advanced Topics in HCI (Mensch-Maschine-Interaktion 2) Ludwig-Maximilians-Universität München
More informationPESIT Bangalore South Campus
INTERNAL ASSESSMENT TEST II Date : 20-09-2016 Max Marks: 50 Subject & Code: JAVA & J2EE (10IS752) Section : A & B Name of faculty: Sreenath M V Time : 8.30-10.00 AM Note: Answer all five questions 1) a)
More informationDoD Mobile Client- A Comparison between J2ME and Symbian Platforms
DoD Mobile Client- A Comparison between J2ME and Symbian Platforms Sanjay Rajwani KTH Information and Communication Technology Master of Science Thesis Stockholm, Sweden 2012 DoD Mobile Client A Comparison
More informationCopyright 2004 by Vincent Claes, Heusden-Zolder, Belgium
Copyright 2004 by, Heusden-Zolder, Belgium ISBN : 9090180354 The names of the actual companies and products mentioned in this thesis are the trademarks of their respective owners. Use of a term in this
More informationJava Classes. Produced by. Introduction to the Java Programming Language. Eamonn de Leastar
Java Classes Introduction to the Java Programming Language Produced by Eamonn de Leastar edeleastar@wit.ie Department of Computing, Maths & Physics Waterford Institute of Technology http://www.wit.ie http://elearning.wit.ie
More informationMOTOROKR E6/E6e Java ME Developer Guide. Version 02.00
MOTOROKR E6/E6e Version 02.00 Copyright 2007, Motorola, Inc. All rights reserved. This documentation may be printed and copied solely for use in developing products for Motorola products. In addition,
More informationProgramming: You will have 6 files all need to be located in the dir. named PA4:
PROGRAMMING ASSIGNMENT 4: Read Savitch: Chapter 7 and class notes Programming: You will have 6 files all need to be located in the dir. named PA4: PA4.java ShapeP4.java PointP4.java CircleP4.java RectangleP4.java
More informationOutline-session 9 (09-April-2009)
Outline-session 9 (09-April-2009) >> J2ME Record Management System -Introduction -RMS -Record Store -Record Store-MIDlet -Record Store Scope -Record Store Two attribute -Record Store API -Record Enumeration
More informationB2.52-R3: INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING THROUGH JAVA
B2.52-R3: INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING THROUGH JAVA NOTE: 1. There are TWO PARTS in this Module/Paper. PART ONE contains FOUR questions and PART TWO contains FIVE questions. 2. PART ONE
More informationJava in 21 minutes. Hello world. hello world. exceptions. basic data types. constructors. classes & objects I/O. program structure.
Java in 21 minutes hello world basic data types classes & objects program structure constructors garbage collection I/O exceptions Strings Hello world import java.io.*; public class hello { public static
More informationProjectwork Mobile Services
Projectwork Mobile Services HMCS House Mobile Control System Valentin Ioan Tincas Jürgen Innerkofler 2007/2008 Project description:... 3 Used hardware components:... 3 Software implementation... 4 Communication
More information1993: renamed "Java"; use in a browser instead of a microwave : Sun sues Microsoft multiple times over Java
Java history invented mainly by James Gosling ([formerly] Sun Microsystems) 1990: Oak language for embedded systems needs to be reliable, easy to change, retarget efficiency is secondary implemented as
More information