Solved

platformRequest(url) not compiling

Posted on 2004-05-03
5
1,154 Views
Last Modified: 2007-12-19
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
Comment
Question by:vmmattil
5 Comments
 
LVL 92

Accepted Solution

by:
objects earned 500 total points
ID: 10976135
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
 
LVL 21

Expert Comment

by:tovvenki
ID: 10976459
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
 

Author Comment

by:vmmattil
ID: 10976494
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
 
LVL 92

Expert Comment

by:objects
ID: 10982202
not sure sorry.
0
 
LVL 13

Expert Comment

by:Webstorm
ID: 11040968
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question