• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java AndroidUpnpService类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: onServiceConnected

import org.fourthline.cling.android.AndroidUpnpService; //导入依赖的package包/类
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
    Log.d(TAG, "onServiceConnected: " + name.flattenToShortString() + ", " + service.toString());

    mUpnpService = (AndroidUpnpService) service;

    Device device = mUpnpService.getRegistry().getDevice(new UDN(mDeviceUdn), false);
    mContentDirectoryService = device.findService(new UDAServiceType("ContentDirectory"));
    if (mContentDirectoryService == null) {
        throw new IllegalStateException("Unable to find ContentDirectory service for device "
                + mDeviceUdn);
    }
    mDeviceName = (device.getDetails() != null && device.getDetails().getFriendlyName() != null)
            ? device.getDetails().getFriendlyName() : device.getDisplayString();

    selectContainer(mCurrentContainer);
}
 
开发者ID:stephenmcgruer,项目名称:simple-upnp,代码行数:18,代码来源:FileBrowserFragment.java


示例2: onServiceConnected

import org.fourthline.cling.android.AndroidUpnpService; //导入依赖的package包/类
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
    Log.d(TAG, "onServiceConnected: " + name.flattenToShortString() + ", " + service.toString());
    mUpnpService = (AndroidUpnpService) service;

    mServerListAdapter.clear();

    mUpnpService.getRegistry().addListener(mRegistryListener);

    // Add any already-cached devices.
    for (Device device : mUpnpService.getRegistry().getDevices()) {
        onDeviceAdded(device);
    }

    // Kick off a search for all devices on the network.
    mUpnpService.getControlPoint().search();
}
 
开发者ID:stephenmcgruer,项目名称:simple-upnp,代码行数:18,代码来源:ServerBrowserFragment.java


示例3: onServiceConnected

import org.fourthline.cling.android.AndroidUpnpService; //导入依赖的package包/类
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
    mAndroidUpnpService = (AndroidUpnpService) service;

    mHeartRateService = getHeartRateService();

    if(mHeartRateService == null) {
        LocalDevice heartRateServiceDevice = new DeviceFactory().createWearNotificationServiceDevice(mUDN);

        if(heartRateServiceDevice != null) {
            mAndroidUpnpService.getRegistry().addDevice(heartRateServiceDevice);

            mHeartRateService = getHeartRateService();
        }
    }

    if(mHeartRateService != null) {
        mHeartRateService.getManager().getImplementation().registerListener(this);
    }
}
 
开发者ID:mklschreiber,项目名称:Crowdi,代码行数:21,代码来源:WearNotificationServiceReceiverConnection.java


示例4: onServiceConnected

import org.fourthline.cling.android.AndroidUpnpService; //导入依赖的package包/类
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
    mAndroidUpnpService = (AndroidUpnpService) service;

    mHeartRateDataService = getHeartRateDataService();

    if(mHeartRateDataService == null) {
        LocalDevice heartRateDataServiceDevice = new DeviceFactory().createHeartRateDataServiceDevice(mUDN);

        if(heartRateDataServiceDevice != null) {
            mAndroidUpnpService.getRegistry().addDevice(heartRateDataServiceDevice);

            mHeartRateDataService = getHeartRateDataService();
        }
    }

    if(mHeartRateDataService != null) {
        mHeartRateDataService.getManager().getImplementation().registerListener(this);
    }
}
 
开发者ID:mklschreiber,项目名称:Crowdi,代码行数:21,代码来源:HeartRateDataServiceReceiverConnection.java


示例5: onServiceConnected

import org.fourthline.cling.android.AndroidUpnpService; //导入依赖的package包/类
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
    mAndroidUpnpService = (AndroidUpnpService) service;

    mStartPollService = getStartPollService();

    if(mStartPollService == null) {
        LocalDevice heartRateServiceDevice = new DeviceFactory().createStartPollServiceDevice(mUDN);

        if(heartRateServiceDevice != null) {
            mAndroidUpnpService.getRegistry().addDevice(heartRateServiceDevice);

            mStartPollService = getStartPollService();
        }
    }

    if(mStartPollService != null) {
        mStartPollService.getManager().getImplementation().registerListener(this);
    }
}
 
开发者ID:mklschreiber,项目名称:Crowdi,代码行数:21,代码来源:StartPollServiceReceiverConnection.java


示例6: onServiceConnected

import org.fourthline.cling.android.AndroidUpnpService; //导入依赖的package包/类
public void onServiceConnected(ComponentName className, IBinder service) {
    upnpService = (AndroidUpnpService) service;

    // Clear the list
    listAdapter.clear();

    // Get ready for future device advertisements
    upnpService.getRegistry().addListener(registryListener);

    // Now add all devices to the list we already know about
    for (Device device : upnpService.getRegistry().getDevices()) {
        registryListener.deviceAdded(device);
    }

    // Search asynchronously for all devices, they will respond soon
    upnpService.getControlPoint().search();
}
 
开发者ID:offbye,项目名称:DroidDLNA,代码行数:18,代码来源:BrowserActivity.java


示例7: makeBrowseObservable

import org.fourthline.cling.android.AndroidUpnpService; //导入依赖的package包/类
Observable<Model> makeBrowseObservable(
        final String folderIdentity,final AndroidUpnpService service,
        final RemoteService remoteService, final boolean listing) {
    if (StringUtils.isEmpty(folderIdentity)) {
        //first try to get the music only virtual folder, then do the browse
        return Observable.create(new GetFeatureListOnSubscribe(service, remoteService)).flatMap(
                new Func1<String, Observable<Model>>() {
                    @Override
                    public Observable<Model> call(String s) {
                        return Observable.create(new BrowseOnSubscribe(
                                mAuthority, service, remoteService, s,
                                BrowseFlag.DIRECT_CHILDREN));
                    }
                }
        );
    } else {
        //we were given a folder, browse it
        return Observable.create(new BrowseOnSubscribe(
                mAuthority, service, remoteService, folderIdentity,
                listing ? BrowseFlag.DIRECT_CHILDREN : BrowseFlag.METADATA));
    }
}
 
开发者ID:OpenSilk,项目名称:Orpheus,代码行数:23,代码来源:UpnpCDProvider.java


示例8: scheduleServiceShutdown

import org.fourthline.cling.android.AndroidUpnpService; //导入依赖的package包/类
private void scheduleServiceShutdown() {
    cancelServiceShutdown();
    mShutdownWorker = Schedulers.computation().createWorker();
    mShutdownWorker.schedule(new Action0() {
        @Override
        public void call() {
            AndroidUpnpService service = mBinder;
            if (!service.getRegistry().isPaused()) {
                service.getRegistry().pause();
            }
        }
    }, 10, TimeUnit.MINUTES);
    mShutdownWorker.schedule(new Action0() {
        @Override
        public void call() {
            stopSelf();
        }
    }, 20, TimeUnit.MINUTES);
}
 
开发者ID:OpenSilk,项目名称:Orpheus,代码行数:20,代码来源:UpnpServiceService.java


示例9: onServiceConnected

import org.fourthline.cling.android.AndroidUpnpService; //导入依赖的package包/类
public void onServiceConnected(ComponentName className, IBinder service) {
    upnpService = (AndroidUpnpService) service;
    
    // Clear the list
   // listAdapter.clear();

    // Get ready for future device advertisements
    upnpService.getRegistry().addListener(registryListener);

    // Now add all devices to the list we already know about
    for (Device device : upnpService.getRegistry().getDevices()) {
        registryListener.deviceAdded(device);
    }
    getNetworkSourceArrayAdapter().notifyDataSetChanged();

    // Search asynchronously for all devices, they will respond soon
    upnpService.getControlPoint().search();	            
}
 
开发者ID:eriklupander,项目名称:microgramcaster,代码行数:19,代码来源:UPnPHandler.java


示例10: onServiceConnected

import org.fourthline.cling.android.AndroidUpnpService; //导入依赖的package包/类
@Override
public void onServiceConnected(ComponentName componentName, IBinder binder) {
	if(binder instanceof AndroidUpnpService){
		androidUpnpService = (AndroidUpnpService)binder;
		localDevice = createDevice();
		androidUpnpService.getRegistry().addDevice(localDevice);
	}
	
}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:10,代码来源:LocalUpnpServer.java


示例11: UpnpControlSet

import org.fourthline.cling.android.AndroidUpnpService; //导入依赖的package包/类
/**
 * @param upnpService             upnp服务
 * @param avTransportService      远程视频传输服务
 * @param renderingControlService 远程渲染器控制服务
 */
public UpnpControlSet(AndroidUpnpService upnpService,
                      Service avTransportService,
                      Service renderingControlService) {
    this.mUpnpService = upnpService;
    this.avTransportService = avTransportService;
    this.renderingControlService = renderingControlService;
    if (mUpnpService == null || avTransportService == null
            || renderingControlService == null) {
        Log.e(TAG, "UpnpControlSet parameters is null");
    }
    mHandler = new Handler();
    initNoParameterActionCallback();
}
 
开发者ID:hezhubo,项目名称:HPlayer,代码行数:19,代码来源:UpnpControlSet.java


示例12: onServiceConnected

import org.fourthline.cling.android.AndroidUpnpService; //导入依赖的package包/类
public void onServiceConnected(ComponentName className, IBinder service) {
    Log.d(TAG, "DLNA-----DlnaAndRemoteSearch---onServiceConnected");
    mUpnpService = (AndroidUpnpService) service;
    mUpnpService.getControlPoint().getRegistry().removeAllRemoteDevices();// 先清除掉之前的,再搜索
    mUpnpService.getRegistry().addListener(mDefaultRegistryListener);
    mUpnpService.getControlPoint().search();
}
 
开发者ID:hezhubo,项目名称:HPlayer,代码行数:8,代码来源:DlnaSearch.java


示例13: Controller

import org.fourthline.cling.android.AndroidUpnpService; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
public Controller(Context context, AndroidUpnpService androidUpnpService,
		Device device, Handler handler) {
	mContext = context;
	mAndroidUpnpService = androidUpnpService;
	if (device != null) {
		mConnectionService = device.findService(new UDAServiceType(
				UpnpUtils.SERVICE_CONNECTION_MANAGER));
		mAvTransportService = device.findService(new UDAServiceType(
				UpnpUtils.SERVICE_AVTRANSPORT));
		mRendererControlService = device.findService(new UDAServiceType(
				UpnpUtils.SERVICE_RENDERING_CONTROL));
		registerLastChangeListener(handler);
	}
}
 
开发者ID:sky24987,项目名称:UPlayer,代码行数:16,代码来源:Controller.java


示例14: onServiceConnected

import org.fourthline.cling.android.AndroidUpnpService; //导入依赖的package包/类
@Override
public void onServiceConnected(ComponentName componentName, IBinder service) {
	Log.e(TAG, "UPNP service is connected.");
	mUpnpService = (AndroidUpnpService) service;

	mMediaServer = new MediaServer(mContext, Utils.getInetAddress(mContext));

       ContentGenerator.prepareAudio(mContext,mMediaServer);

	if (mMediaServer != null)
		mUpnpService.getRegistry().addDevice(mMediaServer.getDevice());
	mMediaRenderer = new MediaRenderer(mContext);
	if (mMediaRenderer != null)
		mUpnpService.getRegistry().addDevice(mMediaRenderer.getDevice());
}
 
开发者ID:sky24987,项目名称:UPlayer,代码行数:16,代码来源:MainActivity.java


示例15: sup

import org.fourthline.cling.android.AndroidUpnpService; //导入依赖的package包/类
private void sup() {
    mRegistryListener = new SimpleBrowseRegistryListener();

    mServiceConnection = new ServiceConnection() {
        public void onServiceConnected(ComponentName className, IBinder service) {
            mUpnpService = (AndroidUpnpService) service;

            // Get ready for future device advertisements
            mUpnpService.getRegistry().addListener(mRegistryListener);

            // Now add all devices to the list we already know about
            for (Device device : mUpnpService.getRegistry().getDevices()) {
                mRegistryListener.deviceAdded(device);
            }

            // Search asynchronously for all devices
            mUpnpService.getControlPoint().search();

            mUpnpService.getRegistry().getDevice(UDN.valueOf(""), false);
        }

        public void onServiceDisconnected(ComponentName className) {
            mUpnpService = null;
        }
    };

    bindService(
            new Intent(this, UpnpService.class),
            mServiceConnection,
            Context.BIND_AUTO_CREATE
    );
}
 
开发者ID:MizzleDK,项目名称:Mizuu-Android-TV,代码行数:33,代码来源:LibraryUpdateService.java


示例16: searchForDevices

import org.fourthline.cling.android.AndroidUpnpService; //导入依赖的package包/类
private void searchForDevices() {
    mListView.setAdapter(mListAdapter);

    mRegistryListener = new BrowseRegistryListener(this, mListAdapter);

    mServiceConnection = new ServiceConnection() {
        public void onServiceConnected(ComponentName className, IBinder service) {
            mUpnpService = (AndroidUpnpService) service;

            // Get ready for future device advertisements
            mUpnpService.getRegistry().addListener(mRegistryListener);

            // Now add all devices to the list we already know about
            for (Device device : mUpnpService.getRegistry().getDevices()) {
                mRegistryListener.deviceAdded(device);
            }

            // Search asynchronously for all devices
            mUpnpService.getControlPoint().search();
        }

        public void onServiceDisconnected(ComponentName className) {
            mUpnpService = null;
        }
    };

    getApplicationContext().bindService(
            new Intent(this, UpnpService.class),
            mServiceConnection,
            Context.BIND_AUTO_CREATE
    );
}
 
开发者ID:MizzleDK,项目名称:Mizuu-Android-TV,代码行数:33,代码来源:AddUpnpSourceActivity.java


示例17: onServiceConnected

import org.fourthline.cling.android.AndroidUpnpService; //导入依赖的package包/类
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
    mAndroidUpnpService = (AndroidUpnpService) service;

    mAndroidUpnpService.getRegistry().addListener(this);
    mAndroidUpnpService.getControlPoint().search();

    mPeriodicSearchThread = new PeriodicSearchThread(mAndroidUpnpService);
    mPeriodicSearchThread.start();
}
 
开发者ID:mklschreiber,项目名称:Crowdi,代码行数:11,代码来源:HeartRateDataServiceSenderConnection.java


示例18: DMCControl

import org.fourthline.cling.android.AndroidUpnpService; //导入依赖的package包/类
public DMCControl(Activity paramActivity, int paramInt,
		DeviceItem paramDeviceItem,
		AndroidUpnpService paramAndroidUpnpService, String paramString1,
		String paramString2) {
	this.activity = paramActivity;
	this.controlType = paramInt;
	this.executeDeviceItem = paramDeviceItem;
	this.upnpService = paramAndroidUpnpService;
	this.uriString = paramString1;
	this.metaData = paramString2;
}
 
开发者ID:offbye,项目名称:DroidDLNA,代码行数:12,代码来源:DMCControl.java


示例19: browseFolders

import org.fourthline.cling.android.AndroidUpnpService; //导入依赖的package包/类
protected Observable<Model> browseFolders(
        @NonNull final String deviceIdentity,
        @Nullable final String folderIdentity,
        final boolean listing
) {
    return Observable.using(
            mConnectionFactory,
            new Func1<UpnpServiceServiceConnection, Observable<? extends Model>>() {
                @Override
                public Observable<? extends Model> call(UpnpServiceServiceConnection upnpServiceServiceConnection) {
                    final AndroidUpnpService service = upnpServiceServiceConnection.getService();
                    //first acquire the CDService
                    return Observable.create(new ContentDirectoryOnSubscribe(service, deviceIdentity))
                            //searches should be basically instant on lan so timeout after short period
                            .timeout(5, TimeUnit.SECONDS)
                            //use the CDService to make the browse call
                            .flatMap(new Func1<RemoteService, Observable<Model>>() {
                                @Override
                                public Observable<Model> call(final RemoteService remoteService) {
                                    return makeBrowseObservable(folderIdentity,
                                            service, remoteService, listing);
                                }
                            });
                }
            },
            mConnectionCloseAction
    );
}
 
开发者ID:OpenSilk,项目名称:Orpheus,代码行数:29,代码来源:UpnpCDProvider.java


示例20: BrowseOnSubscribe

import org.fourthline.cling.android.AndroidUpnpService; //导入依赖的package包/类
public BrowseOnSubscribe(String mAuthority, AndroidUpnpService upnpService,
                         RemoteService rs, String folderIdentity, BrowseFlag browseFlag) {
    this.mAuthority = mAuthority;
    this.upnpService = upnpService;
    this.rs = rs;
    this.folderIdentity = folderIdentity;
    this.browseFlag = browseFlag;
}
 
开发者ID:OpenSilk,项目名称:Orpheus,代码行数:9,代码来源:UpnpCDProvider.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MultiGetResponse类代码示例发布时间:2022-05-21
下一篇:
Java ESIntegTestCase类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap