2.0 cldc 1.1 games
Initially, the Datagram Server status is Waiting for connection, and the Send box is empty. In the second emulator, launch Datagram Demo, select the Client peer, then choose Start. The Datagram Client status is: Connected to server. For example, type Hello datagram server. On the emulator running the Datagram Server, the Status displays: Message received - Hello datagram server. You can use the down arrow to move to the Send box and type a reply to the client. In the Datagram Client, the status field displays the message received from the server.
The Send box contains the last message you sent. This demonstration shows the use of OBEX over a simulated infrared connection. One listens for incoming connections, while the other attempts to send an image. In the first emulator, launch the application then choose Obex Demo, then Receive Image. The listener emulator displays a screen that indicates it is waiting for incoming connections. In the second emulator the sender , launch Obex Demo, then choose Send Image.
You see a list of images. Select one and choose Send. The emulator explains the demo wants to make an outgoing client connection, and asks if it is OK. The Send Image utility uploads the image. In the listening emulator, the utility displays information about the incoming image and asks "Would you like to receive it? The image you selected is transferred over the simulated infrared link and displayed on the first emulator. To run the file browser, you'll need to give the MIDlet appropriate security authorization, if you have not already done so.
Click on the Security tab. Change the Security domain to maximum and press OK. You see a directory listing, and you can browse through the available directories and files. By default there is one directory, root1. Select the directory and press the select button to enter it. Using the commands in the demonstration, you can view the file or see its properties. Try selecting the file and choosing Properties or View from the menu. See Chapter 10 for more information. After you launch the example, choose a type of list from the main menu.
In this example application, each type of list works the same way and each list type contains a single list. For example, if you choose Contact Lists, there is a single contact list called Contacts.
Once you've selected a list type and chosen the specific list, you can view all the items in the list. If this is the first time you've run the example, the list is probably empty. To add an item, choose New from the menu. The application prompts you for a Formatted Name for the item. You can add more data fields to this item using Add Field in the menu. You see a list of field names. Pick one, then enter the value for the new field. To save the list item, choose Commit option 3 from the menu.
You can return to the list by choosing the Back command. You'll see the item you just created in the list.
The exact format depends on the list type. When you are viewing an item in any list, the menu contains a command for viewing the exported item. For example, when you are viewing a contact list item, the menu contains Show vCard.
When you choose this command, the exported item is shown on the screen. Calendar items and to-do items both get exported as vCalendar.
Most of the demonstrations show how to communicate with a smart card. The emulator can communicate with a simulated smart card using a socket protocol. The smart card simulator, cref , is included with the toolkit. See Chapter 14 for details. The following sections contain instructions for each menu choice for this demo. For each demo, be sure to do the following before launching the emulator:.
You can run the smart card simulator using cref , which is part of the Java Card Development Kit. The Mohair application includes pre-built memory images that you can use with cref. The memory images contain Java Card applications with which Mohair interacts.
The memory images are in the root directory of the Mohair project. On Windows, start up two instances of cref like this, one for each simulated card slot assuming the current directory is the toolkit installation directory :. Note that the port numbers and in this example must match the port numbers you specified in the SATSA preferences, described in Chapter Also, make sure you use the correct path to demo2.
This time you don't have to specify a port number, and the memory image is different:. It does not interact with a smart card in any way. MohairMIDlet has two functions. The first, Find slots, displays all the available card slots.
After viewing the slots select Back to return to the first screen. As with the earlier demonstrations, you need to run cref with the right memory image to prepare for the connection from MohairMIDlet. Type the following in the installation directory:. The following confirmation message appears:. This certificate will be used: MohairAuth. For PIN 1, type: Select the OK soft key.
This string will be signed: JSR Approved. For non repudiation key 1 PIN, type: Usually devices will use SIP with a proxy server to set up direct communications of some kind. For a more complete example involving a proxy, take a look at GoSip. To see how SIPDemo works, run two instances of the emulator. In the first, choose Receive message. You can use the default port, , and choose Receive. The first emulator is now listening for incoming messages.
In the second emulator, choose Send message. Fill in values for the recipient, port number, subject, and message, or accept the defaults, and choose Send. Your message will be displayed in the first emulator. The first emulator's response is displayed in the second emulator. Try it again with the network monitor turned on. You can see the communication between the emulators in the network monitor SIP tab. This application uses different skins to display the same contact list information and a news banner.
The skins have different colors and fonts. Use the up and down arrows to navigate the list of contacts. Press the select button to see more information for the highlighted name. Press select again to return to the contact list. Graphical elements can be logically grouped and identified by the SVG markup. Launch the demo. The application displays the contents of root1. Select your SVG file and choose the Open soft key. Looking at the demo code you can see that the image is sized on the fly to exactly fit the display area.
The output is clear and sharp. This application plays an SVG animation depicting a Halloween greeting card. Press 8 to play, 5 to start, and 0 to stop. If you press 8, pressing 5 resumes the animation.
If you press 0, pressing 5 starts the animation from the beginning. The SVG file contains a description of how the various image elements evolve over time to provide this short animation. In the following code sample, the JSR javax. Then, the javax. Component or javax. JComponent which plays the animation. The SVGAnimator class provides methods to play, pause and stop the animation.
This demo builds an image using API calls. It creates an empty SVGImage, populates it with a graphical content, and then displays that content. Bouncing Balls plays an SVG animation.
In this demo, selected icons have a yellow border. As you move to a new icon, it becomes selected and the previous icon flips to the unselected state.
If you navigate off the icon grid, selection loops around. That is, if the last icon in a row is selected, moving right selects the first icon in the same row. This demo illustrates the flexibility that combining UI markup and Java offers: a rich set of functionality graphics, animations, high-end 2D rendering and flexibility in graphic manipulation, pre-rendering or playing.
In this example, a graphic artist delivered an SVG animation defining the transition state for the menu icons, from the unselected state to the selected state. The program renders each icon's animation sequence separately into off-screen buffers for faster rendering later on , using the JSR API.
With buffering, the MIDlet is able to adapt to the device display resolution because the graphics are defined in SVG format and still retain the speed of bitmap rendering. The task of defining the look of the menu items and their animation effect the job of the graphic artist and designer is cleanly separated from the task of displaying the menu and starting actions based on menu selection the job of the developer.
The two can vary independently as long as both the artist and the developer observe the SVG document structure conventions. In this demo you use the phone keys to add decorations to a photograph. The key values are:. This demo provides 16 pictures for you to decorate.
Use the 2 and 6 keys to page forward and back through the photos. To decorate, press to display the picker. Use the arrow keys to highlight a graphic object. The highlighted object is enlarged. This means it is selected and can be moved, resized, and manipulated. Number "35" is how many mines are hidden in the field.
The big white square is your cursor, smaller squares around that are neighborhood hints: they show you how from which fields is the number of neighboring mines computed. These hints will go away as soon as you start the game itself, i.
A couple finished games. These two show the game with 12 neighboring tiles. The right hand side shot also shows failed game. Maybe your filename is too big. Try to reduce both names jad and jar to equal or below 13, for example: MobileApp. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. How to install a Java ME app on Samsung phone?
Ask Question. Asked 9 years, 3 months ago. Active 7 years, 9 months ago. Viewed 14k times. For example, if the MIDlet requests to initiate a phone call, the device should show a dialog to the user asking them if they want to proceed. This is especially important since any kind of network or calling activity may incur charges to the user. Device makers are free to support additional URL schemes to expose the unique capabilities of their devices. The javax.
MIDlets may statically register for notification of incoming connections by setting appropriate properties in the descriptor file. Using these mechanisms, MIDlets may be started by the device's application manager, i. To support an application that is interested in multiple, short-term inbound connections for example, a turn-based game a PushListener may be registered with the PushRegistry.
The PushListener is informed of any new inbound connections. To support secure connections, a SecureConnection interface has been defined. A secure connection using SSL can be easily created using the connector framework. The most important addition to the lcdui user interface package is the inclusion of a CustomItem class.
Forms allow items to be laid out on a two-dimensional grid. To support custom screens, for example a complex game board, there is also a low-level Canvas class similar to the AWT Canvas.
In MIDP 1. Even worse, it is not possible to have a Canvas and a Form both on the screen at the same time. Therefore, any customization forces the developer to create a completely customized screen using Canvas.
In MIDP 2. The CustomItem class defines the notion of a content area. Subclasses can define both a minimum and preferred size. By overriding the paint method, any image can be drawn into this area. Depending on the capabilities of the device, the user may interact with the custom item in one of several ways. For devices which allow in-line editing, the item may respond to input events as appropriate. If the device or the custom item does not support in-line editing, the custom item should bring up a separate editor.
It is recommended that the custom item support at least the external editor mode for maximum portability.
0コメント