Solved

platformRequest(url) not compiling

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
splitOdd10 challenge 5 80
where is session ID cache stored 1 47
get weblogic logged in user in java 2 58
Arrays.asList  VS  ArrayList 4 45
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…
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…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

920 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

13 Experts available now in Live!

Get 1:1 Help Now