当前位置: 首页 > news >正文

建网站问题怎么样制作一个网页

建网站问题,怎么样制作一个网页,招远做网站联系电话,徐州cms建站模板目录 一、前提 1. unity打包android后#xff0c;链接USB摄像头#xff0c;需要USB权限。 二、流程 1.Unity导出android工程#xff0c;Player配置如图#xff1a; 2.导出android工程 3.在android工程中找到AndroidManifest.xml加入usb权限相关 ?xml version链接USB摄像头需要USB权限。 二、流程 1.Unity导出android工程Player配置如图 2.导出android工程 3.在android工程中找到AndroidManifest.xml加入usb权限相关 ?xml version1.0 encodingutf-8? manifest xmlns:androidhttp://schemas.android.com/apk/res/androidxmlns:toolshttp://schemas.android.com/toolsapplication android:extractNativeLibstrueactivity android:namecom.unity3d.player.UnityPlayerActivity android:themestyle/UnityThemeSelector android:screenOrientationfullSensor android:launchModesingleTask android:configChangesmcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density android:resizeableActivityfalse android:hardwareAcceleratedfalseintent-filteraction android:nameandroid.intent.action.MAIN /category android:nameandroid.intent.category.LAUNCHER ///此处action android:nameandroid.hardware.usb.action.USB_DEVICE_ATTACHED //intent-filtermeta-data android:nameunityplayer.UnityActivity android:valuetrue /meta-data android:nameandroid.notch_support android:valuetrue //activitymeta-data android:nameunity.splash-mode android:value0 /meta-data android:nameunity.splash-enable android:valueTrue /meta-data android:nameunity.launch-fullscreen android:valueTrue /meta-data android:nameunity.allow-resizable-window android:valueFalse /meta-data android:namenotch.config android:valueportrait|landscape //applicationuses-feature android:glEsVersion0x00020000 /uses-permission android:nameandroid.permission.INTERNET /uses-permission android:nameandroid.permission.CAMERA ///此处uses-feature android:nameandroid.hardware.usb.host ///此处uses-permission android:nameandroid.permission.USB_PERMISSION /uses-feature android:nameandroid.hardware.camera android:requiredfalse /uses-feature android:nameandroid.hardware.camera.autofocus android:requiredfalse /uses-feature android:nameandroid.hardware.camera.front android:requiredfalse /uses-feature android:nameandroid.hardware.touchscreen android:requiredfalse /uses-feature android:nameandroid.hardware.touchscreen.multitouch android:requiredfalse /uses-feature android:nameandroid.hardware.touchscreen.multitouch.distinct android:requiredfalse / /manifest 备注主要三行如下 action android:nameandroid.hardware.usb.action.USB_DEVICE_ATTACHED / uses-feature android:nameandroid.hardware.usb.host / uses-permission android:nameandroid.permission.USB_PERMISSION / 4.找到UnityPlayerActivity.java在unity启动onResume方法里面新增打开USB权限设置 private static final String TAG unity;private static final String ACTION_USB_PERMISSION com.android.usb.USB_PERMISSION;private UsbManager usbManager;private UsbDeviceConnection connection;private PendingIntent permissionIntent;private boolean permissionGranted false;private BroadcastReceiver usbReceiver new BroadcastReceiver() {Overridepublic void onReceive(Context context, Intent intent) {String action intent.getAction();Log.d(TAG, USB设备连接有变化,链接到:action);if (ACTION_USB_PERMISSION.equals(action)) {synchronized (this) {unregisterReceiver(usbReceiver);UsbDevice usbDevice intent.getParcelableExtra(UsbManager.EXTRA_DEVICE);if (intent.getBooleanExtra(UsbManager.EXTRA_PERMISSION_GRANTED, false)) {if (usbDevice ! null) {// 用户已授权访问USB设备connectUsbDevice(usbDevice);}} else {Log.d(TAG, 用户未授权访问USB设备); // requestPermission(usbDevice);}}}}};// Resume UnityOverride protected void onResume(){super.onResume();if (MultiWindowSupport.getAllowResizableWindow(this))return;mUnityPlayer.resume();openUsbDevice();}private void openUsbDevice(){// //获取注册usbusbManager (UsbManager) getSystemService(Context.USB_SERVICE);IntentFilter filter new IntentFilter(ACTION_USB_PERMISSION);// 获取已连接的USB设备列表HashMapString, UsbDevice deviceList usbManager.getDeviceList();IteratorUsbDevice deviceIterator deviceList.values().iterator();if (deviceIterator.hasNext()) {UsbDevice device deviceIterator.next();permissionIntent PendingIntent.getBroadcast(this, 0, new Intent(ACTION_USB_PERMISSION), 0);filter.addAction(UsbManager.ACTION_USB_DEVICE_ATTACHED);filter.addAction(UsbManager.ACTION_USB_DEVICE_DETACHED);Log.e(TAG, getDeviceList: device.getVendorId()device.getProductId());///注册广播registerReceiver(usbReceiver, filter);usbManager.requestPermission(device, permissionIntent);} else {Log.d(TAG, 没有找到已连接的USB设备);Toast.makeText(this, 没有找到已连接的USB设备, Toast.LENGTH_SHORT).show();}}private void connectUsbDevice(UsbDevice usbDevice) {if (usbDevice null) {return;}connection usbManager.openDevice(usbDevice);if (connection ! null) {// 在此处执行USB通信操作Log.d(TAG, USB设备已连接);Toast.makeText(this, USB设备已连接, Toast.LENGTH_SHORT).show();} else {Log.d(TAG, 无法打开USB设备连接);Toast.makeText(this, 无法打开USB设备连接, Toast.LENGTH_SHORT).show();}} 注意应用需要打开摄像机权限
http://www.w-s-a.com/news/742030/

相关文章:

  • 张家界做网站买了网站模版怎么做
  • 六安品牌网站建设怎么样知名商城网站建设报价
  • 怎么上传自己做的网站杭州网站建设公司平台
  • 网站开发程序是什么知名的电子商务网站
  • 做pc端网站好么平台推广是什么意思
  • 农业信息网站建设意义淘宝官网首页网址
  • 重庆网站设计公司价格贵阳网站建设app开发
  • dw做网站怎么换图片编写网页所用的语言是
  • 外贸网站收录工具个人网站的备案
  • 正规的网站建设工作室海外高延迟服务器做网站
  • 网站设计确认函合肥做网站维护的公司
  • 小说网站推荐网站开发语言怎么查
  • 网页制作基础教程慕课版电子版那种登录才能查看的网站怎么做优化
  • 制作网站用的域名网站域名注册信息查询
  • 公司域名查询官方网站女教师遭网课入侵直播录屏曝
  • 网站开发社交网络功能的作用腾讯公司网站
  • 网站建设需要微信账号和密码网站建设工作汇报
  • 国家城乡住房和建设部网站西安私人网站
  • 天津高端网站定制seo实战教程
  • 网站文章怎么做才能被快速收录网站备案核验系统
  • 子网站建设方案l建设银行网站
  • 免费看舆情网站网站备案用户名忘了怎么办
  • 地方门户网站的分类网站的方案
  • 沧州哪里做网站网站的建设是什么
  • 设计公司海报秦皇岛seo网站推广
  • 网站导航规划wordpress做漫画
  • jsp体育用品网站建设wordpress 10万篇文章
  • 沈阳做微信和网站的公司网站在线支付接口
  • 重庆整合网络营销百度seo快速提升排名
  • 设计师网站外网百度分析工具