use option std c99 or std gnu99 to compile your code

来源:互联网 发布:阿里云 客户案例 编辑:程序博客网 时间:2024/05/16 13:42
      //获得本设备的蓝牙适配器实例
        /**Return:the default local adapter, or null if Bluetooth is not supported on this hardware platform */
        mbta=BluetoothAdapter.getDefaultAdapter();
        if(mbta==null){
        AlertDialog.Builder builder=new AlertDialog.Builder(this);
        builder.setTitle("警告")
        .setMessage("此设备不支持蓝牙")
        .setPositiveButton("确定",null)
        .show();
        return;

        }

  • android自带的base64编码
  • 首先导入包
  • import android.util.Base64;
  • String 变量=android.util.Base64.encodeToString(字符串.getBytes(),Base64.DEFAULT);
  • 也可简写为
  • String 变量=Base64.encodeToString(字符串.getBytes(),Base64.DEFAULT);
  • 至于解码
  • byte b[]=android.util.Base64.decode(字符串,Base64.DEFAULT);
  • String 变量=new String(b);
  • byte b[]=android.util.Base64.decode(字符串,Base64.DEFAULT);

//use option std c99 or std gnu99 to compile your code

LOCAL_CFLAGS +=    -std=c99 

0 0
原创粉丝点击