sanjeev mk
sanjeev mk

Reputation: 4336

Adding new menu item to right-click (all platforms)

I have seen a lot of software and browser plugins do this. After installing them, they add some menu items to the system right click. Eg. On my PC, SVN added the item "SVN Checkout" to my right-click menu throughout.

On Android, you see Whatsapp adds itself to the Share menu across the entire system, so for every image you want to share, the option for Whatsapp also shows up. Similar stuff is done by Apps like Pocket, which adds the menu item "Save to Pocket"; so when you click on any article, you see "Save to Pocket" in the menu.

Question: How is this done? Is there a cross platform, generic way, or does this have to be done differently for every platform?

I need to provide this functionality to my users across Windows/Linux/Mac and Android/iOS. Any guidance on this is appreciated!

Update: Can this be done using only Java? That way, one solution will work on all platforms with Java Thanks

Upvotes: 0

Views: 329

Answers (1)

Bryan Herbst
Bryan Herbst

Reputation: 67249

No, there is no cross-platform way to do this. In Windows, you edit the registry. In Android, you can implement this in as number of different ways using the Android SDK.

Every platform has it's own APIs.

You also have a bit of a flawed mental model when you compare Android and Windows (or and mobile OS with any desktop OS). The features you mention for Android are built into an app running in the operating, while the contextual (right click) menu in Windows and OSX is a feature of the operating system itself.

Upvotes: 2

Related Questions