Hi

There is a problem bothering me recently, when my phone version updated to 
4.2.2. I found there are changed as to Bluetooth Module. BT stack changed 
from bluez to bluedroid.

and i writed a simple apk to tets Bt opp file transfer. but result is 
failed. now. i paste some pieces of code and logcat ,  hope someone to hele 
me or give some suggestion.

code : 

ContentValues values =

*new* ContentValues(); 

values.put(BluetoothShare.

*URI*, Uri.*parse*("file:///storage/sdcard1/Test.mp3").toString()); 

values.put(BluetoothShare.*DESTINATION*, mydevice.getAddress());

values.put(BluetoothShare.*MIMETYPE*, "*/*");

values.put(BluetoothShare.*FILENAME_HINT*, "Opp_Test.mp3"); 

values.put(BluetoothShare.*DIRECTION*, BluetoothShare.*DIRECTION_OUTBOUND*);

Long ts = System.*currentTimeMillis*();

values.put(BluetoothShare.TIMESTAMP,ts);

Uri contentUri=myContext.getContentResolver().insert(BluetoothShare.*
CONTENT_URI*, values);
logcat:
D/BtOppService( 1316): insertShare parsed URI: 
file:///storage/sdcard1/Test.mp3
D/BluetoothOppUtility( 1316): getSendFileInfo: 
uri=file:///storage/sdcard1/Opp_Test.mp3
E/BtOppService( 1316): Can't open file for OUTBOUND info 91 --->Failed
D/BluetoothOppUtility( 1316): closeSendFileInfo: 
uri=file:///storage/sdcard1/Opp_Test.mp3
 
then I go 2  BtOppService this java file to check, find this exception is 
caused by 
catch (FileNotFoundException e) {
                        Log.e(TAG, "Can't open file for OUTBOUND info " + 
info.mId);
}
but this File exists in external SD card , and i add permission to access 
it.
 
BTW ,this method is workabled in andorid ICS/JB 4.1 
 
any one can help me?
 

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to