检查黑莓通过USB连接 [英] Check blackberry is connected via USB

查看:158
本文介绍了检查黑莓通过USB连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做的这些访问SD /多媒体卡以显示其图像的应用程序。但是,当设备通过USB连接我无法访问介质卡。如果多数民众赞成的情况下,我想显示一条消息,用户要求他断开装置形式的计算机。

I am doing an application which access the SD/Media card to display its images. But when device is connected via USB I cant access the media card. If thats the case, I want to show a message to user asking him to disconnect device form computer.


  1. 如何编程检查SD卡可访问或不?

  2. 如何检查设备是否通过USB?连接到计算机

感谢。

推荐答案

我不知道你的有关检查设备文件系统是否通过USB安装在计算机上的第二个问题,但是对于第一个问题,检查可用文件系统,叫<一个href=\"http://www.blackberry.com/developers/docs/7.1.0api/javax/microedition/io/file/FileSystemRegistry.html\"相对=nofollow> FilesystemRegistry .listRoots(),这将返回一个String对象的枚举。如果SD卡/是枚举,那么SD卡可用。

I am not sure about your second question about checking whether the device filesystem is mounted via USB on a computer, but as for the first question, to check the available filesystems, call FilesystemRegistry.listRoots(), which will return an Enumeration of String objects. If "SDCard/" is in the enumeration, then the SDCard is available.

一些设备还可以存储在设备存储图像为好,这是从SD卡截然不同。在这种情况下,检查存储/作为文件系统的根目录。

Some devices can also store images on the device storage as well, which is distinct from the SDCard. In that case, check for "store/" as the filesystem root.

这篇关于检查黑莓通过USB连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆