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


Java AndroidUpnpService类代码示例

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


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


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