【Android 冷知识】SMB协议转Http,实现视频在线播放
1.说明 为什么说是冷知识,因为大多数项目用不到,所以归类为冷知识。 本文主要介绍如何将SMB协议转换为常见的HTTP协议,以便利用各种播放器实现在线播放。本文与前篇《 利用SMB协议远程查看电脑文件或者其他存储设备 》存在关联。 2.用到的资源: cybergarage.jar(这个做好久了,具体地址找不到了,自己搜搜看看吧) 3.核心代码 PlayFileService.java ,需要在主配置文件中注册,并在应用启动或者需要转换的时候开启改服务。 package com . powerstick . service ; import org . cybergarage . http . HTTPServerList ; import android . app . Service ; import android . content . Intent ; import android . os . IBinder ; public class PlayFileService extends Service { private FileServer fileServer = null ; @Override public IBinder onBind ( Intent intent ) { return null ; } @Override public void