问题描述
我使用的是免费的JCIFS库通过CIFS连接到我的NAS设备,它的工作太棒了。我可以连接并获得文件名等的名单没有任何问题。
I'm using the free jCIFS library to connect to my NAS device via CIFS, and it's working great. I can connect and get a list of filenames, etc. without any issues.
现在我想开了默认的Android应用程序的文件之一 - 即音乐文件应该在音乐播放器中打开,图像库中的视频文件中的一个视频播放器等等。这个问题是不是真正的得到MIME类型等。问题是,我不希望首先下载的文件,他们应该是的流的。
Now I'd like to open one of the files in the default Android application - i.e. a music file should be opened in the music player, an image in the gallery, video file in a video player and so forth. The issue is not really about getting the MIME type and so on. The issue is that I don't want to download the files first, they should be streamed.
有谁知道这是如何实现的?我知道,CifsManager(其他第三方应用程序)能够做类似的事情,但它不使用JCIFS,它需要root访问权限来安装驱动器。重要的是,我的应用程序并不需要root权限。
Does anyone know how this can be achieved? I know that CifsManager (another third party application) is capable of doing something similar, but it doesn't use jCIFS and it requires root access to mount drives. It is essential that my application doesn't require root access.
您可以在这里找到JCIFS库: http://jcifs.samba.org/
You can find the jCIFS library here:http://jcifs.samba.org/
推荐答案
您可以使用 SmbFileInputStream 以读取文件。请通过文档 jcifs.smb.SmbFileInputStream
You can use the SmbFileInputStream to read the file.
Please go through the documentation jcifs.smb.SmbFileInputStream
这篇关于如何使用JCIFS Android中打开文件的默认浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!