public interface AndroidUpnpService
Usage example in an Android activity:
AndroidUpnpService upnpService;
ServiceConnection serviceConnection = new ServiceConnection() {
public void onServiceConnected(ComponentName className, IBinder service) {
upnpService = (AndroidUpnpService) service;
}
public void onServiceDisconnected(ComponentName className) {
upnpService = null;
}
};
public void onCreate(...) {
...
getApplicationContext().bindService(
new Intent(this, AndroidUpnpServiceImpl.class),
serviceConnection,
Context.BIND_AUTO_CREATE
);
}
The default implementation requires permissions in AndroidManifest.xml
:
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
You also have to add the application service component:
<application ...>
...
<service android:name="org.fourthline.cling.android.AndroidUpnpServiceImpl"/>
</application>
Modifier and Type | Method and Description |
---|---|
UpnpService |
get() |
UpnpServiceConfiguration |
getConfiguration() |
ControlPoint |
getControlPoint() |
Registry |
getRegistry() |
UpnpService get()
UpnpServiceConfiguration getConfiguration()
Registry getRegistry()
ControlPoint getControlPoint()
Copyright © 2016 4th Line GmbH, Switzerland. All rights reserved.