Is there any way for Beeware to write text to the clipboard of a mobile device? I tried Pyperclip but it didn't work #3130
-
Is there any way for Beeware to write text to the clipboard of a mobile device? I tried Pyperclip but it didn't work |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
There's no built-in cross-platform mechanism for clipboard access. Any native API for clipboard access should be accessible using the native platform APIs, accessed over the Chaqopy (for Android) or Rubicon ObjC (for iOS) language bridges. It's highly unlikely any pre-existing library (like Pyperclip) will work, because you're dealing with native system APIs. Those native system APIs are... well... system native, so a solution that works for Windows or GTK or macOS won't work for Android or iOS. |
Beta Was this translation helpful? Give feedback.
-
I would say that Android/iOS compatibility would be a fantastic thing to try contributing to Pyperclip, but sadly it's no longer under active development. While I've not tried it myself, Clipman is a library intended to replace it. It doesn't seem to have a lot of activity either, but at least it was getting updates as recently as five months ago. Could be worth keeping an eye on / contributing to as the BeeWare team continues to improve support for Python on mobile platforms. |
Beta Was this translation helpful? Give feedback.
There's no built-in cross-platform mechanism for clipboard access.
Any native API for clipboard access should be accessible using the native platform APIs, accessed over the Chaqopy (for Android) or Rubicon ObjC (for iOS) language bridges.
It's highly unlikely any pre-existing library (like Pyperclip) will work, because you're dealing with native system APIs. Those native system APIs are... well... system native, so a solution that works for Windows or GTK or macOS won't work for Android or iOS.