使用蓝牙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 (将#修改为@)