I love that we now have local notification support for Android! Walter’s blog mentioned that in Android, we can use custom icons for the notification that appears in the notification tray.
We could use these local notifications to set up a type of push notification system for our apps. Run process in background, poll website… etc
Not the most ideal way obviously… but I’ve given up on GCM ever being integrated…
but ya… Custom Icons [import]uid: 55582 topic_id: 33642 reply_id: 133881[/import]
I apologize. We haven’t had time to document this yet. This is something that we were planning on doing once we’ve finished adding push notifications.
You can set up your own custom notification icon in a Corona project by adding the following files to the root of the project directory, like how you do it for application icons.
Please note that different Android OS versions support different notification icon themes. You must support them all or else your app may get rejected during the app review process.
The “-v9” indicates that the PNG file represents an Android 2.3 icon. These icons are expected to be grey.
The “-v11” indicates that the PNG file represents an Android 3.0 or higher icon. These icons are expected to be white.
Icons without the postfix “-v” are used on Android 2.2. These icons are expected to be black.
We could use these local notifications to set up a type of push notification system for our apps. Run process in background, poll website… etc
Not the most ideal way obviously… but I’ve given up on GCM ever being integrated…
but ya… Custom Icons [import]uid: 55582 topic_id: 33642 reply_id: 133881[/import]
I apologize. We haven’t had time to document this yet. This is something that we were planning on doing once we’ve finished adding push notifications.
You can set up your own custom notification icon in a Corona project by adding the following files to the root of the project directory, like how you do it for application icons.
Please note that different Android OS versions support different notification icon themes. You must support them all or else your app may get rejected during the app review process.
The “-v9” indicates that the PNG file represents an Android 2.3 icon. These icons are expected to be grey.
The “-v11” indicates that the PNG file represents an Android 3.0 or higher icon. These icons are expected to be white.
Icons without the postfix “-v” are used on Android 2.2. These icons are expected to be black.
Corona still supports older Android 2.2 devices. While ldpi devices are rarer now days, they’re still out there. So, yes, I still recommend that you create an ldpi icon.
Corona still supports older Android 2.2 devices. While ldpi devices are rarer now days, they’re still out there. So, yes, I still recommend that you create an ldpi icon.
can you please specify the size of each one of those notifications icon?
please dont give me a link just the size of each version IconNotificationDefault,
Google doesn’t make it very obvious, honestly. As far as I can tell, they say 24x24, but that doesn’t seem correct. 48x48 would make more sense, and echo what @henrik5 says above.
Perhaps you’ll get more insight out of their documentation than I can…
Oh, and regarding the 24x24 pixel size not making sense. That’s the size of the icon at the mdpi 1x scaling. So, for an hdpi resolution device which uses a 1.5x scale, then icon size would be 36x36 pixels. That is, 24 * 1.5 = 36. Google documents this at the top of their Iconography documentation along with what the scales are for every DPI that they support.
Unfortunately, Google threw away their documentation for Android 2.2 and 2.3 notification/status-bar icons. But I’ve posted what they should be just above. Also, a quick Google search would find this information too.