Search Results

Search found 2 results on 1 pages for 'hia'.

Page 1/1 | 1 

  • bluetooth BluetoothSocket.connect() thread. how to close this thread

    - by Hia
    I am trying to make an android app that makes connection with bluetooth device. It works fine but when I call BluetoothSocket.connect() and it is not able to connect to devise its blocking. The thread and does not throw any exception. So when I try to close application while connect() is running its not responding. How can I cancel it? Used BluetoothSocket.close() in ... but still its not working for me. protected void simpleComm(Integer port) { // The documents tell us to cancel the discovery process. try { Method m = mmDevice.getClass().getMethod("createRfcommSocket", new Class[] { int.class }); mmSocket = (BluetoothSocket) m.invoke(mmDevice, port); mmSocket.connect(); // <== blocks untill is not connected Log.d(TAG, " connection success==="); }catch(Exception e){ if (!abort) { connectionFailed(); // Close the socket try { mmSocket.close(); // Start the service over to restart listening mode BluetoothService.this.start(); } catch (IOException e2) { Log.e(TAG,"unable to close() socket during connection failure", e2); } } return; } } public void cancel() { try { abort = true; mmSocket.close(); } catch (IOException e) { Log.e(TAG, "close() of connect socket failed", e); } }

    Read the article

  • Wireless keeps asking for password

    - by Lewis
    Hia I just installed 12.04 on my old ibook G3 (since i wiped the HDD) Now luckely i have a wifi-ethernet bridge on my pc to give the ibook intertnet but even when it is connected to eth0 (LAN) it keeps asking to connect to eth1(Wi-Fi) the router is using WPA2 Personal with AES I was just wondering, bescuse the router is upsatirs and the ibook is downstairs next to my PC. and the wifi connects upstairs, but I can't use it up there 'cos the batteiy is junk and i got no plugs that'll reach. Thanks in advance Lewis

    Read the article

1