简体   繁体   中英

Android Bluetooth Send Private/Internal File using OBEX

Is it possible send file from Android application private directory via Bluetooth? (directory /data/data//.. (getFilesDir()))
i can't anywhere find and answer to this.

This and Intent.ACTION_SEND approach works fine with external files:
Sending a File using Bluetooth OBEX Object Push Profile (OPP)

However, when i try to send private file I get "Unknown file not sent"
WCat shows "BtOpp Service "Can't open file for OUTBOUND info 57"", when BtOpp throws FileNotFoundException

Thanks

String path = con.getFilesDir().getAbsolutePath() + File.separator  + TEMP_FILE_NAME; //i will get file from your /data/data/...
Intent i = new Intent(Intent.ACTION_SEND);
i.setType("plain/text");// 
i.putExtra(Intent.EXTRA_STREAM, Uri.parse("file:/" + path));
startActivity(Intent.createChooser(i, "Send File"));

hit accept if working.... Thanks

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM