Using HttpConnection in Avetana Application

Mike
2008-01-13
2013-04-15
  • Mike

    Mike - 2008-01-13

    I am trying to use javax.microedition.io.HttpConnection in a program where Avetana is included in the classpath to stream some information to a web server. Looking at the list of classes that Avetana "overrides" in order to get the Bluetooth stack working in emulated J2ME applications, I see the following:

        javax.microedition.io.Connection

    Now, in order to use HttpConnection, we need to create a Connection object as follows:

        HttpConnection c = (HttpConnection) Connector.open(url);

    This results in the exception with message:

    Error de.avetana.bluetooth.connection.BadURLFormat: Bar URL Format: URL must begin with the protocol name (btspp or btl2cap or btgoep)!

    This must be the case because it's trying to use the Bluetooth code for Connector, not the standard J2ME library from my emulator (Mpowerplayer on a Mac). My question is: how can I use HttpConnection in the same program as the Avetana library? Is there a way of specifying explicitly which class we want, even though they use the same import statement?

    Many thanks!

     
    • Moritz Gmelin

      Moritz Gmelin - 2008-01-13

      Hi,

      I know that this work in OS X and Windows, because MPowerPlayer overrides avetana's javax.microedition.io.Connector class with its own and the actual BT-Connection handling is handled with de.avetana.bluetooth.connection.Connector.

      What versions of MPowerPlayer and avetanaBluetooth are you using?

      Regards

      Moritz Gmelin

       
      • Mike

        Mike - 2008-01-13

        Hi. Thanks for your reply. I'm using MPowerPlayer Build 1185 (July 10 2006) and avetanaBluetooth build 18a (2007-11-08). Should be the latest versions.

         

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks