Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1193
  • Last Modified:

platformRequest(url) not compiling

I have developed a small Midlet with the SUN J2ME Wireless Toolkit. I want to open the system browser with the platformRequest -method, but cannot compile. Code is:

if (c == openCommand) {
                  platformRequest("http://www.fi");
            }

When trying to compile, I get the error:  javax.microedition.io.ConnectionNotFoundException

In the WTK (2.1) system.config file, I have defined:
# platform request
com.sun.midp.midlet.platformRequestCommand: "C:\Program Files\Opera75\opera.exe"

What is wrong!?

0
vmmattil
Asked:
vmmattil
1 Solution
 
objectsCommented:
if c and openCommand are strings then you should be using:

if (c.equals(openCommand)) {

if platformRequuest throws an exception you need to handle it:
eg.

try {
   platformRequest("http://www.fi");
}
catch (Exception ex) {
// handle exception
}
0
 
tovvenkiCommented:
Hi,
if the platform cannot handle the URL requested then  it throws the ConnectionNotFoundException so you need to catch it as objects has specified.

venki
0
 
vmmattilAuthor Commented:
Thanks objects,

it is now working on the WTK 2.1 emulator! Just needed to catch the exception.

Wonder how it will work on a real phone, I have heard that most phones cannot handle the platformRequest() -method. Has anyone experience about it?

-M
0
 
objectsCommented:
not sure sorry.
0
 
WebstormCommented:
Hi vmmattil,

>> Wonder how it will work on a real phone...

All MIDP2.0 compliant phones must accept this method. If not, the problem should be corrected by manufacturers.

Some links about the platformRequest() method :
http://www3.symbian.com/faq.nsf/0/5BDC512BFC1222AF80256E76003B6D0E?OpenDocument
http://www.burningdoor.com/steve/archives/cat_mobile_dev.html
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now