Adding Icon to LocalDevice

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Adding Icon to LocalDevice

ideru
Hello Everyone,

I am trying to add an Icon to our localDMS(localDevice) but when I tried to access the server remotely , no Icon was set.
The Iconpath is always null.

Here is what I did:

These are the information within the device details. The baseURL is made from assigned HOST taken from DHCP and port (fix one)
 
               DeviceDetails details = new DeviceDetails(getBaseURL(), deviceName,
                    new ManufacturerDetails("Local Server"),
                    new ModelDetails("v4.0"), "123456789012", "",
                    null, new DLNADoc[] { new DLNADoc("DMS", "1.50") }, null);
 Icon icon = new Icon("image/png", 48, 48, 32, URI.create("icon.png"), IOUtils.toByteArray(getResources().openRawResource(
                                         R.drawable.ic_launcher)));

LocalDevice localDevice = new LocalDevice(deviceIdentity, deviceType, details, new Icon[] {icon}, new LocalService[] { contentDirectory});

Did I miss anything or any information that is needed ?
Reply | Threaded
Open this post in threaded view
|

Re: Adding Icon to LocalDevice

Christian Bauer
Administrator
Icons for LocalDevice's don't have an URI (path) set. The API in 2.0 was changed to prevent this mistake.

Reply | Threaded
Open this post in threaded view
|

Re: Adding Icon to DMS(Device)

ideru
Hi Christian , Thank for the information. We do have plans to migrate the application to 2.0 but we are putting it on hold for bit so we are still currently still using 1.0.5 API's. Even in this version, it will still not allow to set URI path for icon.

As i understand, the RemoteDevice is created automatically when local device is created?
I was wondering how the icon path is going to be set to the Remote Device.

Sorry for asking detailed questions, I am currently doing some testing on our application on two different tablets and I can get the Remote device identity and descriptors but not the icon path.

as for local device, I think we will set a different icon for it.



Reply | Threaded
Open this post in threaded view
|

Re: Adding Icon to DMS(Device)

Christian Bauer
Administrator

On 14.02.2013, at 06:07, "ideru [via Mailinglists]" <[hidden email]> wrote:

>  Even in this version, it will still not allow to set URI path for icon.

As I said, your Icon does not have a path set when you use the Icon with a LocalDevice. Read the 2.0 Javadoc of Icon.

> As i understand, the RemoteDevice is created automatically when local device is created?

No, that's not how it works at all. Read the manual.

> I was wondering how the icon path is going to be set to the Remote Device.

That shouldn't be your concern unless you work on the Cling discovery source.

> Sorry for asking detailed questions, I am currently doing some testing on our application on two different tablets and I can get the Remote device identity and descriptors but not the icon path.
>
> as for local device, I think we will set a different icon for it.

I think you are confused about how RemoteDevice and LocalDevice work. You only need LocalDevice if you provide a service, not for a control point. Again, the manual is quite clear on that.

Reply | Threaded
Open this post in threaded view
|

Re: Adding Icon to DMS(Device)

ideru
Thanks for the pointers.. I will check into it and come back later..