Solved

platformRequest(url) not compiling

Posted on 2004-05-03
5
1,133 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now