views:

12

answers:

0

Hi,

I want to be able to launch native and j2me applications through my application, using the content handler api (jsr 211) on a Nokia 6212.

At the moment I am unable to do so as it always states that there is No Content Handler Found and throws a javax.microedition.content.ContentHandlerException.

Atm I am trying to get the phone to launch it's browser and go to a certain website, just to test that I can use the framework. I have tried many different Invocation objects...

//throw exceptions
new Invocation("http://www.somesite.com/index.html","application/internet-shortcut");
new Invocation("http://www.google.co.uk","text/html");
new Invocation("http://www.somesite.com/text.txt","text/plain"); //a long shot a know
new Invocation("http://www.google.co.uk","application/browser"); //massive long shot

//appears to download the link and content (and definately does in the Nokia emulator) //and then throws an exception
new Invocation("http://www.google.co.uk");
new Invocation("http://www.somesite.com/index.html");

Here below is the code that I have been using, please bear in mind the parameters often changed to generate the different Invocation objects.

 /*
  * Invokes an application using the Content Handler API
  */
 public void doInvoke(String url, String mime, String payload){

  Registry register = Registry.getRegistry(this.getClass().getName());
  Invocation invoke = new Invocation(url, mime, null, false, ContentHandler.ACTION_OPEN);

  boolean mustQuit = false;

   try {
    mustQuit = register.invoke(invoke);

   } catch (IllegalArgumentException e) {

    e.printStackTrace();
   } catch (ContentHandlerException e) {

    e.printStackTrace();
   } catch (SecurityException e) {

    e.printStackTrace();
   } catch (IOException e) {

    e.printStackTrace();
   }

  if(mustQuit){
   this.quit();
  }
 }

Thank you in advance for your help!