当前位置: 首页>>代码示例>>Java>>正文


Java UpnpServiceImpl类代码示例

本文整理汇总了Java中org.teleal.cling.UpnpServiceImpl的典型用法代码示例。如果您正苦于以下问题:Java UpnpServiceImpl类的具体用法?Java UpnpServiceImpl怎么用?Java UpnpServiceImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


UpnpServiceImpl类属于org.teleal.cling包,在下文中一共展示了UpnpServiceImpl类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: run

import org.teleal.cling.UpnpServiceImpl; //导入依赖的package包/类
public void run() {
    try {

        final UpnpService upnpService = new UpnpServiceImpl();

        Runtime.getRuntime().addShutdownHook(new Thread() {
            @Override
            public void run() {
                upnpService.shutdown();
            }
        });

        // Add the bound local device to the registry
        upnpService.getRegistry().addDevice(
                createDevice()
        );

    } catch (Exception ex) {
        System.err.println("Exception occured: " + ex);
        ex.printStackTrace(System.err);
        System.exit(1);
    }
}
 
开发者ID:cmusatyalab,项目名称:gabriel,代码行数:24,代码来源:GabrielUPnPServer.java

示例2: onCreate

import org.teleal.cling.UpnpServiceImpl; //导入依赖的package包/类
@Override
public void onCreate() {
	super.onCreate();

	final WifiManager wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);

	final ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);

	upnpService = new UpnpServiceImpl(createConfiguration(wifiManager)) {
		@Override
		protected Router createRouter(ProtocolFactory protocolFactory,
				Registry registry) {
			AndroidWifiSwitchableRouter router = AndroidUpnpServiceImpl.this
					.createRouter(getConfiguration(), protocolFactory,
							wifiManager, connectivityManager);
			if (!ModelUtil.ANDROID_EMULATOR
					&& isListeningForConnectivityChanges()) {
				// Only register for network connectivity changes if we are
				// not running on emulator
				registerReceiver(router.getBroadcastReceiver(),
						new IntentFilter(
								"android.net.conn.CONNECTIVITY_CHANGE"));
			}
			return router;
		}
	};

}
 
开发者ID:jasoncn90,项目名称:dlna-for-android,代码行数:29,代码来源:AndroidUpnpServiceImpl.java

示例3: DlnaRendererManager

import org.teleal.cling.UpnpServiceImpl; //导入依赖的package包/类
public DlnaRendererManager(PiPoint piPoint) {
	upnpService = new UpnpServiceImpl();
	controlPoint = upnpService.getControlPoint();
	registry = upnpService.getRegistry();
	registry.addListener(this);
}
 
开发者ID:Douglas6,项目名称:pipoint,代码行数:7,代码来源:DlnaRendererManager.java


注:本文中的org.teleal.cling.UpnpServiceImpl类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。