How to unpair or delete paired bluetooth device programmatically on android?

This code works for me. private void pairDevice(BluetoothDevice device) { try { if (D) Log.d(TAG, “Start Pairing…”); waitingForBonding = true; Method m = device.getClass() .getMethod(“createBond”, (Class[]) null); m.invoke(device, (Object[]) null); if (D) Log.d(TAG, “Pairing finished.”); } catch (Exception e) { Log.e(TAG, e.getMessage()); } } private void unpairDevice(BluetoothDevice device) { try { Method m = device.getClass() … Read more

Looking for ways for a robot to locate itself in the house

The problem of figuring out a robot’s position in its environment is called localization. Computer science researchers have been trying to solve this problem for many years, with limited success. One problem is that you need reasonably good sensory input to figure out where you are, and sensory input from webcams (i.e. computer vision) is … Read more

Convert a String to a byte array and then back to the original String

I would suggest using the members of string, but with an explicit encoding: byte[] bytes = text.getBytes(“UTF-8”); String text = new String(bytes, “UTF-8”); By using an explicit encoding (and one which supports all of Unicode) you avoid the problems of just calling text.getBytes() etc: You’re explicitly using a specific encoding, so you know which encoding … Read more

Arduino Tools > Serial Port greyed out

chdmod works for my under debian (proxmox): # chmod a+rw /dev/ttyACM0 For installing arduino IDE: # apt-get install arduino arduino-core arduino-mk Add the user to dialout group: # gpasswd -a user dialout Restart Linux. Try with the File > Examples > 01.Basic > Blink, change the 2 delays to delay(60) and click the upload button … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)