Check for access to notifications using NotificationListenerService

Edit June 15th, 2016 I’m not sure which version of the support library this was added to, but it looks like this functionality is now built in. Simply use: NotificationManagerCompat.getEnabledListenerPackages(context); (link to docs) This returns a Set<String> that you can iterate through to find your package name. Note however that I haven’t personally tested this. … Read more

Is possible set Expanded Notification as default in Big Text Notifications?

The documentation states: A notification’s big view appears only when the notification is expanded, which happens when the notification is at the top of the notification drawer, or when the user expands the notification with a gesture. So my answer is no, you can’t expand it by default. There is however a trick to push … Read more

How to create a notification in swing

You might need a translucent frame without decorations. Quick demo OSX ] You can take advantage JLabel displays simple HTML import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.text.*; import java.util.Date; import java.lang.reflect.Method; import java.lang.reflect.InvocationTargetException; /** * Simple demo on how a translucent window * looks like when is used to display the system clock. * … Read more

HTML5 Notification not working in Mobile Chrome

Try the following: navigator.serviceWorker.register(‘sw.js’); Notification.requestPermission(function(result) { if (result === ‘granted’) { navigator.serviceWorker.ready.then(function(registration) { registration.showNotification(‘Notification with ServiceWorker’); }); } }); That is, use ServiceWorkerRegistration»showNotification() not new Notification(). That should work on Android both in Chrome and in Firefox — and on iOS in Safari, too. (The sw.js file can just be a zero-byte file.) One caveat … Read more

iPhone : Daily local notifications

You just need to properly create a NSDate object to be your fire date (time). Instead of using [NSDate dateByAddingTimeInterval: 20], use something like this: NSCalendar *calendar = [NSCalendar currentCalendar]; NSDateComponents *components = [[NSDateComponents alloc] init]; [components setDay: 3]; [components setMonth: 7]; [components setYear: 2012]; [components setHour: 6]; [components setMinute: 0]; [components setSecond: 0]; [calendar … Read more