How can I change App's Icon dynamically in Android native - image

Using activity-alias or shortcut can change app icon. If use activity-alias way,need to create multiple alias ,If use shortcut, app need two uses-permission
Can I change icon like calendar app ? is there any way

Related

Mac: How to save alternate app icon in dock OSX xcode

In xcode on OSX app, I can change the app icon in the dock by using this code:
let image = NSImage.init(named: NSImage.Name(rawValue: "AltAppIcon"))
NSApp.applicationIconImage = image
But when I close the application the dock image reverts back to the original icon. Is there a way I can save the alternate icon so it will show at all times even when the app is closed? Thanks for any help.
You can implement a Dock tile plug-in. Much of the documentation for this has vanished, unfortunately. You can read about loadable bundles generally and plug-ins specifically in the Code Loading Programming Topics.
You would create a new Bundle target in your app project. A Dock tile plug-in's bundle extension must be docktileplugin. You should add a class to that target that adopts and implements the NSDockTilePlugin protocol. Set the NSPrincipalClass key in the bundle's Info.plist to the name of your class.
In the main app target, add the bundle target's product to be copied to the Contents/PlugIns directory in your app's bundle. Also, the app's Info.plist needs to have a key NSDockTilePlugIn whose value is the name of the plugin bundle.
When your plug-in is loaded, the system will call its -setDockTile: method, passing in an instance of NSDockTile for it to use. Your code can use that object to manipulate your app's Dock tile.

Application Menu Binding in e4 RCP app for Mac OS

For my RCP app, I am not using any menu. When built for Mac OS, there appears a default menu.
About, Preferences and Quit etc.
How to map default commands to these menu items?
I just want to keep menu for Mac not for other OSs.
In Application.e4xmi,I have created commands for with ids org.eclipse.ui.~ so on.
Should I just need to create HandledMenuItem in Menu contributions? and map the commands with it? Or do I need to add menus for Trimmed Window?
You just need to define commands and handlers. The commands must use standard ids known by Eclipse. These are:
org.eclipse.ui.file.exit for 'Quit'
org.eclipse.ui.help.aboutAction for 'About'
org.eclipse.ui.window.preferences for 'Preferences'

windows phone 7 how to navigate to settings menu

I have a windows phone 7 app that uses GPS to track user position. Now the user can disable this feature through the phone's setting menu. the app handles this disabling fine and gives them a message. This is all pretty standard windows phone stuff.
My question is whether I can navigate (inside the app) to the settings menu so that the user can enable phone location services? Ideally I would give them a link or a button that they touch and they are then taken out of the app to the settings menu. They would then click 'back' and return to the app.
No, at the moment, there's no way to fire up the Settings menu from inside your app.
Try this:
Windows.System.Launcher.LaunchUriAsync(new Uri(“ms-settings-location:”));
Not sure if it works on WP7 though.
http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj662937(v=vs.105).aspx

Menu Bar app being launched by Dock Icon (Mac OS X)

I'm working on a Menu Bar app and I've added the LSUIElement so the icon won't appear in the dock when the app is in use (And also to remove the File, Edit, View etc at the left of the menu bar).
The problem is that I want the app to be launched by the Icon and by adding the LSUIElement the only way to luanch the app is thru xcode.
I've seen that in the Mac app Caffiene it launches by the icon but it doesn't appear in the dock that it's running etc which is excatly what I want/need.
So I was wondering if you guys know how to do this.
Thank you in advance!
If you want to have a dock icon but not show the app as running in the Dock, simply create two applications:
Status Menu Application
This is the actual application that sets up the menu and contains the application's logic. It has LSUIElement set.
Launcher Application
This application has a dock icon. It contains the status menu application in its bundle. Its sole job is to launch the status menu application and then quit itself.
There is a really simple way to do this without creating a separate launcher app. Build your application, which has a status item, as an app bundle. Then, add an entry to the application's Info.plist file
Key: NSUIElement
Value: Number, 1 or Boolean True
NSUIElement tells OSX if the app should display in the Dock or not.

How to create a helper application (LSUIElement) that also has a (removable) dock icon

I've submitted a helper application (using LSUIElement)to the Mac App Store. I was under the false impression that the App Store install process would put a dock icon for helper apps.
How can I create a dock icon that the user could remove, while the status bar app runs independently (like the popular app Caffeine)? Do I need to create a non-LSUIElement app that loads the LSUIElement app, or is there a better way?
Instead of using LSUIElement, use NSApplication's setActivationPolicy: method. By default, the application will have a dock icon, but by changing the activation policy to NSApplicationActivationPolicyAccessory, you get the same effect as LSUIElement while being able to change it programatically (the documentation for NSApplicationActivationPolicyAccessory says it is equivalent to LSUIElement=1).
- (void)applicationDidFinishLaunching:(NSApplication *)app {
if([[NSUserDefaults standardUserDefaults] boolForKey:#"HideDockIcon"])
[NSApp setActivationPolicy:NSApplicationActivationPolicyAccessory];
}
Apparently I was misinformed by my app reviewer (two of them actually). The dock icon is created for you by the install process. Pressing the issue, I was able to get the app through the review process.

Resources