android Bluetooth通信について

78 views
Skip to first unread message

枡田和紘

unread,
Sep 18, 2014, 3:55:21 PM9/18/14
to android-g...@googlegroups.com
お世話になります。現在情報系の大学に通う4回の者です。
現在、Vuzix M100で撮影した動画をPCに送るというプログラムを組んでおります。
今現在、android端末で自作した動画をギャラリーに保存するところまでは進めたのですが、Bluetooth通信を用いた動画の送信方法がわからず困っております。

Bluetooth通信を用いた動画の送信についての情報が少なく、どのようにプログラムを構築していけばいいのかわかりかねている状況です。
端末側とPC側、双方に送受信のプログラムを構築しなければならないのでしょうか?

至らない私ですが、何かヒントを頂ければと思っております。

よろしくお願い申し上げます。

mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();

mBtDevice = mBluetoothAdapter.getRemoteDevice("00:1B:DC:0F:79:2D");
try {
mBtSocket = mBtDevice.createRfcommSocketToServiceRecord(UUID
.fromString("00001101-0000-1000-8000-00805F9B34FB"));
} catch (IOException e) {
e.printStackTrace();
}      
try {
mBtSocket.connect();
mOutput = mBtSocket.getOutputStream(); // 出力ストリームオブジェクトを得る
// try{
 String string ="";
 byte[] byteString = string.getBytes();
mOutput.write('a');
Toast.makeText(getApplicationContext(), "Sent "+string, Toast.LENGTH_SHORT).show();
// }catch (IOException e) {
// e.printStackTrace();
// }
} catch (IOException e) {
e.printStackTrace();
}
Reply all
Reply to author
Forward
0 new messages