You are on page 1of 107

sn

o stem_text opt1_txt

Consider the Statements:

Statement A: The 3GSM technology provides the facility to


deliver textual and visual information, and send and
receive still and animated images.

Statement B: The GPRS technology provides high


bandwidth and quality for transmitting voice and text
across a wireless network.

Which of the following is True, with respect to the above


1 Statements? 1,Statement A is True and Statement B i

Pat Greene is working as application developer at with


Deez Inc. The company organization has created a new
mobile application by using J2ME. The management wants
to add some features in the J2ME application so that the
user can use this application without maintaining a
constant connection with the wireless network. Therefore,
the business manager of the company organization has
asked Pat to upgrade the application with reduced network
failure and transport cost. Which feature of J2ME enables
2 Pat to develop such application? 1,Cross platform compatibility.
Jim Wilkins is a mobile application developer at with Safest
Software. The management of the company organization
asks Jim to develop a mobile application, which enables
mobile users to download video and music clips and access
high-speed Internet. Which technology should Jim use to
3 develop mobile application with the required features? 1,WAP

Bob Edwin is working as an application developer at with


Red Sky Experts. Bob wants to develop an application by
using the Enterprise Java Beans (EJB), Servlets and Java
Server Pages (JSP), and Extensible Markup Language
(XML). Bob also wants to use this application across the
distributed network. Which Java technology should Bob use
4 to develop this application? 1,J2SE

Steve Irving is working as mobile application developer at


with Blue Moon Computers. Steve has developed a mobile
application, which enables the user to download wireless
applications on mobile devices. It also provides the facility
to deliver textual and visual information, such as sports
scores, news headlines, and weather information. But now,
Steve wants to upgrade that mobile application with high
data transmission speed and multimedia data services.
Which technology should Steve use to develop such mobile
5 application? 1,EDGE
Christine Turner works as a software programmer with
SmartLabs. Christine has been assigned the task to
develop a MIDlet suite that denies access to all the
restricted APIs. After building, developing and packaging
the suite, Christine decides to add digital signature and
signer certificate of a JAR file to a JAD file. Which of the
following security domains should Christine assign to the
6 certificate? 1,Maximum domain

Diane Frye, the mobile application developer, is working


with SmartLabs. Diana needs to develop an application that
provides data encryption, source authentication, and data
integrity while transmitting data over a network. Which of
the following application level security techniques should
7 Diane use in the application? 1,Protection domains

Ken Burton works as a mobile application developer with


SuperGraphics. Ken is developing MIDlet applications that
allow customers to connect to bank server and query their
bank accounts by sending username and passwords.
However, the username and password should be in the
encrypted format. Which security measure should Ken use
in the application to secure the data transmitted over the
8 network traffic? 1,Implement secure UDP connection ove
Consider the Statements:

Statement A: The blanket interaction mode allows


permission to all the methods or APIs requested by the
MIDlet suite until the user modifies the permission.

Statement B: The session interaction mode allows


permission for only the current request for a method or an
API.

Which of the following is True, with respect to the above


9 Statements? 1,Statement A is True and Statement B i

Mike Womack is working as a programmer with Technology


Systems. Mike develops a MIDlet suite that helps connect
to a remote server and transmit data over a network by
using MIDP 1.0 specification. However, due to less security,
Mike decides to execute the MIDlet suite on a MIDP 2.0
1 implemented device. For which of the following API does
0 Mike needs to provide with explicit confirmation? 1,javax.microedition.lcdui.game
Lee Mitchell, the mobile application developer with Blue
Moon Computers, needs to develop a mobile application for
insurance agents working at SSPT Corporation. The
application will help the insurance agents to access the
database of the organization and make necessary changes
in the database. For this, Lee establishes a HTTP-based
network connection. He develops the application and runs
the developed application to check whether the application
is working properly. Lee writes the following code snippet
to close the existing HTTP connection:

try {

mHttpConnection.close (); // Close any open stream

} 1,Lee needs to replace the code with the

catch (Exception ) { try {

// Handle the exception mHttpConnection.close (); // Close any o

} }

catch (IOException ioe) {

However, Lee finds that he is not able to close the // Handle the exception
1 connection and handle the exception raised while closing
1 the connection. What should Lee do to solve the problem? }
Donna Bard is working as a network administrator with
Technology Systems. Donna has been assigned the task of
establishing a network connection between mobile devices
and Web servers in the organization. Donna needs to
develop an HTTP connection to allow users to access the
Web services through their mobile devices. Donna writes
the following code to establish a connection:

Connector dc = Connector.open(www.wirelessdevnet.com);

1,Donna needs to replace the code with


code:
However, when Donna runs the code, she is not able to
1 establish the connection. What should Donna do to resolve Connection sc = (Connector)
2 the problem? Connector.open(“socket://localhost:9000
Nancy Jones is working as a mobile application developer
with Smart Software Developers. Nancy needs to develop a
server-side application by using J2ME. Nancy needs to use
mobile devices to access databases stored on the server of
the organization. Nancy needs to configure the Web server
to support servlets before creating enterprise applications
by using J2ME. Nancy writes the following code:

private void doGet(HttpServletRequest request,


HttpServletResponse response)throws IOException,
ServletException {

PrintWriter out = response.getWriter();

out.println("some abc");

System.out.println ("some xyz");

The application does not run and the data is not retrieved
1 from the server. What should be the possible problem with
3 the code? 1,The return type of the function is priva

Larry Williams is working as a network administrator with


SmartLabs. All the sales persons working in the company
wants to communicate with each other. Larry needs to
establish a connection among the sales persons through
mobile devices so that they can retrieve information from
each other. Larry uses GCF for setting up a serial port
1 connection among different mobile devices. . What code
4 snippet should Larry write to perform the task? 1,Connection cc = Connector.open(“data
Ken Burton is working as a network administrator with
SuperGraphics. Ken has been assigned the task of
establishing a stream-based socket connection to enable
the employees of the company to communicate and
exchange data with each other. Ken used GCF for setting
up connection among different mobile devices. The
connector class GCF uses the open() method that specifies
the type of network connection. Ken uses the following
code snippet to establish the connection:

Connection dc = Connector.open(“datagram://:9000”);

1,Ken needs to replace the code with the

1 However, when Ken runs the code, connection is not Connection cc =


5 established. What should Ken do to solve the problem? Connection.open(“socket://localhost:900
Tom Wilkins is working as mobile application developer
with Technology Systems. The management asks Tom to
develop a mobile application for the employees of AB
Corp., a software firm. The Technical executives of AB
Corp. working at the client sites need to access the
centralized database of the organization to display and
modify the products details. Tom needs to develop a
mobile application to enable the executives of AB Corp. to 1,Use Generic Connection Framework to
access the centralized database through their cell phones. centralized database and use the followi
In addition, Jim needs to ensure that the executives are open() method to access Web pages:
able to access the Web site, softwareproducts.com, of AB
1 Corp. from their cell phones to provide stock details to their Connection hc =
6 clients. What does Tom do to perform the required tasks? Connection.open(www.softwareproducts
Chris Donaldson is working as mobile application developer
with SuperGraphics. The management asks Chris to
develop a game application for a mobile device and also
enable the application to connect to Internet and access
Web pages. Chris needs to draw graphical objects for
developing the user interface of a two dimensional video
game. Jim creates the template for drawing the images on
the display screen of a mobile device. Jim needs to use the
methods provided by MIDP APIs to draw the images on the
1 template. What should Jim do to perform the required 1,Use the javax.microedition.lcdui and t
7 tasks? javax.microedition.io package.
Larry Williams is working as a software developer with
InfoSuper Corp., which develops applications for mobile
devices. The management asks Larry to create a
application for mobile phones that enables the sales
executives of an Insurance company, AB Corp. to access
the centralized database. The policy details of the company
organization, such as life-insurance policy details are
placed at the centralized database at the main office of the
organization company, in Atlanta. For this, Larry needs to
create a network connection to enable the mobile
application to connect to the database by using sockets.
For security reasons, Larry needs to ensure that the
connection to the database is made only for a specified
time and InterruptedIOException is displayed when the
1 connection time exceeds the specified limit. What does 1,Use the open() method to create an HT
8 Larry do to perform the required tasks? and the Throwable class.
Jerry Smith is working as a software developer with
BlueMoon computers, which provides wireless services to
its customers. The management asks Jerry to develop a
mobile application for mobile phones that provides Web
services to the users, such as News. For this, Jerry writes
the following code to open an HTTP based network
connection:

mHttpConnection.setRequestMethod(HttpConnection.POST
);

mHttpConnection.setRequestProperty("Content-Type",
"text/plain");

mHttpConnection.setRequestProperty("Accept", "*/*");

mHttpConnection.setRequestProperty("Connection",
"close");

OutputStream os = mHttpConnection.openOutputStream();

String requestString = makeRequestString();

System.out.println("\n\nOut

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
<<<<<<<<<<<<<<<<<<<<<<<<<<<");

os.write((requestString+"\r\n").getBytes());

os.flush();

if (os != null)

os.close();

1,Jerry includes the following code to ma


mIn = mHttpConnection.openInputStream();

int len = (int)mHttpConnection.getLength();


mHttpConnection = (HttpConnection)Co
1 However, the application does not provide Web services.
9 What does Jerry do to solve the problem? Connector.READ_WRITE,True);
Steve Irving is working as a programmer in the application
development department of Red Sky IT Systems. Steve
develops mobile applications by using J2ME platform. Steve
has been asked to develop a mobile application, which can
provide Web services to the users. For this, Steve writes a
code to close the network connection:

try {
1,Write the following code:
mHttpConnection.close // Close any open stream
try {
}
mHttpConnection.close // Close any ope
catch (IOException ) {
}
// Handle the exception
catch (IOException ioe) {
}
// Handle the exception
2 However, Steve is not able to close a network connection.
0 What should Steve do to solve the problem? }

Diane Frye is a mobile application developer with


SmartLabs. Diane is developing MIDlet applications that
can connect to the remote server and help in transmitting
the data with the remote server, over the network. Diane
needs to implement security in the application so that the
users can transmit data over the network without any
security threats. Therefore, She decides to implement
security features in the application that provides data
encryption, source authentication, and data integrity.
2 Which of the following application level security techniques
1 should Diane use in the application? 1,Permissions and security policy
Jim Lewis is working as an assistant software developer
with Technology Systems. Jim develops a J2ME application
for the mobile devices. Jim needs to secure the mobile
application to ensure that the users can connect to remote
servers without any security threats, such as password
hacking and packet sniffing. For this, Jim decides to sign
the MIDlet suite by adding digital signature and signer
certificate of a JAR file to a JAD file. Jim decides to perform
the following steps to sign the MIDlet suite:

Create a certificate

Create the signature and apply it to JAD


1,Jim needs to perform the following ste
Insert the certificate in the JAD
Create a certificate
Verify the signer certificate
Insert the certificate in the JAD
Verify the MIDlet suite JAR
Create the signature and apply it to JAD
Authenticate a MIDlet suite
Authenticate a MIDlet suite
However, Pat, a MIDP developer notices that the steps
identified by Jim to sign the MIDlet suite are not correct and Verify the signer certificate
2 will not lead to the required result. What should Jim do to
2 solve the problem? Verify the MIDlet suite JAR
Donna Davidson is working as a software developer with
Super Software Inc. Donna is developing a MIDP
application. To secure the MIDlet suites from unauthorized
access and malicious attacks, Donna decides to sign the
MIDLet suite by adding digital signature and signer
certificate of a JAR file to a JAD file. Donna needs to insert
the certificate in the JAD after creating it to sign the MIDLet
suite. Donna writes the following code to perform the task:

MIDlet Certificate <n> m>: base64 encoding of a


certificate

1,Donna needs to replace the code with


of code:
However, Donna notices that code has some error in it
2 because of which she is not able to insert certificate in the MIDlet-Certificate <n> <m>: <base64 e
3 JAD. What should Donna do to solve the problem? certificate>;
2 Larry Williams is working as a software developer with 1,Use the openDataInputStream () meth
4 Super Software Inc. Larry is developing a J2ME application openByteArray () method.
for mobile devices. Larry needs to secure the network
traffic of the mobile application by encrypting the data
before sending the data to the server. Larry writes the
following code snippet to perform the task:

void getViaHttpsConnection(String url)

throws IOException {

HttpsConnection hc = null;

InputStream ios = null;

try {

hc = (HttpsConnection)Connector.open(url);

ios = hc.openDataOutputStream();

if hc.getResponseCode() ==
HttpConnection.HTTP_OK) {

int length = (int)hc.getLength();

if (length < 0) {

byte[] data = new byte[length];

int len = is.readFully(data);

...

} else {

int ch1;

while ((ch1 = is.read()) != -1) {

...

} else {

...

}
} finally {

if (ios = null)

ios.close();

if (hc = null)

hc.close();

However, Larry notices that the code snippet is not running


properly and has various errors in it. What should Larry do
to solve the problem?

Jim Lewis is working as a software developer at InfoSuper


Corp. Jim has been assigned the task to develop a car
racing game. To create game sounds, Jim needs Mobile
Media API. Which of the following interface of MMAPI should
2 Jim implement to control the media playback capabilities of
5 the player? 1,Implement the Control Interface
Christine Turner is working as a mobile application
developer at SuperGraphics. The management asks
Christine to develop a mobile Jukebox application, which
enables the users to play various types of sound file
formats, such as MP3. To develop the application, Christine
uses MMAPI to create the multimedia content on a mobile
device. Christine needs to implement an interface in the
application that enables mobile users to control the
features of multimedia content, such as volume and
2 tempo, on mobile devices. Which of the following interface
6 should Christine implement to perform the required task? 1,The PlayerListener interface

Larry Williams is working as a mobile application developer


at Supersoft2000. The management asks Larry to develop
a Jukebox application for mobile device. Larry uses the
Data Source class to create and retrieve the sources of
multimedia such as, file, and network server. Which of the
2 following methods of the Data Source class enables Larry
7 to transfer data from a network server? 1, The connect() method
Pat Greene is working as a software developer at BlueMoon
Computers. The management asks Pat to develop a mobile
application using MMAPI package. The application should
generate the ring tones without creating the Player objects
on the mobile device. For this, Pat uses the playTone
method () and now, Pat needs to specify the tone to be
2 played by the playTone method (). Which parameter will
8 Pat use to perform the task? 1,Use the note parameter

Consider the Statements:

Statement A: The getSupportedContentTypes method is


used to return the list of multimedia content types,
identifying the type of media data, such as MP3 audio
files,supported by a specified protocol.

Statement B: The getSystemTimeBase () method is used to


return an object of the TimeBase interface.

2 Which of the following is True, with respect to the above


9 Statements? 1,Statement A is True and Statement B i

Anne Johnson is working as a software developer at Safest


Software Inc. Anne is developing a messaging application
for mobile devices. Anne needs to notify the messaging
3 application about the receipt of the messages. Which
0 interface should Anne implement to perform the task? 1,Message
Steve Irvin is working as a J2ME programmer at Red Eye
Experts. The organization receives a project for developing
a mobile application. Steve is assigned the task to develop
a messaging application for mobile devices. To develop the
application, Steve needs to define the methods that
provide the basic functionality for sending and receiving
3 messages. Which interface should Steve implement to
1 perform the task? 1,TextMessage

Pat Wilkins is working as a MIDP developer at Technology


systems Inc. Pat is developing a messaging application for
mobile devices. However, Pat notices that while sending
messages over the network, messaging application is
3 throwing IllegalArgumentException. What could be the 1,The connection with the specified mob
2 possible reason? be established.

Corrine Wallace is working as a MIDP developer in Super


Software Inc. Corrine is developing a messaging application
for mobile devices. While developing the application, which
3 class Corrine should use to represent the message and its
3 content in the messaging application? 1,Message
Anne Johnson is working as a MIDP developer at
Technology Systems Inc. Anne is developing a messaging
application for mobile devices. However, Anne notices that
while sending messages over the network, the messaging
3 application is throwing InterruptedIOException. What could 1,The receive() method is closed while re
4 be the reason of the problem? message.

Jerry Smith is working as a mobile application developer


with Safest Software Co. Jerry is assigned the task to study
about the new features of a mobile device and the
technology associated with it. Therefore, Jerry started his
research on MMAPI, which is the latest technology and
supports capturing and storing of multimedia content in
the mobile devices. Jerry studied that the videos can be
seen with special control interfaces, such as VideoControl
and VolumeControl using MMAPI technology. Jerry also
determines that using this technology, mobile users can
also take a picture on the viewfinder and save those
3 picture in a special format. Which of the following format is
5 used for saving these pictures of viewfinder? 1,bmp (bitmap)
Christine Turner is working as a mobile application
developer with Blue Moon Computers. Christine is working
on a project with her team to develop an application to 1,Christine needs to replace the code sn
create a player object, which plays the multimedia files following code snippet:
3 specified by a DataSource object. What code snippet
6 should Christine write to perform the required task? static Player createPlayer(DataSource D

Jim Lewis is working as a mobile application developer with


Certified Carriers. Jim is developing an application for
generating tones on a mobile device. For this purpose, Jim
uses the playTone() method of the Manager class. Jim uses
the following code snippet to generate tones:

playTone(30, 100, 50)

But the above method throws an exception


3 “MediaException”. What is the possible cause of this 1,The mobile device is not able to play t
7 exception? due to some hardware error.
John Barrett is working as a mobile application developer
with Quality Software. John is working on a project given by
a client of Quality Software. In this project, John needs to
create a Player object to play the multimedia files. John
uses the Manager class, class to create the Player objects.
The network location of the multimedia file is specified
using the URI locator string, LOCATION. John writes the
following code snippet for the client to perform the desired
function:

static Player CreatePlayer(LOCATION) 1,Tom needs to replace the code snippe


following code snippet:
3 John notices that the code is not running properly. What
8 should John do to get the desired output? static Player createPlayer(LOCATION)
Tom Wilkins is working as a mobile application developer
with Red Sky IT Systems. Tom needs to generate tones on
a mobile device. He decides to play the series of tones by
calling the playTone() method in a loop. Tom writes the
following code snippet to perform the task: 1,Tom needs to replace the code snippe
following code snippet:
for(int counter=0; counter> 100; counter.++){

int NOTE= (int) (System.currentTimeMillis() % 127);


for(int counter=0; counter< 100; counte
Manager.playTone(NOTE, 100);
int NOTE= (int) (System.currentTimeMi
//Move the clock forward
Manager.playTone(NOTE, 100, 100);
Thread.currentThread().sleep(10);
//Move the clock forward
}
Thread.currentThread().sleep(10);
3 However, Tom notices that code is not running properly. .
9 What should Tom do to solve the problem? }

Corrine Wallace is working as a mobile application


developer with Quality Software Developers. Corrine is
assigned a task to create a connection between the client
and server using Connector.open () method for the
message application. After creating the connection, Corrine
wants to send the created message using send() method of
the MessageConnection interface. However, when Corrine
tries to send the message an exception occur as
4 SecurityException by the send() method. What may be the 1,The specified protocol is not allowed to
0 probable cause of problem? messaging.
Donna Brad is working as a mobile application developer
with Safest Software Co. She has been assigned the task of
developing application for establishing the message
connection between two mobile devices. To perform this
task, Donna is using the MessageConnection interface,
which is used for sending and receiving messages and
creating Message objects. Donna is using all the methods
of MessageConnection interface in her program to establish
a proper connection among messages. However while
processing, the application gets blocked at the receiver
end until it receives a message. Which method should
4 Donna use to listen the incoming messages through the
1 separate listener object? 1,IncomingMessage()
Christine Turner is working as a mobile application
developer with Blue Moon Computers. Christine is working
on a project to develop a message system for mobile
devices. She needs to create and send a message by
creating an object of the TextMessage interface of WMA.
Christine types the following code snippet for this purpose:

private void sendTextMessage(MessageConnection cn,


String

message, String URL)

try{

TextMessage tms =

(TextMessage)cn.newMessage

(MessageConnection.TEXT_MESSAGE);

if (URL!= null)

tms.setAddress(URL);

tms.setPayloadText(message);

cn.send(tmsg);

catch(Exception e) {

System.out.println("sendTextMessage " + e);

However, Christine finds that the program failed to send


4 the message to the destined URL. What may be the cause 1,The If Statement with URL(null) doest
2 of the problem? sendTextMessage() method.
Ronald Billing is working as a mobile application developer
with Blue Moon Computers. Ronald is assigned the task of
creating a connection with the server to receive incoming
messages from the specified port of the mobile device. To
perform this task, Ronald needs to specify the address of
the destination mobile device, which receives a message,
in the Connector.open () method. Which address format
4 should Ronald use with Connector.open() method to
3 perform the above task? 1,sms://PHONENO:PORT

John Barrett is working as mobile application developer


with Exploration Air. John is assigned a task to create a
connection between the client and server using
Connector.open () method for the SMS application. After
creating the connection, John wants to send the created
message using the send() method of the
MessageConnection interface. However, when John tries to
send the message an exception occur as IOException by
4 the send() method. What may be the probable cause of
4 problem? 1,The network or connection is not avail
Donna Johnson is working as a mobile application
developer at Global System. The organization uses J2ME
platform for developing mobile applications. The Company
wants to develop a mobile jukebox application, which
enables the users to play various types of sound file
formats. Donna has been assigned the task of playing a
sound file with MP3 extension. Donna uses the following
code snippet to perform the task:

Player mp3player;

VolumeControl vcontrol; 1,Donna needs to implement the followin

try { Player mp3player;

mp3player = VolumeControl vcontrol;


Manager.createPlayer("http://server/music.wav");
try {
mp3player.realize();
mp3player =
// get volume control for player and set volume to half Manager.createPlayer("http://server/mus
max value
mp3player.realize();
vcontrol = (VolumeControl)
mp3player.getControl("VolumeControl"); // get volume control for player and se
max value
if(vcontrol != null) {
vcontrol = (VolumeControl)
vcontrol.setVolume(50); mp3player.getControl("VolumeControl")

} if(vcontrol != null) {

// start the player vcontrol.setVolume(50);

mp3player.start(); }

} // start the player

catch(IOException IOex) { mp3player.start();

} }

catch(MediaException ex) { catch(IOException IOex) {

} }

However, Donna notices that code snippet is not running catch(MediaException ex) {
4 properly and has many errors in it. What should Donna do
5 to solve the problem? }
John Edwin is working as a mobile application developer at
Global System. The organization uses J2ME platform for
developing mobile applications. Technology Systems is a
client of Global Systems Inc., which manufactures mobile
phones.

Technology System has asked Global Systems Inc. to


develop a mobile jukebox application, which enables the
users to play various types of sound file formats. John has
been assigned the task of playing a sound file with the
WAV extension. John uses the following code snippet to
perform the task:

int id;

// play back from a record store 1,John needs to implement the following

try { int id;

InputStream istream = // play back from a record store


getClass().getResourceAsStream("audio.wav");
try {
Player WAVplayer = Manager.createPlayer(is, "audio/ midi
"); InputStream istream =
getClass().getResourceAsStream("audio
WAVplayer.start();
Player WAVplayer = Manager.createPlay
} wav");

catch (IOException ioe) { WAVplayer.start();

} }

catch (MediaException me) { catch (IOException ioe) {

} }

However, John notices that code snippet is not running catch (MediaException me) {
4 properly and has many errors in it. What should John do to
6 solve the problem? }
Jim Lewis is working as an assistant software developer at
Technology Systems. The organization asks Jim to develop
a mobile jukebox application, which enables the users to
play various types of sound file formats. Jim has been
assigned the task of playing a sound file with MIDI
extension. Jim uses the following code snippet to perform
the task:

int id;
1,Jim needs to implement the following c
// play back from a record store
int id;
try {
// play back from a record store
InputStream istream=
getClass().getResourceAsStream("audio.wav"); try {

Player midiplayer = Manager.createPlayer(is, "audio/midi"); InputStream istream =


getClass().getResourceAsStream("audio
midiplayer.start();
Player WAVplayer = Manager.createPlay
} wav");

catch (IOException ioe) { WAVplayer.start();

} }

catch (MediaException me) { catch (IOException ioe) {

} }

However, Jim notices that code snippet is not running catch (MediaException me) {
4 properly and has many errors in it. What should Jim do to
7 solve the problem? }
Steve Irving is working as a mobile application developer at
Blue Moon Computers. The organization uses J2ME platform
for developing mobile applications. The business manager
of the company asks Steve to develop a media player,
which plays different sounds. Steve uses the following code
snippet to perform the task:

InputStream is =

new ByteArrayInputStream( 1,Steve needs to implement the followin

myRecordStore.getRecord(id)); InputStream is =

Player player = Manager.createPlayer( new ByteArrayInputStream(

is, "audio/mpeg"); myRecordStore.getRecord(id));

player.stop(); Player player = Manager.createPlayer(

However, Steve notices that code snippet is not running is, "audio/mpeg");
4 properly and has many errors in it. What should Steve do
8 to solve the problem? player. start();
Lee Johnson is working as a mobile application developer at
Red Sky Experts. The organization uses J2ME platform for
developing mobile applications. Lee is assigned the task of
creating a tone player and provides controls to handle the
tones of the player. Lee uses the following code snippet to
perform the task:

tonePlayer =
Manager.createPlayer(Manager.TONE_DEVICE_LOCATOR); 1,Lee needs to implement the following

tonePlayer.setLoopCount(1); // Loop only once tonePlayer =


Manager.createPlayer(Manager.TONE_D
tonePlayer.stop();
tonePlayer.setLoopCount(1);
ToneControl tc = once
(ToneControl)tonePlayer.getControl("javax.microedition.me
dia.control.ToneControl"); tonePlayer. close();

However, Lee notices that code snippet is not running ToneControl tc =


4 properly and has many errors in it. What should Lee do to (ToneControl)tonePlayer.getControl("jav
9 solve the problem? media.control.ToneControl");

Bob Edwin is an application developer at Deez Inc. Bob is


developing a gaming application using graphical objects on
canvas layer. Now, Bob wants to place the new canvas
layer behind all the existing canvas layers in a gaming
5 application. Which method should Bob use to perform the
0 above task? 1,Insert()
Donna Johnson is an Application Developer at Global Inc.
Donna is developing a gaming application using graphical
objects on Canvas layer. While developing application,
Donna wants to retrieve the number of layers in the
5 LayerManager class. Which method should Donna use to
1 perform the above task? 1,getLayerAt(int index)

John Beret is working as a software developer at Red Eye


Experts. John has been assigned the task of developing a
Bike Racing game application. John wants to enable users
to control the movement of the bike using the right and left
5 arrow keys on the mobile device. Which class should John
2 use to design the gaming application? 1,LayerManager

Steve is working as a Wireless Developer at Sky Blue


service provider. Steve is assigned a task to develop a
gaming application using J2ME. To develop this gaming
application, Steve needs to draw a TiledLayer object in
5 TiledLayer class. Which method should Steve use to
3 perform the above task? 1,int createAnimatedTile()

Chris is working as a MIDP UI designer at Technology


Systems. Chris has been assigned the task to create a
mobile gaming application, which displays a background
5 image on the screen of a mobile device. Which class should
4 Chris use to develop the gaming application? 1,GameCanvas class
Consider the Statements:

Statement A: The void setImage() method modifies the


graphical objects containing the frames of the Sprite
object.

Statement B: The void setFrame() method selects the


current frame in the frame sequence.

5 Which of the following is True, with respect to the above


5 Statements? 1,Statement A is True and Statement B i

Ron Floyd is an application developer at Global Inc. Ron is


developing an animated gaming application in J2ME.
Therefore, Ron uses a Sprite class that represents
graphical objects displayed on the screen of a mobile
device. While developing the gaming application, Ron
needs to draw a Sprite object to create animation in the
5 gaming application. Which method should Donna call to
6 perform the above task? 1,void setTransform(int transform)

Mary Peterson is working as a software developer at


SuperSofware 2002 Inc. Mary has been assigned the task
of developing a gaming application that displays various
rotating graphical objects for the mobile devices. The
graphical objects are larger than the screen of the mobile
device. Therefore, she decides to set a view window that
displays all the sections of the graphical object on the
5 screen of the mobile device. Which class should Mary use
7 to perform the task? 1,Layer
Global System Inc. is a software development organization
in Washington. The organization asks Donna, a UI designer
and programmer to develop a gaming application. Donna
needs to rotate graphical objects about a point to create
5 animation effects in the game. Which method of the Sprite
8 class should Donna use to perform the task? 1,Sprite.setTransform()

Tom Wilkins is working as a mobile application developer in


Technology Systems Inc. Tom has been assigned the task
of developing a MIDP gaming application. Tom needs to
5 create flicker-free animation effects in the game. Which
9 class should Tom use to develop the gaming application? 1,Layer
Chris Donaldson is working as a mobile application
developer at Technology Systems, which develops software
for mobile devices. The management asks Chris to develop
a two-dimensional game application for mobile phones.
Chris wants to create the animation effect in the gaming
application on the basis of the user input. Therefore, he
wants the application to access the state of left and right
arrow keys of the mobile device. In addition, Chris needs to
control the movement of graphic objects, such as trees and
buildings. Which classes will Chris use to perform the tasks 1,Use the LayerManager class to create
and what method will Chris use to enable the gaming based on user input and use the Sprite c
6 application to access the state of a left and right arrow graphical objects. Use the getKeyStates
0 keys? enable an application to access the state
Jim Lewis is working as a software developer at
SuperGraphics, which develops software for mobile
applications. The management asks Jim to develop a
gaming application for mobile phones. For this, Jim decides
to use the off-screen buffer to separately draw graphical
objects, such as vehicles, buildings and then combine and
display these graphical objects on the screen of a mobile
device at a time. Jim writes the following code to perform
the required task:

public void run() {

Graphics g = getGraphics();

while (play) {

try {

// First draw all the layers

layers.paint(g, 0, 0);

// If the game is on, flush the graphics

if (play) {

getKeyStates();

try {

mythread.sleep(sleepTime);

} catch (java.lang.InterruptedException e) {}

} catch (Exception e) {

e.printStackTrace();

However, the off-screen buffer does not work. What could 1,Jim uses GameCanvas class. Implemen
6 be the possible reason and which class of MIDP Game API flushgraphics () method instead of getke
1 does Jim use to perform the required task? the off-screen buffer to work.
Larry Williams is working as a software developer at
BlueMoon Computers. Larry needs to make a gaming
application for mobile devices. Larry uses GameCanvas
class to create a game User Interface. The gaming
application also requires displaying graphic objects, such
as street, trees. For this, Larry uses the Layer class. Larry
needs to set the visibility of background layer. Jim also 1,Implement the boolean isVisible metho
6 needs to paint a layer on the screen if a layer is visible. visibility of layer and Void setPosition me
2 What methods will Larry use to perform the tasks? layer

Pat Greene is working as a software developer at


Technology Systems. Pat is developing a gaming
application of a Bike Racing game. Pat uses the
LayerManager class to manage the layers, such as
background layer. Pat inserts a new layer to include a new
vehicle graphic object on the screen at a specific index.
However, Pat realizes that a tree object needs to be
6 included in the background layer instead of vehicle object. 1,Use the void insert method to insert a
3 What methods does Pat use to perform the required tasks? Use the void remove method to remove
Jim Lewis is working as a wireless developer at Technology
Systems. The management asks Jim to create a gaming
application for its existing customers. Jim needs to create a
background of the screen of the gaming application. For
this, Jim decides to use a graphic object in the form of grid
of cells to create a scrolling background. Jim loads the
graphic object into a tiled layer class using the following
code:

bkgrndImage = Image.createImage("bkgnd.png");
1,Use the following code:
int rows = getHeight() / 16;
Image bkgrndImage = Image.createIma
int cols = getWidth() / 16;
int rows = getHeight() / 16;
TiledLayer bkgnd =
int cols = getWidth() / 16;
new TiledLayer(cols, rows, bkgrndImage, 16, 16);
TiledLayer bkgnd =
6 However, Jim is not able to create the background screen.
4 What should Jim do to perform the required task? new TiledLayer(cols, rows, bkgrndIma
Donna Johnson is working as a mobile application
developer at Global System. The organization uses J2ME
platform for developing gaming applications. The
management asks Donna to develop a Bike racing game
application with animation effects. Donna creates graphic
objects, such as trees, vehicles to be displayed on the
screen of the gaming application. Donna uses the Sprites
class to represent the graphic objects on the screen of the 1,Write the following code to retrieve the
mobile device and divides the images in frames of equal frames:
height and width to create the animation effect. Now, she
needs to retrieve the number of frames in the graphic
objects to manage the sequence of frames. In addition,
Donna needs to define a section of area where the collision public int getRawFrameCount()
of graphic objects can be detected to improve the
6 animation effects. What should Donna do to perform the and use the Void defineCollisionRectang
5 required tasks? width, int height) method.
Pat Wilkins is working as a software developer at
Technology Systems Inc. The organization receives a
project of developing a J2ME application for mobile devices.
Pat is assigned the task of creating a gaming application
for a mobile device. Pat needs to provide flicker-free
display on the screen of the mobile device. Therefore, Pat
decides to implement the off-screen buffer. Pat writes the
following code snippet to implement the off-screen buffer:
1,Pat needs to replace the code snippet
code snippet:

public void run() { public void run() {

Graphics g = getGraphics(); Graphics g = getGraphics();

while (play) { while (play) {

try { try {

layers.paint(g, 0, 0); layers.paint(g, 0, 0);

if (play) {

flushGraphics();

try { }

mythread.sleep(sleepTime);

} catch (java.lang.InterruptedException e) {} try {

mythread.sleep(sleepTime);

} catch (Exception e) { } catch (java.lang.InterruptedExcept

e.printStackTrace();

} } catch (Exception e) {

} e.printStackTrace();

} }

However, Pat notices that the code is not running properly }


6 and has many errors in it. What should Pat do to solve the
6 problem? }
6 Jim Lewis is working as a software developer at Technology 1,Use the getGraphics method() instead
7 Systems. The management asks Jim to create a car racing method and use the Void setPosition(int
game application. For this, Jim uses GameCanvas class to
create animation effects based on the user input. Jim needs
to ensure that the animations created on the screen are
flicker-free. For this Jim creates an offscreen buffer using
the following code:

public void run() {

Graphics g = flushgraphics();

while (play) {

try {

// First draw all the layers

layers.paint(g, 0, 0);

// If the game is on, flush the graphics

if (play) {

flushGraphics();

try {

mythread.sleep(sleepTime);

} catch (java.lang.InterruptedException e) {}

} catch (Exception e) {

e.printStackTrace();

In addition, Jim needs to place a new layer of graphic


objects behind the existing layers in a gaming application
to create animation effect. For this, Jim needs to determine
a position of layer. Which methods will Jim use to perform
the required tasks?
Christine Turner works as a software programmer with
SmartLabs. Christine has been assigned the task to create
a MIDlet gaming application for a mobile device. Christine
needs to display a graphical object as the background of
the screen of the mobile device. She needs to create large
scrolling backgrounds in games. To perform the required
task, Christine creates the following code snippet:

Image bkgrndImage = Image.createImage("/bkgnd.png");


1,Christine needs to replace the existing
int rows = getHeight() / 16; following code:

int cols = getWidth() / 16;

LayerManager bkgnd = Image bkgrndImage =


Image.createImage("/bkgnd.png");
new LayerManager (cols, rows, bkgrndImage, 16, 16);
int rows = getHeight() / 16;
display
int cols = getWidth() / 16;
Christine executes the code. However, some error is
6 displayed. what should Christine do to resolve the Layer bkgnd = new Layer(cols, rows, bkg
8 problem? 16);
John Beret works as a software programmer at Technology
Systems. John has been assigned the task to create a
MIDlet gaming application for a mobile device. John needs
to display an animation that displays several frames in his
game. He decides to use Sprite class for creating
animation. John creates the following constructor for the
Sprite class:

1,John needs to replace the existing cod


following code:
public Sprite(Image[] img, int xPos, int yPos, int xVel, int
yVel, int z, int wBnds, int hBnds, int ba)

{ public Sprite(Image img, int f, int fi, int f


yPos, int xVel, int yVel, int z, int wBnds,
image = img;
{
setPosition(xPos,yPos);
image = img;
width = img[f].getWidth();
setPosition(xPos,yPos);
height = img[f].getHeight();
width = img[f].getWidth();
setVelocity(xVel,yVel);
height = img[f].getHeight();
frame f;
setVelocity(xVel,yVel);
frameInc=fi;
frame f;
frameDelay = frameTrigger = fd;
frameInc=fi;
zOrder = z;
frameDelay = frameTrigger = fd;
xBounds = 0;
zOrder = z;
yBounds = 0;
xBounds = 0;
wBounds = wBnds;
yBounds = 0;
hBounds= hBnds;
wBounds = wBnds;
boundsAction=ba;
hBounds= hBnds;
}
boundsAction=ba;
6 John executes the code. However, some error is displayed.
9 What should John do to resolve the problem? }
Diane Frye is a mobile application developer at SmartLabs
and is developing MIDlet applications. Diane has
implemented off-screen buffer in the MIdlet to provide a
flicker free display on the screen of the mobile device.
Therefore, to display the animation effect on the screen of
the mobile device, Diane needs to access the off-screen
buffer. Diane writes the following code snippet to perform
the task:

public void run() {


1,Diane needs to replace the code snipp
Graphics g = flushGraphics(); following code snippet:

while (play) { public void run() {

try { Graphics g = getGraphics();

layers.paint(g, 0, 0); while (play) {

try {

if (play) { paint(g, 0, 0);

getGraphics();

} if (play) {

flushGraphics();

try { }

mythread.sleep();

} catch (java.lang.InterruptedException e) {} try {

mythread.sleep();

} catch (Exception e) { } catch (java.lang.InterruptedExcept

e.printStackTrace();

} } catch (Exception e) {

} e.printStackTrace();

However, Diane notices that code is not running properly }


7 and has many errors in it. What should Diane do to perform
0 the task? }
Jim Lewis is working as an assistant software developer at
Technology Systems. The organization receives a project of
developing a J2ME application for the mobile devices. Jim is
assigned the task of developing the gaming applications
for the mobile device. In the gaming application, Jim needs
to display the graphic objects in the background of the
screen of a mobile device. Jim writes the following code
snippet to perform the task:

Image bkgrndImage = Image.createImage("/bkgnd.png");

int rows = getHeight() / 16;

int cols = getWidth() / 16;

LayerManager bkgnd =

new LayerManager(cols, rows, bkgrndImage, 16, 16);

7 However, Jim notices that code snippet is not producing 1,Jim needs to implement the Layer clas
1 required results. What should Jim do to solve the problem? LayerManager class.
Donna Davidson is working as a software developer at
Super Software Inc. Red Eye Experts has assigned the
organization a project of developing a MIDP application.
The organization assigns Donna the task of creating a
gaming application for the MIDlet. While creating the
gaming application, Donna needs to perform the following
tasks:

Keep track of all the graphic objects that are added or


removed from the gaming application

Create a graphic object that is larger than the size of the


screen of a mobile device.

View the specific sections of a graphic object on the screen


of a mobile device, if the graphic object is larger than the
size of the screen

Place a new graphic object behind all the existing graphic


objects in the gaming application.
7
2 What should Donna do to perform the tasks? 1,Donna should implement the Layer cla
Ed Young is working as a software developer at Super
Software Inc. Ed is developing a gaming application for the
mobile devices. Ed needs to create the animation effect in
the gaming application on the basis of user input. To
control the animation effects in a game, the gaming
application needs to have instant access to the current
state of a key of a mobile device. Ed writes the following
code snippet to enable the gaming application to access
the state of a key:

int keyState = getKeyState(); 1,Ed needs to replace the code snippet w


code snippet:

int keyState = getKeyStates();


if ((keyState | LEFT_PRESSED) != 0) {

System.out.println("You have pressed Left Key");


if ((keyState && LEFT_PRESSED) != 0) {
}
System.out.println("You have pressed L
if ((keyState | RIGHT_PRESSED) != 0) {
}
System.out.println("You have pressed Right Key");
if ((keyState && RIGHT_PRESSED) != 0)
}
System.out.println("You have pressed R
7 Ed notices that code is not running properly and has many
3 errors in it. What should Ed do to solve the problem? }
Corrine Wallace is working as a software developer at
Super Software Inc. Corrine is developing a gaming
application for the mobile devices. Corrine needs to create
animation effect in the gaming application. To create the
animation effect, Corrine needs to perform the following
tasks:

Retrieve the number of frames in a graphic object to


manage the sequence of the frames.

Display a sequence of frames containing different parts of


a graphic object on the screen of the mobile device.

Verify whether a frame has collided with a TiledLayer


object.

Flip and rotate the parts of the graphics object.


7
4 What should Corrine do to perform the task? 1,Corrine needs to implement the Layer

Bob Edwin is an application developer at Deez Inc. Bob has


developed a MIDlet application for the mobile devices.
When the MIDlet application is downloaded on a mobile
device, the mobile device sends a report of unsuccessful
7 installation of MIDlet with status code of 901.What could be
5 the cause of the problem? 1,Loss of service
Donna Johnson is an application developer at Global Inc.
Donna has developed a MIDlet application. When the
MIDlet application is downloaded on a mobile device, the
mobile device sends a report of unsuccessful installation of
7 MIDlet with status code of 905.What may be the cause of
6 the problem? 1,Loss of service

Mary Peterson is working as a UI designer and programmer


at SuperSoftware 2002 Inc. Mary has been assigned the
task of developing a J2ME application for mobile devices.
Mary wants that the application inform users about a
specific event, such as birthdays at a particular time and
7 date. Which method should Mary implement to develop the
7 application? 1,registerAlarm()

John David is an application developer at Safest Software.


John has developed a MIDlet application. When the MIDlet
application is downloaded on a mobile device, the mobile
device sends a report of unsuccessful installation of MIDlet
7 with status code of 904.What may be the cause of the
8 problem? 1,Represents an invalid JAD file

Pat Wilkins is an application developer at Global Inc. Pat


has developed a MIDlet application. When the MIDlet
application is downloaded on a mobile device, the mobile
device sends a report of unsuccessful installation of MIDlet
7 with status code of 907.What could be the cause of the
9 problem? 1,Represents an invalid JAD file
Donna Johnson is working as an application developer at
with Safest Software. The company organization has
launched a new mobile device. Therefore, the business
manager of the company organization asks Donna to
developed a J2ME application for the newly launched
mobile device. The business manager also wants that the
application should provide some services and content that
can be downloaded over different types of wireless
8 network, such as GSM and CDMA. Which feature of J2ME is
0 used to develop such an application? 1,Enhanced User Interface

Jim is a mobile application developer, working with Red-Eye


Experts Inc. Jim needs to develop a mobile application for
J2ME enabled mobile device. In the application Jim needs to
provide facility so that the users can download applications
and run them on the mobile device, without using a
browser to access an application. Which of the following
8 wireless technologies should Jim use in the application to
1 perform the above-mentioned task? 1,GPRS
Diane Frye, the mobile application developer with Blue
Moon Computers, is developing a mobile application for
J2ME enabled mobile device. Jim needs to develop the
application in such a way, that it provides enhance User
Interface (UI) and graphical capabilities in the mobile
8 devices. Which of the following package should Jim use
2 while developing the application? 1,javax.microedition.lcdui

Donna Bard is a mobile application developer, working with


Red-Eye Experts inc. Donna needs to develop a mobile
application for J2ME enabled mobile device that enables
mobile users to download video and music clips and access
8 the Internet. Which of the following wireless technologies
3 should Donna Bard use to perform the task? 1,GPRS

Consider the Statements:

Statement A: An applet is a Java class file embedded into


an HTML page.

Statement B: A MIDlet is a Java class file packaged into a


JAR file.

8 Which of the following is True, with respect to the above


4 Statements? 1,Statement A is True and Statement B i
Steve Irving is working as a programmer in the application
development department of Red Sky IT Systems. The job
profile requires Steve to develop mobile applications by
using J2ME platform. Steve Steve has been assigned the
task to develop a MIDlet application by using J2MEj2me
platform, to provide Web services to the users.. Steve
wants to deploy the MIDlet application on a Web server to
enable the users to download the application on a mobile
device. However, before deploying the application Steve
needs to test the application for a mobile device. To test
the application Steve wants to simulate the behavior of a
mobile device on his computer. Which tool should Steve
8 use to perform the required task and what should Steve do 1,Use the RAD tool and install JDK-j2sdk.
5 acquire the tool? computer
Ron Floyd is an application developer at with Global Inc.
The organization develops mobile applications by using
J2ME platform. The organization has developed a mobile
application, which can send and receive animated images
and access the data from the remote server. The mobile
application also has a facility to deliver textual and visual
information, such as sports scores, news headlines, and
weather information on the mobile device. Now,
organization Global Inc. decides to upgrade the mobile
application to support broader bandwidth and faster data
transfer in mobile devices. Ron is has been assigned the
task of upgrading the mobile application. The organization
asks Ron to provide features, which enables the mobile
users to download video and music clips and access high-
speed Internet in on the mobile device. Which technology
8 should Ron use to develop the mobile application with all
6 specified features? 1,General Packet Radio Service (GPRS)
Technology Systems Inc., a New York based company
organization, provides wireless services to its customers.
Jim Lewis is working as a mobile application developer in
with Technology Systems Inc. Jim develops a MIDlet
application and needs to test the MIDlet to ensure whether
the application is running properly. To test the MIDlet
application, Jim decides to install J2ME Wireless Toolkit on a
computer. However, when Jim tries to install the Wireless
Toolkit on the computer, he is not able to install it. He
ensures that the J2SE 1.5.0 SDK is already installed on the
computer. Jim informs John, the system administrator,
8 about the problem and asks him to resolve the problem.
7 What should John do to resolve the problem? 1,Update the PATH environment variable
Jim Lewis is working as a software developer at with Blue
Moon Computers. The organization receives a project of
developing a mobile application by using J2ME API. The
management of the organization assigns the task of 1,Jim needs to implement the MIDlet cla
developing the mobile application to Jim. . To develop the following structure:
mobile application, Jim needs to implement the MIDlet
class. To implement the MIDlet class, Jim needs to identify
the structure of the MIDlet class. Following is the structure
of the MIDLet class identified by Jim to perform the task: public class MyMIDlet extends MIDlet {

public class MyMIDlet extends MIDlet {

MIDlet( ) {

MIDlet( ) { }

} protected void startApp(boolean unco


throws MIDletStateChangedException {
protected void startApp( ) throws
MIDletStateChangedException { }

protected void pauseApp( ) {

protected void destroyApp(boolean unconditional) }

throws MIDletStateChangedException {

} protected void destroyApp(boolean un

} throws MIDletStateCh
{
However, Jim notices that the application, which is
developed by using this structure of the MIDlet class is not }
8 working properly and has many errors . What should Jim do
8 to solve the problem? }
Pat Wilkins is working as a software developer at with
Technology Systems Inc. Pat develops a mobile application
by using J2ME platform. The application enables mobile
users to download wireless application on mobile devices
and view information such as, news headlines and weather
reports. However, the management of the organization
notices that the bandwidth and quality of voice and text
transmission provided by the mobile application is low.
Therefore, organization asks Pat to upgrade the mobile
application. The organization also asks Pat to provide
advanced multimedia services, such as animated games in
8 the mobile application. Which technology should Pat use to
9 perform the task? 1,General Packet Radio Service (GPRS)

Global Systems Inc. is a software development company


organization in Texas. The management of the organization
decides to develop MIDP applications based on the J2ME
platform. However, management identifies that J2ME
architecture is designed for small devices, having limited
memory, such as mobile phones. What is the maximum
9 memory of the devices for which J2ME architecture is
0 designed? 1,1 MB
Pat Wilkins is working as J2ME programmer at with Red Eye
Experts. The organization asks Pat to develop a mobile
application. However, Pat identifies that to implement the
mobile application on the mobile device, the device should
be CLDC compatible. What should be the minimum volatile
9 memory for the virtual machine for a CLDC compliant
1 mobile device? 1,32 KB

Pat Wilkins is working as a MIDP developer at with


Technology systems Inc. Pat has been assigned the task to
develop a MIDlet application. To run the MIDlet application,
Pat needs to use resources, such as images or data files
stored in the JAR file. Therefore, he needs to gather
information about the contents of the JAR file. Which
9 component of the MIDlet suite should Pat should use to
2 perform the task? 1,Java Class Files

Corrine Wallace is working as MIDP developer in with Super


Software Inc. Corrine is developing a MIDlet application for
mobile devices. To run the MIDlet application, Corrine
needs to gather information about the contents of the JAR
file by using the manifest file. Corrine needs to specify the
name of the PNG file within the JAR file, which is used to
9 represent the MIDlet suite. Which MIDlet attributes of the
3 manifest file should Corrine use to perform the task? 1,MIDlet-Name
Anne Johnson is working as a software developer with Red
Eye Experts. Anne is developing a MIDlet application for
the mobile devices. Anne needs to use resources such as
image and data files stored in the JAR file to run the MIDlet
application. However, Anne identifies that the application
9 manager is not able to load the JAR file. What could be the 1,The MIDlet-<n> attributes is not speci
4 reason of the problem? manifest file.

Chris is working as a MIDP UI designer at with Technology


Systems Inc. The organization asks Chris to create a
registration form, which consists of text boxes and radio
buttons, to enable mobile users to fill their details on a
mobile device. Chris needs to create a graphical object to
display the list of radio buttons from which the user can
9 select an item. Which Item class should Chris use to
5 implement the list of radio buttons? 1,CustomItem

John Beret is working as a software developer at with Red


Eye Experts. John is developing a J2ME application for
mobile devices. The application enables mobile users to
enter new phone numbers in the memory of a mobile
9 device. Which Item class should John use to develop the
6 application? 1,ImageItem
Mary Peterson is working as a UI designer and programmer
at SuperSoftware 2002 Inc. Mary has been assigned the
task of creating a J2ME application for mobile devices. The
application should enable mobile users to compose a
message on the mobile device. Mary also wants that users
should be able to edit the text of a message by using the
9 keypad. Which class should Mary use to develop the
7 application? 1,Item class

Global System Inc. is a software development organization


in Washington. The organization launches a new mobile
device. The organization asks Donna, a UI designer and
programmer, to design an application to enable users to
9 set wallpapers on the screen of their mobile devices. Which
8 class should Donna use to develop the application? 1,ImageItem

Ronald Billing is working as a software developer at with


InfoSuper Inc. Ronald is developing a J2ME application for
mobile devices. Ronald needs to develop an application
that represents volume level or network availability in
9 mobile phones, in the form of a bar graph. Which class
9 should Ronald use to design the application? 1,ChoiceGroup
Jim Lewis is working as a software developer at with Global
Systems, Inc., which develops software for mobile devices.
Jim is developing an application for mobile wireless
devices. Jim needs to ensure that networking capabilities,
such as socket, serial, datagram, and http protocol are
provided in the mobile devices. In addition, Jim also needs
1 to ensure that the application supports device-specific
0 requirements of the mobile device. What should Jim do to
0 perform the required tasks? 1,Use the WMA package.

Chris Donaldson is working as a programmer in the


application development department of Global Systems
Inc. Chris develops a PDA application for mobile wireless
devices. Chris also ensures that the PDA application
supports floating-point operations and all features of CLDC
library. However, the mobile device with 160 KB of non-
volatile memory, 32 KB of volatile memory, and a 16- bit
1 processor does not support the PDA application. What is
0 the reason and what should Chris do to run the application 1,The minimum non-volatile memory for
1 on a mobile device? should be 192 KB to support the applica
Corrine Wallace is working as a software developer at with
Technology Systems Inc. The organization asks Corrine to
develop a J2ME application for mobile devices. Corrine
needs to display a list of elements on the screen of the
mobile device. To perform the task, Corrine writes following
code snippet:

List list1=null;

list1 = new List("Message1",List.Implicit);


1,Corrine needs to replace this code snip
list1.append("Reply",null); following code snippet:

list1.append("Forward",null); List list1=null;

list1.append("Delete",null); list1 = new List("List Demo",List.IMPLI

Display.getDisplay(listMidlet.instance).setCurrent(); list1.append("Reply",null);

list1.append(“Forward",null);

1 When Corrine executes this code snippet, he encounters list1.append("Delete",null);


0 various errors in it. What should Corrine to do solve the
2 problem? Display.getDisplay(ListMidlet.instance).s
Anne Johnson is working as a software developer at with
Red Eye Experts. Anne is developing a MIDP application.
Anne needs to display hyperlink text on the form displayed
on the screen of the mobile device. The label of the
hyperlink text should be My Pictures and tText. Pic1 should
be displayed as a hyperlink. , which is to be displayed as a
hyperlink is Pic1. Anne writes following code snippet to
perform the task:

StringItem strItem = new StringItem(‘My Picture’, ‘Pic1’,


‘Item.HYPERLINK’);

1,Anne needs to replace this code snippe


following code snippet:
1 When Anne executes the MIDP application with this code
0 snippet, she encounters errors in it. What should Anne do StringItem strItem = new StringItem(‘Pic
3 to solve the problem? Item.HYPERLINK);
Mary Peterson is working as a software developer at with
SuperSoftware 2002 Inc. Mary is creating a J2ME
application for mobile devices. To provide information
about different features of the mobile devices, Mary needs
to display read only text on the screen of the mobile
devices. Mary writes the following code snippet to perform
the task:

Form form1 = new Form("Functionality of Inbox");

List str = new List("","Enables you to store messages");

form1.append(str);

display.getDisplay(StringMidlet.instance)setCurrent(form1);

1
0 However, Mary encounters various errors while running this 1,Mary implements the List class instead
4 code. What could be the reason for the problem? in the code snippet.

Global System Inc. is a software development organization


in Washington. The organization receives a project of
developing a mobile application in J2ME. The organization
asks Donna, a MIDP developer to create UI for the mobile
application. In order to provide user interaction, Donna
needs to handle events, which are generated in response
to the user interaction with the UI. In addition, Donna
1 needs to set the event listener and provide the code to be 1,Donna needs to implement the Comm
0 executed on receiving an event. What should Donna do to define the commandAction() method. In
5 perform the task? needs to implement the CommandListen
Ronald Billing is working as a software developer at with
InfoSuper Inc. Ronald is developing a J2ME application for
mobile devices. Ronald needs to add an editable text
component on the form displayed on the screen of the
mobile device to allow users to enter and save phone
numbers in the mobile device. In addition, Ronald needs to
restrict the users from entering characters in the text
component. Ronald needs to set the size of the text
component as 25. Ronald writes the following code snippet
to perform the task:

TextField Pn = new
TextField("PhoneNumber",25,TextField.ANY);

this.append(Pn);
1,Ronald needs to replace the code snip
following code snippet:

After creating the mobile application with this code, Ronald TextField Pn = new
1 notices that application is not running properly and not TextField("PhoneNumber","",25,TextFiel
0 providing required output. What should Ronald do to solve
6 the problem? this.append();
Larry Williams is working as a software developer at with
Technology Systems. The job profile requires Larry to
develop mobile applications by using the J2ME platform.
The management asks Larry to develop a gaming
application for mobile devices. The gaming application will
contain several graphical objects, such as vehicles and
road. Larry creates a template for drawing graphical
1 objects on the display screen of the mobile device. Which
0 of the following methods should Larry use to draw the
7 graphical objects? 1,paint() method of the canvas class.

Christine Turner is working in the application development


department of SuperGraphics. The management asks
Christine to develop a gaming application for a mobile
device. The management also asks Christine to ensure that
the images of the application to be displayed on the screen
are flicker-free. Christine decides to use the double
buffering technique to enhance the quality of the display of
1 mobile devices. For this, Christine needs to create a copy
0 of the original image. Which of the following methods will
8 Christine use to perform the required task? 1,paint() method.
Jim Lewis is working as a mobile application developer at
with BlueMoon Computers. Jim needs to draw a two-
dimensional geometric figure for the display screen of a
mobile device. Jim creates the template for drawing the
figure on the display screen of a mobile device. Now, Jim
needs to use the methods provided by MIDP low level UI
1 APIs for drawing the geometric figure on the template.
0 Which of the following methods should Jim use to perform 1,The drawImage (Image img, int x, int y
9 the required task? method.

Chris Donaldson is working as a software developer with


Technology Systems. Chris needs to develop a gaming
application for mobile devices. For this, Chris needs to draw
1 graphical objects on the display screen of the mobile
1 devices. Which class of MIDP low-level UI APIs should Chris
0 use to perform the required task? 1,Canvas class
1,Use the following code:

Ken Burton is working as an application developer with


InfoSuper Corp. The management asks Ken to develop a
gaming application for mobile devices. The management public void paint (Graphics g)
also asks Ken to ensure that the display of the application
is flicker-free. For this, Ken creates a copy of the original {
images to be displayed on the screen. Now, Ken needs to
1 obtain the copy of the images for the offscreen buffer to g.drawImage ( buffer, 0, 0, 0);
1 draw the images on the offscreen buffer. What should Ken
1 do to perform the required task? }

1,Class MyClass extends Canvas


John Irvin is working as a software developer in with
Technology Systems Inc. The organization assigns John the {
task of developing a mobile application. John needs to
create the UI of the application to ensure that users can void paint(Graphics obj) {
interact with the mobile device. While creating UI for a
1 mobile application, John needs to draw graphical objects on }
1 the display screen of the mobile device. Identify the code
2 snippet John needs to implement to perform the task? }
Nancy Jones is working as a software developer at with
Smart Software Developers. Nancy is developing a MIDP
application for a mobile device. The organization asks
Nancy to create visual effects on the screen of the mobile
device. For this, Nancy needs to perform the following
tasks:

Draw two-dimensional geometric figures, such as rectangle


and circle, on the display screen of a mobile device.

Fill the geometric figures with colors.

Draw the specified characters by using the current font and


color.

1 Draw more than one character simultaneously.


1
3 What should Nancy do to perform the task? 1,Nancy needs to implement the Font cla

Ken Burton is working as a software developer at with


Safest Software Inc. Ken is developing a MIDP application.
To create UI of the mobile application, Ken decides to
develop visual effects on the screen of the mobile device.
To develop visual effects, Ken needs to draw the specified
characters by using the current font and color. He also
needs to draw more than one character simultaneously. In
addition, Ken wants to draw a rectangle on the screen of
1 the mobile device by intersecting a set of pixels, which are
1 painted by the Graphical objects. Which methods should 1,drawChar (char character, int x, int y,
4 Ken implement to perform the task? drawRect (int x, int y, int width, int heigh
Mike Womack is working as a software developer at with
Red Eye Experts. Mike is developing a J2ME application for
the mobile devices. Mike makes some changes in an object
of the Canvas class and needs to reflect the changes on
the screen of the mobile device. To perform the task, Mike
should refresh the screen of the mobile device. For this,
Mike needs to invoke the paint() method to draw the
graphical objects on the specified drawing region. Mike also
needs to synchronize the paint() method and method that
1 is used to refresh the screen of the mobile device. Which of
1 the following methods Mike needs to implement to perform 1,repaint (0, 0, getWidth (), getHeight ()
5 the task? serviceRepaints()

Pat Wilkins is working as a software developer at with


Super Graphics Inc. Pat is developing a J2ME application for
the mobile devices. The organization asks pat to avoid
flickering of screen of the mobile device to improve the 1,Override the paint () method to copy t
quality of display. For this, Pat decides to draw graphical buffer on the screen of a mobile device b
objects on an off-screen buffer of a mobile device before following code snippet:
drawing the graphical objects on the original display
screen. Pat needs to copy the contents of the off-screen public void paint (Graphics g) {
buffer to the display screen to display the graphical objects
1 on the screen of the mobile device. What task should Pat g.createImage ( buffer, 0, 0, 0);
1 perform to copy the contents of the off-screen buffer to the
6 display screen? }
Chris is working as a UI designer at withTechnology
Systems. Chris is creating a mobile application, which
displays a page that contains text. and The users need to
press EXIT to exit the application. To perform the task,
Chris writes the following code snippet:

1,Chris needs to replace this code snippe


following code snippet:
class TextCanvas extends Canvas implements
CommandListener

{ class TextCanvas extends Canvas implem


CommandListener
private Command cmExit;
{
private CanvasBasics midlet;
private Command cmExit;
private String txt = "Center this text";
private CanvasBasics midlet;
public TextCanvas(CanvasBasics midlet)
private String txt = "Center this text";
{
public TextCanvas(CanvasBasics midle
this.midlet = midlet;
{
// Create commands & listen for events
this.midlet = midlet;
cmExit = new Command("Exit", Command.OK, 1);
// Create commands & listen for event

cmExit = new Command("Exit", Comm


addCommand(cmExit);

setCommandListener(this);
addCommand(cmExit);
}
1 setCommandListener(this);
1 But when Chris presses the Exit button, the application is
7 not closed. What should Chris do to solve the problem? }
John Beret is working as a software developer at with Red
Eye Experts. John is developing a J2ME application on a
mobile device. The management asks John to create a user
interface of a mail application that enables the users to
send messages. For this, John needs to implement the
compose message confirmation page in which the user has
to press the OK button to continue in the application. He
writes the following code snippet for the application:

class TestCanvas extends Canvas implements


CommandListener

{ 1,John needs to replace this code snippe


following code snippet:
private Command cmExit; // Exit midlet
class TestCanvas extends Canvas implem
Exitcm= new Command("OK", Command.EXIT, 1); CommandListener

addCommand(Exitcm); {

setCommandListener(this); private Command cmExit; // Exit m

Exitcm= new Command("OK", Comman

} addCommand(Exitcm);

1 When John executes the MIDP application with this code setCommandListener(this);
1 snippet, he encounters errors in it. What should John do to
8 solve the problem? }
Mary Peterson is working as a software developer with
SuperSoftware 2002 Inc. Mary has been assigned the task
of creating a J2ME application for mobile devices. Mary is
creating a screensaver that displays various rotating
graphical objects. Mary writes the following code to display
a rectangle:

protected void paint(Graphics g) 1,Mary needs to replace this code snippe


following code snippet:
{

g.drawRect(1, 1, 25, 25, 25);


protected void paint(Graphics g)
g.drawRoundRect(28, 28, 45, 45, 15, 45);
{

g.drawArc(1, 1, 25, 25, 25);


// g.fillRect(1, 1, 25, 25);
g.drawRoundRect(28, 28, 45, 45, 15, 4
// g.fillRoundRect(28, 28, 45, 45, 15, 45);

// g.fillRect(1, 1, 25, 25);


}
// g.fillRoundRect(28, 28, 45, 45, 15, 4

1
1 However, Mary encounters various errors while running this
9 code. What should Mary do to resolve the problem? }
Global System Inc. is a software development organization
in Washington. The organization asks Donna, a UI designer
and programmer to create a screensaver by using the low
level UI API classes and interfaces. The screensaver
displays the user specified text in various fonts. She has
created the following code to display the text, in bold and
italics:

1,Donna needs to replace this code snip


protected void paint(Graphics g) following code snippet:

int xcenter = getWidth() / 2, protected void paint(Graphics g)

ycenter = getHeight() / 2; {

int xcenter = getWidth() / 2,

g.setFont(Font.getFont(Font.FACE_MONOSPACE, ycenter = getHeight() / 2;

Font.STYLE_BOLD|Font.STYLE_PLAIN,
Font.SIZE_MEDIUM));
g.setFont(Font.getFont(Font.FACE_SYS

Font.STYLE_BOLD|Font.STYLE_IT
Font.SIZE_MEDIUM));

g.drawRect(xcenter, ycenter, xcenter, ycenter);

// x and y are always at the center of the display g.drawLine(xcenter, ycenter, xcenter,

g.drawString("This is a screensaver!",

xcenter, ycenter, midlet.getAnchorPoint()); // x and y are always at the center of t

} g.drawString("This is a screensaver!",

1 When Donna executes this code snippet, she encounters xcenter, ycenter, midlet.getAn
2 various errors in it. What should Donna to do solve the
0 problem? }
Tom Wilkins is working as a mobile application developer at
with Technology Systems Inc. Tom has been assigned the
task of developing a MIDP application. Tom needs to draw
graphical objects on the screen of the mobile device. To
avoid the flickering of the screen and to improve the
quality of the display, Tom wants to create a copy of the
screen in the memory of the mobile device. For this, Tom
needs to create a mutable image with the size of the
screen. To perform the task, Tom writes following code
snippet:

1,Tom needs to replace this code snippe


int width = getWidth (); following code snippet:

int height = getHeight ();

Image buffer = Image.drawImage (width, height); int width = getWidth ();

1 When Tom executes this code snippet, he encounters int height = getHeight ();
2 various errors in it. What should Tom to do solve the
1 problem? Image buffer = Image.createImage (wid
Tom Wilkins is working as a mobile application developer
with InfoSuper Corp. Tom develops an application by using
the J2ME platform. The application enables the employee
working at the client sites to access the detail about the
organization’s products stored in a RMS database of their
organization, through their cell phones. Pat, an employee
working at the client site need to delete a record in the
1 database. Which method of the
2 javax.microedition.rms.RecordStore class should Pat use to
2 perform the required task? 1,deleteRecord(int recordId) method

Chris Donaldson is working in the application development


department of SuperGraphics. Chris develops a PDA
application, which serves the purpose of an address book.
1 However, when Chris tries to access a record from the
2 application, InvalidRecordIDException is thrown. What
3 could be the possible reason for the error? 1,Attempt is made to access a deleted re

Donna Bard is working as application developer at with


Global Systems Inc. Chris develops a PDA application,
which serves the purpose of an address book. However,
1 when Chris tries to add a record in the PDA application, an
2 exception, RecordStoreFullException, is thrown. What could
4 be the possible reason for the error? 1,A record store is not opened.
Donna Bard is working as a mobile application developer at
with BlueMoon Computers. Donna is developing an
application for a phone appointment diary. Donna develops
an interface that will enable the users to navigate through
1 the records. In addition, Donna needs to display the
2 records in the recordstore. What should Donna do to 1,Implement Record Listener and use th
5 perform the required task? nextRecordID() method.

Jim Lewis is working as an application developer at with


Technology Systems. Jim develops an application to enable
the employee working at the client sites to access the
details about organization’s products. These details , which
are stored in an RMS database through their mobile
devices. Pat, an employee working at the client site needs
1 to add a record in the recordstore. However, a
2 RecordStoreFullException exception is raised. What could
6 be the possible reason of the error? 1,A record store is not opened.
Pat Wilkins is working as a software developer at with Blue
Moon Computers. Pat is developing a MIDP application. Pat
implements RMS for storing J2ME objects so that the
objects can be used even after the application is closed.
Pat needs to add a new record to the RMS. To perform the
1 task, Pat implements the addrecord() method. However,
2 while executing the method, Pat encounters the 1,The record cannot be added to a recor
7 RecordStoreException. What could be the possible reason? security limitations.

Christine Turner is working as a mobile application


developer at with SuperGraphics. Christine develops a
MIDlet application for mobile devices. However, Christine
observes that the application does not run on a mobile
device with a display depth of 1-bit. The device has a non-
volatile memory of 160 KB and volatile memory of 32 KB.
The mobile device also supports two-way wireless
connectivity of limited bandwidth and the user input
1 mechanism in the device supports one-handed keyboard.
2 What could be the reason and what does Christine do to 1,A MIDlet compliant device should have
8 solve the problem? volatile memory of 128 KB.
Donna Bard is working as a software developer at with
InfoSuper Corp., which provides wireless services to its
customers. The management asks Donna to develop MIDlet
applications for a mobile wireless device to allow users to
use the e-mail facility and other Web services. For this,
Donna writes the following code to be included in the
manifest file of the MIDlet suite:

MIDlet-Name: HelloWorld

MIDlet-Vend fileor: AB Corp


1,Replace the code with the following co
MIDlet-1: HelloWorld, HelloWorld.png, HelloWorld
MIDlet-Name: HelloWorld
MicroEdition-Profile: MIDP-2.0
MIDlet-Vend fileor: AB Corp

MIDlet-1: HelloWorld, HelloWorld.png, He


However, the device does not load the JAR file, which
1 contains the MIDlet suite, installed on a mobile device. MicroEdition-Configuration: CLDC-1.0
2 What modifications should Donna perform in the code,
9 such that the device loads the JAR file? MicroEdition-Profile: MIDP-2.0
Chris Donaldson is working as a programmer in the
application development department with SuperGraphics.
SuperGraphics, which develops software for mobile
devices. Chris develops mobile applications by using J2ME
platform. The management asks Chris to develop a PDA
application, which allows users to perform floating-point
operations. Chris also needs to ensure that the application
1 resolves all error-handling requirements and runs on the
3 mobile device with non-volatile memory of 192 KB. What 1,Use the CLDC 1.0 configuration provid
0 should Chris do to perform the required tasks? platform.
Jim Lewis is working as a mobile application developer at
with Technology Systems Inc. The organization asks Jim to
create a registration form, which consists of text boxes and
radio buttons to enable the users to fill their details in a
mobile device. Jim needs to create an object to display the
list of radio buttons from which the user can select an item.
To perform the task, Jim writes the following code snippet:

//Create a Form object 1,Jim needs to replace this code snippet


following code snippet:
Form writemail = new Form("Registration Form");// Create
a ChoiceGroup object //Create a Form object

Spacer login_save = new Form writemail = new Form("Registratio


ChoiceGroup("",ChoiceGroup.MULTIPLE);login_save.append Create a ChoiceGroup object
("Save Login",null);writemail
.append(login_save);Display.getDisplay(listMIDlet.instance) Spacer login_save = new
.setCurrent(writemail);
Spacer("",ChoiceGroup.MULTIPLE);login_
1 When Jim executes this code snippet, he encounters ve Login",null);writemail
3 various errors in it. What should Jim to do solve the .append(login_save);Display.getDisplay(
1 problem? etCurrent(writemail);
John Beret is working as a software developer at with Red
Eye Experts. John is developing a J2ME application on a
mobile device. John needs to display an image on the
mobile device displayscreen. John writes the following code
snippet to perform the task:

Form writemail = new Form("Form heading");

ImageItem imgItem = new ImageItem("Image Item", 1,John needs to replace this code snippe
img, Item.LAYOUT_CENTER, null, Item.BUTTON); following code snippet:

Writemail.getImage(image); Form writemail = new Form("Form head


imgItem = new ImageItem("Image I
Display.getDisplay(MIDlet.instance).setCurrent(writeMail); Item.LAYOUT_CENTER, null,
Item.BUTTON);

Writemail.getImage(image);
1 When John executes the MIDP application with this code
3 snippet, he encounters errors in it. What should John do to Display.getAppearanceMode(MIDlet.inst
2 solve the problem? writeMail);
Mary Peterson is working as a software developer at
SuperSoftware 2002 Inc. Mary has been assigned the task
of creating a J2ME application for mobile devices. Mary
needs to display a text box on the screen of a mobile
device to enable the users to compose the message. For
this, Mary wants to display a text box with the label
‘Compose SMS’ on the screen of the mobile devices. Mary
writes following code snippet to perform the task:

TextBox tb = new TextBox("Compose SMS", "Write the


text here", 200, TextField.ANY); 1,Mary needs to replace this code snippe
Display.getDisplay(StringMIDlet.instance).setCurrent(tb); following code snippet:
1 TextBox tb = new TextBox("Compose S
3 However, Mary encounters various errors while running this text here", 200, TextField.ANY);
3 code. What could be the possible reason? Display.getDisplay(MIDlet.instance).setC
Global System Inc. is a software development organization
in Washington. The organization launches a new mobile
device. The organization asks Donna, a UI designer and
programmer to design and implement the phonebook of
the latest mobile phone. The phonebook should display the
inbox as a header and the list of usernames in the header.

To perform the task, Donna writes following code snippet: 1,Donna needs to replace this code snip
following code snippet:
Form writemail = new
Form("Phonebook");Spacer login_save = new
Spacer("",Spacer.MULTIPLE);login_save.append("Username
1",null); Form writemail = new Form("Phonebook

login_save.append("Username2",null);writemail ChoiceGroup login_save = new


.append(login_save);Display.getDisplay(listMIDlet.instance) ChoiceGroup("",ChoiceGroup.MULTIPLE);
.setCurrent(writemail); d("Username1",null);

1 When Donna executes this code snippet, she encounters login_save.append("Username2",null);w


3 various errors in it. What should Donna to do solve the .append(login_save);Display.getDisplay(
4 problem? etCurrent(writemail);
Ronald Billing is working as a software developer with
InfoSuper Inc. Ronald is developing a J2ME application for
mobile devices. Ronald needs to create a registration form,
which consists of text boxes and radio buttons to enable
the users to fill their details on a mobile device. Ronald
wants to create a Form object to provide the information
about the registration form. Ronald writes the following
code snippet to perform the task:

Form writemail = new Form("Registration


Form");writemail.append(‘You need to fill the form\n to
access the mobile services provided by the 1,Ronald needs to replace the code snip
InfoSuper’);Display.get(MIDlet.instance).setCurrent(writem following code snippet:
ail);

Form writemail = new Form("Registratio


After creating the mobile application with this code, Ronald Form");writemail.append(“You need to fi
1 notices that application is not running properly and is not access the mobile services provided by t
3 providing required output. What should Ronald do to solve InfoSuper”);Display.get(MIDlet.instance)
5 the problem? mail);

Donna Johnson is working as a software developer with


Blue Moon Computers. Donna is developing a mobile
application by using J2ME. She needs to design user
interface of the mobile application to enable users to
interact with the mobile device. For this, Donna needs to
1 store information about the events, which are generated by
3 the users while interacting with the mobile device. Which
6 class should Donna use to perform the task? 1,Command
Global System Inc. is a software development organization
in Washington. The organization receives a project of
developing a mobile application by using J2ME. The
organization asks Donna, a MIDP developer to create user
interface for the mobile application. To provide user
interaction, Donna needs to handle events, which are
generated in response to the user interaction with the UI.
Donna implements the Command class to handle the
1 events. Which method of the Command class should Donna
3 should use to gather information about the Command
7 object, such as function of the Command object? 1,getLabel()

Pat Wilkins is working as a MIDP developer at with


Technology systems Inc. Pat is developing a MIDP
application. Pat is using the List class to implement phone
book in the application. However, Pat needs to replace a
1 specific element of the list with the new text and image.
3 Which method of the List class should Pat should use to
8 perform the task? 1,removeCommand()
Corrine Wallace is working as a MIDP developer in with
Super Software Inc. Corrine is developing a J2ME
application for mobile devices. Corrine needs to display
1 date and time on the screen of a mobile device such that
3 they scroll along the screen continuously. Which class
9 should Corrine implement to perform the task? 1,StringItem

Anne Johnson is working as a software developer at with


Red Eye Experts. Anne is developing an MIDP application.
Anne wants that a progress indicator should be displayed
1 to the mobile users whenever an application is downloaded
4 on the mobile device. Which class should Anne should use
0 to perform the task? 1,Command

Larry Williams is working as a chief MIDP programmer at


Technology Systems Inc. Larry needs to enable the
programmers developing the MIDP application to use the
J2ME objects even after the application is closed.
Therefore, Larry implements RMS to store the objects,
which are created by using J2ME. Larry needs to display a
list of all the records in the RMS to the MIDP programmers.
However, Larry notices that the records stored in the RMS
are not in the sequential order and cannot be traversed
1 because whenever a record is deleted, the recordID of the
4 deleted record is not assigned to any other record. What
1 should Larry do to solve the problem? 1,Larry needs to implement the RecordL
Donna Johnson is working as a software developer with
Global System Inc. Donna is developing a MIDP application.
Donna implement RMS to store the objects created in J2ME
so that the objects can be used even after the application
is closed. Donna needs to share a record store, Sharable
with other MIDlet suites. She writes the following code
snippet to perform the task:

int authMode = RecordStore.AUTHMODE_PRIVATE;

boolean writable = False; 1,Donna needs to replace the code snipp


following code snippet:
rs = RecordStore.openRecordStore( " Sharable ",
True,authMode, writable ); int authMode = RecordStore.AUTHMO

However, Donna notices that MIDP application is not boolean writable = False;
1 running properly and Sharable record store cannot be
4 shared with other MIDlet suites. What should Donna do to rs = RecordStore.openRecordStore( " Sh
2 perform the task? True,authMode, writable );
Pat Wilkins is working as a software developer at with Blue
Moon Computers. Pat is developing a J2ME application for
mobile devices. Pat is using persistent storage to store the
objects created in J2ME so that the objects can be used
even after the application is destroyed. Pat needs to
display a list of all the records stored in the record store.
However, Pat notices that the record stored in the record
store cannot be traversed, as records are not in sequential
order. To solve the problem, Pat decides to implement the
Enumeration class and invoke the enumerateRecord()
method to traverse the record store. However, while
1 executing the enumerateRecord(), Pat encounters the
4 RecordStoreNotOpenException. What could be the possible
3 reason? 1,The record store is not open.

Debbie Howe is working as a software developer at with


Safest Software Inc. Debbie implements persistent storage
to store the objects created in J2ME so that the objects can
be used even after the application is destroyed. Debbie
needs to allow all the MIDlet suites to access the record
store of a specified MIDlet suite. However, the MIDLet
1 suites should not be able to modify the records stored in 1,Debbie needs to set the authmode and
4 the record store of the specified MIDlet suite. What should parameter of the openRecordStore meth
4 Debbie do to perform the task? RecordStore.AUTHMODE_PRIVATE and T
Pat Wilkins is working as a software developer at with Blue
Moon Computers. The organization receives a project of
developing a J2ME application for mobile devices. Pat is
assigned the task of managing the record store containing
data of the mobile application. Pat needs to open an
existing record stored in the record store. To perform the
task, Pat writes the following code snippet:
1,Pat needs to replace the code snippet
public void analyze( String rsName ){ code snippet:

RecordStore rs; public void analyze( String rsName ){

RecordStore rs;

try {

rs = RecordStore.openRecordStore( rsName, True ); try {

analyze( rs ); // call overloaded method rs = RecordStore.openRecordStore

} catch( RecordStoreException e ){ analyze( rs ); // call overloaded met

logger.exception( e ); } catch( RecordStoreException e ){

} finally { logger.exception( e );

try { } finally {

rs.closeRecordStore(); try {

} catch( RecordStoreException e ){ rs.closeRecordStore();

} } catch( RecordStoreException e ){

} // Ignore this exception

} }

1 However, Pat notices that code snippet is not running }


4 properly and has many errors in it. What should Pat do to
5 solve the problem? }
Larry Williams is working as a chief MIDP programmer at
Technology Systems Inc. Larry is developing a MIDP
application. Larry needs to store the data of the application
in the persistent storage so that the object created in J2ME
can be used even after the application is destroyed.
However, to store the data, Larry needs to convert the data
to byte arrays. Larry writes the following code to convert
the data to byte arrays:

byte[] data = recordStore.getRecord(recordID);


1,Larry needs to replace the code snippe
ByteArrayOutputStream byteOut = new following code snippet:
ByteArrayOutputStream(data);
String data = recordStore.getRecord(rec
DataOutputStream out = new DataOutputStream(byteOut);
ByteArrayInputStream byteIn = new
int someInt = out.readInt(); ByteArrayInputStream(data);

int someString = out.readUTF(); DataInputStream in = new DataInputStr

1 However, Larry notices that code has many errors in it int someInt = in.readInt();
4 because of which code is not producing required results.
6 What should Larry do to solve the problem? String someString = in.readUTF();
Donna Johnson is working as a software developer with
Global System Inc. The organization receives a project of
developing a J2ME application for mobile devices. Donna is
assigned the task of managing the record store containing
the data of the mobile application. Donna needs to add a
new record to the record store. To perform the task, Donna
writes the following code snippet:

try
1,Donna needs to replace the code snipp
{ following code snippet:

ByteArrayInputStream strmBytes = new try


ByteArrayInputStream();
{

ByteArrayOutputStream strmBytes = ne
DataInputStream strmDataType = new ByteArrayOutputStream();
DataInputStream(strmBytes);

record = strmBytes.ByteArray();
DataOutputStream strmDataType = new
rs.addRecord(record, 0, record.length); DataOutputStream(strmBytes);

} record = strmBytes.toByteArray();

1 However, while running the code, Donna notices that the rs.addRecord(record, 0, record.length);
4 code has many errors in it. What should Donna do to solve
7 the problem? }
Pat Wilkins is working as a software developer at with Blue
Moon Computers. Pat is developing a J2ME application for
mobile devices. Pat needs to display a list of all the records
stored in the record store, which is storing data of the
mobile application. However, Pat notices that the record
stored in the record store cannot be traversed, as records
are not in the sequential order. To solve the problem, Pat
writes the following code snippet:
1,Pat needs to replace the code snippet
RecordStore rs = RecordStore.openRecordStore(rsName, code snippet:
True);
RecordStore rs = RecordStore.openReco
RecordEnumeration enu; True);

RecordEnumeration enu = null;

try {

enu = rs.enumerateRecords( null, null, False ); try {

while( !enu.hasMoreElements() ){ enu = rs.enumerateRecords( null, nul

int id = enu.getNextRecordId(); while( !enu.hasMoreElements() ){

} int id = enu.getNextRecordId();

} // do something here with the recor

catch( RecordStoreException e ){ }

} }

finally { catch( RecordStoreException e ){

enu.destroy(); }

} finally {

1 However, Pat notices that code snippet is not running enu.destroy();


4 properly and has many errors in it. What should Pat do to
8 solve the problem? }
Debbie Howe is working as a software developer at with
Safest Software Inc. Debbie is developing a MIDLet
application. Debbie implements persistent storage to store
the objects created in J2ME so that the objects can be used
even after the application is destroyed. Debbie needs to
search a particular record in the record store on the basis
of the specific search criteria. To perform the task, Debbie
writes the following code snippet:

class SearchRec implements RecordListener

private String searchCriteria = null;

public SearchRec (String searchCriteria)

this.searchCriteria = searchCriteria.toUpperCase();

public boolean matches (byte [] candidate)

String str = new String (candidate).toUpperCase();

if (searchCriteria != null && str.indexOf(searchCriteria) !=


-1)

return True;

else

return False;

1 However, while running the code, Debbie notices that code


4 has many errors in it. What should Debbie do to solve the 1,Debbie should implement the RecordF
9 problem? instead of the RecordListener interface.
John Lewis is working as an application developer at with
Global System Inc. John has created a record store for the
newly developed MIDlet application. John wants to add new
record in a record store by using addRecord() method. But,
1 at the time of adding record in the record set, an exception
5 is raised as RecordStoreException. What may be the cause
0 of this exception? 1,The exception is raised if a record stor

Steve Irving is working as an application developer at with


Blue Moon Computers. Steve has developed MIDlet 1,Steve needs to write the following cod
application by using MIDP 2.0. Steve wants to create and
open a Record Store for storing some records of the MIDlet RecordStore OpenRecordStore(String
1 application in the persistent Record Management System RecordListener listener,
5 (RMS) database. What should Steve do to perform the
1 above task? boolean createIfNecessary)

Bob Edwin is working as an application developer at with


Red Sky Experts. Bob has developed MIDlet application by
using MIDP 2.0. Bob also created a Record Store for storing
some records of a MIDlet application in the persistent
Record Management System (RMS) database. Now, Bob
1 wants to remove a record store because the application is 1,Bob needs to write the following code:
5 no longer in use. What should Bob do to perform the above
2 task? Static RecordStore.deleteRecordStore(St
Pat Greene is working as an application developer at with
Deez Inc. Pat has created a Record Store for the newly
developed MIDlet application. Now, Pat wants to add new
record in a record store by using addRecord () method. But,
1 at the time of adding the record in the record set, the
5 RecordStoreFullException exception is raised. What may be
3 the cause of this exception? 1,The exception is raised if a record stor

Donna Johnson is working as an application developer at


with Safest Software. Donna has developed MIDlet
application by using MIDP 2.0. Donna has also created a
Record Store for storing some records of MIDlet application
in the persistent Record Management System (RMS) 1,Donna needs to write the following cod
database. Now, Donna wants to share this record store
1 across another MIDlet application to remove the RecordStore openRecordStore(String rec
5 redundancy of data. What should Donna do to perform the
4 above task? boolean createIfNecessary)

Jim Lewis is a MIDP developer at with Red Sky IT System.


Jim has been assigned the task to develop a MIDP
application. Therefore, Jim needs to use the package, which
1 provides all the basic classes required for a MIDP
5 application. Which package should Jim use to develop the
5 MIDP application? 1,javax.microedition.midlet
John Edwin is a mobile application developer at with
BlueMoon Computers. The business manager of the
company organization asks John to develop a mobile
application in using J2ME. Therefore, John needs to use a
1 package that supports the GUI components, for the screens
5 of mobile devices. Which package should John use to
6 perform the above task? 1,javax.microedition.midlet

Chris Wilkins is an application developer with Global


Systems. Chris develops a MIDlet application in J2ME. After
developing the application, Chris wants to establish a two-
1 way communication for the MIDlet application, over a
5 network. Which protocol should Chris use to perform this
7 task? 1,UDP Protocol

Donna Johnson is a mobile application developer at with


BlueMoon Computers. Donna has developed a mobile
application in using J2ME. Now, Donna wants to add a
1 package that provides support for networking in mobile
5 devices. Which package should Donna use to perform the
8 above task? 1,javax.microedition.midlet

Pat Wilkins is an application developer at with Global Inc.


Pat has developed a MIDlet application in using J2ME. Now
1 Pat wants to store and retrieve the MIDlet data from
5 persistent database. Which package should Pat use to
9 perform the above task? 1,javax.microedition.midlet
Chris is working as a MIDP UI designer at Technology
Systems Inc. Chris develops a MIDlet application to provide
Web services, such as news to the users and installs the
application on a mobile device. After the MIDlet application
is installed, the mobile device, where the MIDlet application
is installed, generates and sends a status report about the
installation of the MIDlet application to a Web server from
where the application is installed. Chris notices that the
1 MIDlet application is not installed on the mobile device and
6 the Web server responds with status code, 901. What could
0 be the problem? 1,Insufficient memory in the mobile devi

John Beret is working as a software developer at Red Eye


Experts. John is developing a MIDlet application on a
mobile device. John wants to display news on a mobile
device. For this, John needs to enable the mobile device to
launch the news MIDlet application using push registry
feature. John performs registration to avoid errors, such as
syntax error in the push attributes. However, the
1 registration is not performed properly and an error is
6 displayed stating Security Exception. What could be the 1,The J2ME platform does not support pu
1 reason of error? for the requested connection protocol
Pat Wilkins is an application developer at Global Inc. Pat
has developed a MIDlet application. Pat wants to register a
MIDlet connection dynamically using the Push Registry
1 class at runtime. However, at the time of dynamic
6 registration an exception occurs as “IOException.” What
2 may be the cause of the problem? 1,Connection is already registered

Consider the Statements:

Statement A: During dynamic configuration


IllegalArgumentException is thrown if the connection of
filter arguments is null.

Statement B:

During dynamic configuration ClassNotFoundException is


thrown if the MIDlet argument is null or if the name of the
class is not found in the MIDlet suite.
1
6 Which of the following is True, with respect to the above
3 Statements? 1,Statement A is True and Statement B i

Ronald Billing is working as a software developer at


InfoSuper Inc. Ronald develops a MIDlet application and
installs the application on a mobile phone. The mobile
device, where the MIDlet application is installed, generates
and sends a status report about the installation of the
MIDlet application to a Web server. Ronald identifies that
1 the MIDlet application is not installed on the mobile device
6 and the Web server responds with status code, 905. What 1,A mismatch in the actual attributes an
4 could be the problem? specified in the JAR file
1,<mime-mapping>

Christine Turner is working as a programmer at Technology <extension>jad</extension>


Systems, which provides wireless services to its customers.
The management asks Christine to develop MIDlet <mime-type>text/vnd.sun.j2me.app-d
application to provide Web services, such as news, stocks type>
to its customers. In addition, Christine wants that the
customers are able to access the application remotely. </mime-mapping>
Therefore, Christine needs to deploy the JAR and the JAD
files of the MIDlet application on the Web server to enable <mime-mapping>
the users to download the MIDlet application from the Web
server. For this, Christine writes a code to configure a <extension>jar</extension>
Tomcat Web server to recognize the JAD and JAR files.
1 However, the Tomcat Web server is not configured. Which <mime-type>application/java-archive<
6 of the following codes should Christine use to perform the
5 required task? </mime-mapping>
Jim Lewis is working as a software developer at Global
Systems Inc, which provides wireless services to its
customers. Jim Lewis develops a MIDP application, which
enables the users to download video and movie clips. Now,
Christine needs to declare a static push registration so that
the MIDlet application is launched when the mobile device
receives a network connection request. For this, Christine
adds a MIDlet-Push-n attribute while installing the MIDlet
application on a mobile device. However, the mobile device 1,Use the following code to add the MIDl
1 does not register the MIDlet application to accept a attribute:
6 network connection request. Which of the following options
6 should Jim use to solve the problem? MIDlet-Push-n: ConnectionURL, Filter

Jim Lewis is working as a software developer at Blue Moon


Computers. Jim needs to use push registry feature to
enable the mobile device to launch the news MIDlet
application to display news information on a mobile device.
For this, Jim performs registration to avoid errors, such as
syntax error in the push attributes. However, the
registration is not performed properly and an error is
1 displayed stating Security Exception. What type of 1,Jim performed static push registration
6 registration did Jim perform and what is the cause of the because a connection that is already res
7 error? MIDlet application is declared
Pat Greene is working as a software developer at Safest
Software Co. Pat develops a MIDlet application that
provides a service of selling movie tickets on a mobile
device. The application can send an alarm to the ticket
holder at the time of beginning of the movie show.
However, when the MIDlet application is invoked, the
registerAlarm() method displays an error stating
ClassNotFoundException. Pat needs to set a new alarm for
the MIDlet application. The alarm should alert the ticket
holder just before a movie is about to begin. What could be
1 the reason for the error and what should Pat do to retrieve 1,The error is because the J2ME platform
6 the time of previous alarm and perform the required support alarm based push registry. Use
8 modifications to the application? PushRegistry.Alarm() method to perform

Donna Bard is working as a programmer at BlueMoon


Computers, which develops software for mobile devices.
Donna develops mobile applications using J2ME platform.
Donna develops a MIDlet application, which provides Web
services, such as cricket news, stock news to the users. To 1,Use the following code:
activate the MIDlet application, Donna needs to create an
1 inbound connection by using only the protocol of the Connector.open("socket:\\")
6 network connection. What should Donna do to perform the
9 required task? Connector.open("datagram:\\")
Ken Burton is working as a software developer at Global
Systems Inc, which provides wireless services to its
customers. Ken develops a MIDlet application for mobile
wireless device that enables the users to use the e-mail
facility. Ken needs to deploy the MIDlet application on a
Web server to enable the users to download application to
a mobile device from the Web server using a wireless
network. In addition, when a user tries to download the 1,To deploy a MIDlet application on a We
application, the application is not installed and the mobile needs to establish a network connection
1 device generates the status code 901. What does Ken do to mobile device and the computer on whic
7 perform the required task and what could be the possible deploy the MIDlet application. The error
0 reason of error? because the user is not authorized to ins
Larry Williams is working as a software developer at
SuperSoft2000. The management asks Larry to develop a
MIDlet application to enable the users to access the Web
services, such as news. Now, Larry needs to implement the
push registry on the MIDlet application so that the
application can use the remote connection feature of the
push registry to launch a news MIDlet application. The
application needs to connect to a remote server to display
news information on a mobile device. In addition, Larry
develops a MIDlet application that is invoked based on
scheduled tasks, such as birthdays. Therefore, Larry also
1 needs to register an alarm based push registry to launch 1,Use the registerConnection() and the
7 the application. Which method does Larry use to perform registerAlarm()method of the
1 the required tasks? javax.microedition.io.PushRegistry class
Chris Donaldson is working as a software developer at
InfoSuper Corp. Chris develops a MIDlet application, which
serves the purpose of an address book. Chris performs the
following steps to deploy the MIDlet application using the
IR port to enable the users to install the application on a
mobile device using IR port.

Install an interface for the IR port on the computer on


which you want to deploy the MIDlet application.

Send the JAR and JAD files of the MIDlet application to the
mobile device through the IR port.
1
7 However, the MIDlet application is not deployed. What
2 could be the possible reason of error? 1, The IR port on the mobile device is no

Diane Frye is a mobile application developer at SmartLabs.


Diane is developing a MIDlet application. Diane needs to
start the MIDlet application from a remote connection
without the user intervention. Therefore, Diane needs to
implement Push registries in the MIDlet application.
However, to implement the Push registry in MIDlet
application, Diane needs to implement inbound
connections because MIDlet applications are activated by
an inbound connection. Diane needs to implement the
1 inbound connection such that it can be identified only with 1,Connector.open("sms://")
7 the help of the protocol of the network connection. Identify
3 the code snippet Diane needs to write to perform the task. Connector.open("datagram://")
John Edwin is working as an application developer at Blue
Moon computers. John has developed a MIDlet application
providing the connection string, the MIDlet to launch, and
the filter string. Now, John wants to connect the MIDlet
application dynamically, using the PushRegistry class at
runtime. While registering the dynamic connections, it
throws the exceptions as IllegalArgumentException.

In addition, John develops a MIDlet application that


provides e-mail facility to the users. Now, Jim needs to 1,The name of the class is not found in t
create an inbound connection to activate the MIDlet Use the following code to create inbound
application.
1 Connector ("socket://")
7 What may be the cause of this Exception and what should
4 John do to create an inbound connection? Connector ("datagram://")