310-110 Sun Certified Mobile Application Developer for J2ME Set 12

A MIDlet suite has the application descriptor fragment: MIDlet-1: E-mail, email.png,

com.example.EmailMIDlet The MIDlet suite has the necessary permissions to use the

PushRegistry. What line does the application descriptor need to register the MIDlet suite for socket

push connections on port 79?



Options are :

  • MIDlet-Push-1: socket://:79, com.example.EmailMIDlet, *
  • MIDlet-Push-1: socket://:79, E-mail, *
  • MIDlet-Push-1: socket://:79, EmailMIDlet, *
  • MIDlet-Push-1: socket://:79, MIDlet-1, *

Answer : MIDlet-Push-1: socket://:79, com.example.EmailMIDlet, *

What is the minimum volatile memory requirement identified by the CLDC 1.1 specification?



Options are :

  • 32 KB
  • 64 KB
  • 128 KB
  • 160 KB

Answer : 32 KB

310-110 Sun Certified Mobile Application Developer for J2ME Set 2

When can a MIDlet suite be installed in the untrusted domain?



Options are :

  • when suite is authenticated using an X.509 PKI certificate and the certificate fails signature verification
  • when suite is authenticated using an X.509 PKI certificate and the certificate is expired
  • when suite is NOT signed with an X.509 PKI certificate
  • when suite is authenticated using an X.509 PKI certificate and the certificate is invalid

Answer : when suite is NOT signed with an X.509 PKI certificate

Given:

RecordStore rs = null;

static final String REC_STORE = "appdata"; And, the record store does NOT already exist.

Which is the correct way to open the record store, requesting the record store be created?



Options are :

  • rs = RecordStore.createRecordStore(REC_STORE, true);
  • rs = RecordStore.openRecordStore(REC_STORE);
  • rs = RecordStore.createRecordStore(REC_STORE, 1);
  • rs = RecordStore.openRecordStore(REC_STORE, 1);
  • rs = RecordStore.createRecordStore(REC_STORE);
  • rs = RecordStore.openRecordStore(REC_STORE, true);

Answer : rs = RecordStore.openRecordStore(REC_STORE, true);

Which is used to retrieve the version of MIDP a device has implemented?



Options are :

  • System.getAppProperty("microedition.profiles")
  • System.getAppProperty("microedition.platform")
  • System.getProperty("microedition.platform")
  • System.getProperty("microedition.configuration")
  • System.getProperty("microedition.profiles")

Answer : System.getProperty("microedition.profiles")

310-110 Sun Certified Mobile Application Developer for J2ME Set 3

Given: 10. MessageConnection connection;

11.

12. public void startApp() {

13. //...

14. connection

15. = (MessageConnection) Connector.open("sms://:6222");

16. connection.setMessageListener(this);

17. // ...

28. }

29.

30. public void notifyIncomingMessage(MessageConnection conn) {

31. //...

40. }

41.

42. public void run() {

43. Message msg = conn.receive();

44. //...

60. }

Which two security permissions must this application request to be able to receive messages?

(Choose two.)

A. javax.microedition.io.Connector

B. javax.microedition.io.PushRegistry

C. javax.microedition.io.Connector.sms

D. javax.wireless.messaging.sms.receive

E. javax.wireless.messaging.sms.listener

F. javax.wireless.messaging.sms.PushRegistry


Options are :

  • F,D
  • A,D
  • C,D
  • C,E

Answer : C,D

Given:

14. Canvas canvas;

15. // ...

24. canvas.repaint(10,10,20,20);

25. canvas.serviceRepaints();

What occurs when serviceRepaints() is called?



Options are :

  • The application blocks until the paint() method returns.
  • The application blocks until the repaint() method returns.
  • The application immediately calls the paint() method.
  • The application immediately calls the repaint() method.

Answer : The application blocks until the paint() method returns.

What is the minimum configuration that JTWI 1.0 requires?



Options are :

  • CLDC 1.1
  • no specific configuration
  • CLDC 1.0
  • CDC

Answer : CLDC 1.0

310-110 Sun Certified Mobile Application Developer for J2ME Set 4

Given a MIDlet suite with the following JAD file:

1. MIDlet-1: MyMIDlet, MyMIDlet.png, MyMIDlet

2. MIDlet-Jar-Size: 23040

3. MIDlet-Name: MyFirstMIDlet

4. MIDlet-Version: 1.0

5. MIDlet-Jar-URL: http://mywebserver.com/mymidlets/MyMIDlet.jar

6. MIDlet-Vendor:

MyCompany and manifest file:

1. MIDlet-Name: MyFirstMIDlet

2. MIDlet-Version: 1.1

3. MIDlet-Vendor: MyCompany

4. MIDlet-1: MyMIDlet, MyMIDlet.png,

MyMIDlet Which is true about the installation?



Options are :

  • The installation fails due to an attribute mismatch.
  • The installation succeeds.
  • The installation fails because the manifest is invalid.
  • The installation fails because the JAD file is invalid.

Answer : The installation fails due to an attribute mismatch.

Which four are direct subclasses of Screen? (Choose four.)

A. List

B. Form

C. Alert

D. Canvas

E. Choice

F. TextBox

G. TextField


Options are :

  • D,B,C,F
  • A,B,C,F
  • A,D,C,F
  • A,B,C,D

Answer : A,B,C,F

Which two are provided through a WMA 1.1 Message interface? (Choose two.)

A. data

B. header

C. address

D. timestamp


Options are :

  • C,D
  • B,D
  • C,B
  • C,A

Answer : C,D

310-110 Sun Certified Mobile Application Developer for J2ME Set 5

Which three dimensions of a standard-size application does the JTWI 1.0 specification define?

(Choose three.)

A. JAR size

B. JAD size

C. heap size

D. screen size

E. RMS data size


Options are :

  • A,B,C
  • D,B,E
  • A,B,E
  • D,B,C

Answer : A,B,E

Given:

11. String base = "44";

12. for(int ccnt=0; ccnt < 5; ccnt++) {

13. try {

14. String temp = base + Integer.toString(ccnt);

15. PushRegistry.registerConnection

16. ("datagram://:" + temp, MIDletName, "*");

17. break;

18. } catch (IOException x) {

19. continue;

20. }

21. }

Which two are true? (Choose two.)

A. registers 5 datagram connections for use by the MIDlet specified in MIDletName

B. attempts a number of times to register a datagram connection for use by the MIDlet specified

by MIDletName

C. guarantees that at least 1 datagram connection will be registered for use by the MIDlet

specified by MIDletName

D. attempts to reserve a datagram connection for the MIDlet specified by MIDletName, even

though the MIDlet may NOT depend on push

connections


Options are :

  • B,D
  • A,D
  • B,A
  • B,C

Answer : B,D

Which method in Canvas is overridden in GameCanvas?



Options are :

  • flushGraphics(int, int, int, int)
  • paint()
  • flushGraphics()
  • getGraphics()
  • getKeyStates()

Answer : paint()

310-110 Sun Certified Mobile Application Developer for J2ME Set 6

Given a MIDlet that specifies a push registration in the JAD file as:

MIDlet-Push-1: socket://:79, com.sun.example.SampleChat, *

What is the result when the MIDlet is installed onto a device where another MIDlet has already

registered the exact same push connection in the PushRegistry?



Options are :

  • The MIDlet installs, but the connection CANNOT be used.
  • The MIDlet installs and overwrites any existing push registrations.
  • The MIDlet installs, but the MIDlet must register the connection dynamically.
  • The connection can only apply to the currently running MIDlet.
  • The MIDlet installation is aborted and the user is notified of the problem.

Answer : The MIDlet installation is aborted and the user is notified of the problem.

A MIDlet suite has several signer certification paths using X.509 PKI. Which is true?



Options are :

  • A JTWI device must validate all the certification paths to install the MIDlet suite. The signer certificates may contain different public keys.
  • A JTWI device must validate all the certification paths to install the MIDlet suite. The signer certificates must contain the same public keys.
  • A JTWI device needs to only validate one of the certification paths to install the MIDlet suite. The signer certificates may contain different public keys.
  • A JTWI device needs to only validate one of the certification paths to install the MIDlet suite. The signer certificates must contain the same public keys.

Answer : A JTWI device needs to only validate one of the certification paths to install the MIDlet suite. The signer certificates must contain the same public keys.

Which method is initially called when the MIDlet starts in response to a push notification?



Options are :

  • PushRegistry.listConnections()
  • MIDlet.resumeRequest()
  • MIDlet.pushApp()
  • MIDlet.startApp()
  • MIDlet.notifyApp()
  • PushRegistry.notifyIncomingConnection()

Answer : MIDlet.startApp()

310-110 Sun Certified Mobile Application Developer for J2ME Set 7

Which two events can result in the removal of a MIDlet's dynamic push connection registration?

(Choose two.)

A. When the MIDlet is uninstalled.

B. When MIDlet.destroyApp() is called.

C. Opening the connection using Connector.open().

D. Using a call to PushRegistry.removeConnection().

E. Using a call to PushRegistry.registerConnection().

F. Using a call to PushRegistry.unregisterConnection().


Options are :

  • E,F
  • A,D
  • A,E
  • A,F

Answer : A,F

Which two are true regarding error handling for classes that exist in both CLDC and J2SE?

(Choose two.)

A. The set of error classes is essentially the same in CLDC and J2SE.

B. The set of error classes is much reduced in CLDC to help reduce the overhead of the JVM.

C. If a class throws an error in CLDC, it should throw the same error as in J2SE or its nearest

superclass.

D. There is no correspondence between the errors defined by CLDC and J2SE because the needs

of CLDC and J2SE are so different.


Options are :

  • B,A
  • B,D
  • B,C
  • A,C

Answer : B,C

Given:

10. //...

20. try {

21. Hashtable table = new Hashtable();

22. for (;;) table.put(new Object(), new Object());

23. } catch (OutOfMemoryException e) {

24. Display.getDisplay().setCurrent(new Alert("Out of Memory!"));

25. }

26. //...

Which is true?



Options are :

  • Compilation fails.
  • Out of Memory! is printed to the system console.
  • The program hangs at line 22.
  • An exception is thrown at runtime but there is no guarantee an alert will be shown to the user.

Answer : An exception is thrown at runtime but there is no guarantee an alert will be shown to the user.

310-110 Sun Certified Mobile Application Developer for J2ME Set 8

Assuming an application descriptor contains: MIDlet-Data-Size: 4096 Which is true?



Options are :

  • The device will use 4096 bytes to buffer data the application receives over the network.
  • The device will use 4096 bytes to buffer data the application sends over the network.
  • The device will permanently reserve 4096 bytes of heap space for the application.
  • The device will permanently reserve 4096 bytes of RMS space for the application.

Answer : The device will permanently reserve 4096 bytes of RMS space for the application.

Given the MIDlet code:

12. File f = new File("myFile.txt");

13. FileOutputStream ds = new FileOutputStream(f);

14. OutputStreamWriter os = new OutputStreamWriter(ds);

15. BufferedWriter buf = new BufferedWriter(os);

16. buf.write('c');

What is the result?



Options are :

  • Compilation succeeds, but an exception is thrown at runtime.
  • Compilation fails because the code uses one or more classes, which are not supported in CLDC 1.1.
  • The code compiles and runs, but line 16 is ignored.
  • The code compiles and runs, and then writes the character c to the file myFile.txt.

Answer : Compilation fails because the code uses one or more classes, which are not supported in CLDC 1.1.

A MIDP 2.0 developer is building a game using the MIDP game API that requires user control over

the direction of a Sprite within a GameCanvas. The developer wants to keep performance high

and reduce memory use. Which two fulfill the goals? (Choose two.)

A. suppress key events for the GameCanvas object

B. implement keyPressed(), keyReleased(), and keyRepeated()

C. poll for the current state of user key input in a loop, using getKeyStates()

D. in the GameCanvas object, use actual key codes rather than mapped game action constants


Options are :

  • A,D
  • A,C
  • A,B
  • D,C

Answer : A,C

310-110 Sun Certified Mobile Application Developer for J2ME Set 9

Which is true regarding the use of Thread objects in a CLDC 1.1 compliant virtual machine?



Options are :

  • There is no way for one Thread to force another Thread to stop.
  • To stop a Thread, a developer can use the stop() method.
  • A Thread lives until it exits from the run() method it invoked at startup.
  • A Thread can be stopped only from the inside of a MIDlet class.

Answer : A Thread lives until it exits from the run() method it invoked at startup.

Which two are true about the javax.wireless.messaging.MessageConnection interface? (Choose

two.)

A. It provides methods to create Connector objects.

B. This interface is intended for all wireless messaging protocols.

C. Threads that are waiting to receive messages must be blocking threads.

D. An application can have both client and server mode MessageConnection instances open

simultaneously.

E. When creating a client mode message, a string that identifies an endpoint on the local host

should be passed to Connector.open().


Options are :

  • B,D
  • E,D
  • B,E
  • B,A

Answer : B,D

Given:

12. class TestRecordListener implements RecordListener {

13. public void recordAdded(RecordStore rcs, int recordId) {

14. // ...

25. }

26. public void recordDeleted(RecordStore rcs, int recordId) {

27. // ...

33. }

34. public void recordChanged(RecordStore rcs, int recordId) {

35. // ...

43. }

44. }

If rs is a valid and open record store, how can you properly associate a record listener with rs?



Options are :

  • rs.setRecordListener(new TestRecordListener())
  • rs.createRecordListener(new TestRecordListener())
  • rs.newRecordListener(new TestRecordListener())
  • rs.addRecordListener(new TestRecordListener())

Answer : rs.addRecordListener(new TestRecordListener())

Sun 310-110 Certified Mobile Application Developer for Exam Set 1

Which three statements are true regarding the handling of wireless connections? (Choose three.)

A. The connection could unexpectedly terminate while processing the input or output streams.

B. Network connections should never be performed on a separate thread, so problems can be

handled quickly.

C. Devices can only support one HttpConnection at a time; therefore, network access from

multiple threads must be serialized.

D. A network connection could interfere with other services on the device, such as the ability to

receive phone calls or SMS on a phone.

E. Performing network operations on the same thread used by the display is likely to block

refreshes of the display until the network operations complete.


Options are :

  • C,D,E
  • A,C,E
  • A,D,E
  • A,D,C

Answer : A,D,E

Which JAD attribute must be present to begin the MIDlet suite authentication process using X.509

PKI?



Options are :

  • MIDlet-Permission
  • MIDlet-Jar-RSA-SHA1
  • MIDlet-Permission-Opt
  • MIDlet-Certificate-n-m

Answer : MIDlet-Jar-RSA-SHA1

Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions