Setting AJNAboutIcon ObjectiveC

asked 2016-01-04 22:09:49 -0700

nilavya gravatar image

Hi,

I am trying to change the Icon that appears in the application for one of my device. In Objective C I am able to announce the About information and the Events that my application supports. How do I change the Icon that appears? I get the default icon in the "Dashboard Android Applicaiton" by Qualcomm. For the Luminaire sample app, I get the bulb icon, similarly I want to have my custom icon for the device.

Below is the sample code for setting the Icon in the bus.

// Service sets the About Icon
AJNAboutIcon *aboutIcon = [[AJNAboutIcon alloc]init];

status = [aboutIcon setUrlWithMimeType:@"image/png" url:@"https://someurlfor.png"];
//the icon content is just for illustration.
uint8_t aboutIconContent [] = {0x89,0x50,0x4E,0x47,0x1A,0x0A,0x00,0x00,0x00,0x0D,0x49,0x48};

[aboutIcon setContentWithMimeType:@"image/png" data:aboutIconContent size:(sizeof(aboutIconContent) / sizeof(aboutIconContent[0])) ownsFlag:false];

AJNAboutIconObject *aboutIconObject = [[AJNAboutIconObject alloc] initWithBusAttachment:self.bus aboutIcon:aboutIcon];

AJNAboutObject *aboutObj = [[AJNAboutObject alloc] initWithBusAttachment:self.bus withAnnounceFlag:ANNOUNCED];
status = [aboutObj announceForSessionPort:kAboutServicePort withAboutDataListener:self];

Am I missing anything? The AJNAboutIconObject initialization takes care of setting the bus and the icon created above.

But I am not able to view the icon as desired. My Icon is simple "black and white" icon

Regards,

NK

edit retag flag offensive close merge delete