java - How to install J2ME .jar files in remote devices without pairing? -
I am developing a J2ME application to run in public areas, such as supermarkets, shopping centers, etc. Therefore, I want to make it possible to set up my application in every mobile phone around Bluetooth. I intend to create a separate J2SE application to search for a device and view the obex services. After that, ask the user to install the application.
I have tried using javax.microedition.io.Connector, but it always requires both side (client and server) passkey
OBEXClientSessionImpl conn = (OBEXClientSessionImpl) connector. Open (service URL);
I have also found what I want, but pair problem persists.
Can you definitely send files to a program via Bluetooth or use a fixed pin number, so I can not repeat it on the server side?
Thanks in advance,
I used to use Nilekov in the same way Has developed a Java application that shows you (scan and attempt to transfer file on all devices) and worked fine on initial tests. I'm considering midterm to open or sell the device in the future.
To answer your question, which I use (simplified version) is something like this:
// tud: Scan for devices // @TODO: Obex push service string tool for detection of each device, Obex url = service records [i] .getConnectionURL (service record. Nyuthentic doanrrrp, incorrect); // send the file client session client session = (client session) connector.open (deviceboxes url); Headset hsConnectReply = client session. Connect (tap); If (hsConnectReply.getResponseCode ()! = ResponseCodes.OBEX_HTTP_OK) {return false; } Byte data [] = readAllFile (file); Headset Set TopSets = Client Sessions .createHeaderSet (); HeaderSet.setHeader (headerset.name, file.getName ()); HeaderSet.setHeader (headset.tepie, mimetype); HeaderSet.setHeader (HeaderSet.LENGTH, new long (data.length)); Operation session = Client session. Input (headset); OutputStream Output Stream = op.openOutputStream (); // @TODO: Write all data and close output streams, sessions and client sessions
Comments
Post a Comment