Loicsadou / bluecove

Automatically exported from code.google.com/p/bluecove
0 stars 0 forks source link

Call System.setProperty("microedition.connection.pkgs", "com.intel.bluetooth"); #17

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
This is an optional enhancement instead of a bug.  Currently to use
Connector.open() on IBM's J9 implementation
"-Dmicroedition.connection.pkgs=com.intel.bluetooth" needs to be passed in
on the command line.  However, if BlueCove had
"System.setProperty("microedition.connection.pkgs",
"com.intel.bluetooth");" in it that configuration is not required.  This
should result in fewer support incidents.

Also most people on Windows Mobile devices run J9 by launching is
"emulator.exe" executable from the device's Explorer.  That does not allow
for command line options.  This makes it much more difficult to run an
application because RAPI_Start or the device's keyboard need to be used.

Avetana does not require this command line configuration so it must be
possible.  However, there are several problems:
 * System.setProperty is not part of the MIDP 2.0 specification.  It is
implemented on J9, but probably not on other JVMs.
 * System.setProperty must be called before the user's code calls
Connector.open().  I am not sure where this can be put to be enforced.  For
example if the user's application stores a Bluetooth address in RMS,
restarts, and tries to establish a connection right away without doing
dynamic discovery or anything, will BlueCove ever get instantiated to call
System.setProperty?

It is not necessary to check if that property has been set from the command
line.  J9 allows duplicates.  So the following code works:

   String prop = System.getProperty("microedition.connection.pkgs");
   if (prop == null) {
      prop = "com.intel.bluetooth";
   } else {
      prop += "|com.intel.bluetooth";
   }
   System.setProperty("microedition.connection.pkgs", prop);

Original issue reported on code.google.com by deanbro...@gmail.com on 2 Sep 2007 at 5:45

GoogleCodeExporter commented 8 years ago
I figured out how to do this.  It actually isn't using System.setProperty(), but
renaming the packages from com.intel.bluetooth.*.Connection to
com.ibm.oti.connection.*.Connection.

Original comment by deanbro...@gmail.com on 6 Sep 2007 at 6:40

GoogleCodeExporter commented 8 years ago
Fixed in version 2.0.2-SNAPSHOT

Original comment by skarzhev...@gmail.com on 9 Sep 2007 at 12:50

GoogleCodeExporter commented 8 years ago

Original comment by skarzhev...@gmail.com on 9 Sep 2007 at 5:29