-
Notifications
You must be signed in to change notification settings - Fork 101
Android support #189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Android support #189
Conversation
We needed to use a github version for jni due to windows-sys build incompatibilities
Signed-off-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
Introduce Android-specific clipboard support using JNI and the `ndk_context` crate. This adds `Clipboard`, `Get`, `Set`, and `Clear` types under `src/platform/android.rs` to interact with the Android system clipboard, supporting basic text operations. Non-supported operations (HTML, image) return `ClipboardNotSupported` errors. Conditional compilation gates are updated to exclude Android from Unix-like assumptions (e.g., ScopeGuard, private sealing traits). Signed-off-by: Piotr Podusowski <podusowski@gmail.com>
|
Hey there, thanks for rebasing and cleaning up the prior PR. Please see my comment on the original PR and #191. I'd appreciate any feedback on the proposal since it affects Android. The proposal will need implemented, in some shape, before I review this entirely though, sorry. |
| # latest crate-compatible version of jni is not on crates.io, update this when it is | ||
| jni = { git = "https://github.com/jni-rs/jni-rs", rev = "1a4a345b1e65aca405e856046ff2661d37edde6d" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not entirely sure what to do about this off the top of my head. When you say "crate compatible" do you mean that Cargo won't build Windows or Android when jni brings in windows-sys 0.48 because of the range restriction earlier in this file?
Off the top of my head, I wonder if its feasible/possible to expand the version range here to support 0.48 too with more internal resolution workarounds...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried with the version on crates.io and I was getting tons of windows-sys conflicting errors on CI. switching to master on jni fixed it.
I found this related issue:
yeah no worries at all, I'm happy with maintaining a fork. I just needed this for my egui android app and maybe some others will find it useful as well. |
This is a rebase and rework of:
I had to update a few dependencies so that jni's window-sys wouldn't conflict, but after I did that the CI seems to pass.
I also fixed an issue where paste wasn't working in the original PR
Here's a video of it working in my egui android app:
arboard-paste.mp4