obex

How to send file using bluetooth on android programatically?

落爺英雄遲暮 提交于 2019-11-26 18:57:05
I need to send file to a computer instead of another android application. I have looked at the bluetooth api, but it only allow connection as client-server. In my case I dont know what UUId would be on the computer. Do I need to look at obex. I haven't used it before. So any help would be benficial. Try this. I can send a file using this code. ContentValues values = new ContentValues(); values.put(BluetoothShare.URI, "file:///sdcard/refresh.txt"); values.put(BluetoothShare.DESTINATION, deviceAddress); values.put(BluetoothShare.DIRECTION, BluetoothShare.DIRECTION_OUTBOUND); Long ts = System

How to send file using bluetooth on android programatically?

此生再无相见时 提交于 2019-11-26 06:43:25
问题 I need to send file to a computer instead of another android application. I have looked at the bluetooth api, but it only allow connection as client-server. In my case I dont know what UUId would be on the computer. Do I need to look at obex. I haven\'t used it before. So any help would be benficial. 回答1: Try this. I can send a file using this code. ContentValues values = new ContentValues(); values.put(BluetoothShare.URI, "file:///sdcard/refresh.txt"); values.put(BluetoothShare.DESTINATION,