Skip to main content

rim implemetation for lwuit io

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
3 replies [Last post]
buffon
Offline
Joined: 2010-09-29

how do i use the Rimimplementation for blackberry as using the default lwuit io for midp gives me a java.io.ioexception: APN is not specified. which i think the rim implementation should address. thanks

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
vprise
Offline
Joined: 2003-11-07

Yep we need to address this.

Generally this can be resolved by using the undocumented IOImplementation API of getAPIds and picking an access point.

Unfortunately RIM seems to think that having a Connector.open(url) that doesn't work is a valid device configuration.

buffon
Offline
Joined: 2010-09-29

Pls can you give example of using the ioimplementation to connect with a blackberry BIS . Thanks again

vprise
Offline
Joined: 2003-11-07

This is all "undocumented" so keep in mind this probably won't work with the next version of LWUIT (which might not be a problem since we will probably fix this issue):

The algorithm is rather complex and RIM has quite a few videos on the problem, the main reason we couldn't integrate it into LWUIT is that we don't have "a server" which is required to get the algorithm to work properly.

First try to connect to a server - if this works just do nothing and use that.

Assuming this doesn't work get the access point id's available:

</p>
<p>IOImplementation ioImp = IOImplementation.getInstance();</p>
<p>String[] ap = ioImp.getAPIds();</p>
<p>

Then pick the best AP, by using getAPType(apId) which returns a NetworkManager.ACCESS_POINT_TYPE_* value and try that address against your server.

Repeat until you actually get a connection.