如何解决使用蓝牙OBEX对象推送配置文件OPP发送文件的Android应用程序
|| 我尝试了以下应用程序示例,用于通过Android Froyo中的Bluetooth OPP发送文件。 请为此提出任何解决方案,谢谢。 我的申请代码:public class BtAppExample extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
String filePath = Environment.getExternalStorageDirectory().toString() + \"/Munnar/1.jpg\";
Log.e(\"BtAppExample\",\"Uri is: \"+Uri.fromFile(new File(filePath)).toString());
ContentValues values = new ContentValues();
values.put(BluetoothShare.URI,Uri.fromFile(new File(filePath)).toString());
values.put(BluetoothShare.DESTINATION,\"90:4C:E5:D9:0E:D0\");
values.put(BluetoothShare.DIRECTION,BluetoothShare.DIRECTION_OUTBOUND);
Long ts = System.currentTimeMillis();
values.put(BluetoothShare.TIMESTAMP,ts);
Uri contentUri = getContentResolver().insert(BluetoothShare.CONTENT_URI,values);
}
}
我的清单文件:
<application android:icon=\"@drawable/icon\" android:label=\"@string/app_name\">
<activity android:name=\".BtAppExample\"
android:label=\"@string/app_name\">
<intent-filter>
<action android:name=\"android.intent.action.MAIN\" />
<category android:name=\"android.intent.category.LAUNCHER\" />
</intent-filter>
</activity>
</application>
<uses-permission android:name=\"android.permission.ACCESS_BLUetoOTH_SHARE\" />
<uses-permission android:name=\"android.permission.BLUetoOTH\" />
<uses-permission android:name=\"android.permission.BLUetoOTH_ADMIN\" />
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。