Solved

platformRequest(url) not compiling

Posted on 2004-05-03
5
1,165 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
type mismatch (Object[] to double[] 4 41
Which non-HTML GUI front end to use with Java? 3 52
Setup GlassFish 4 34
junit as external jar or library 7 37
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

756 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