rust-clipboard icon indicating copy to clipboard operation
rust-clipboard copied to clipboard

Android support

Open torkleyy opened this issue 7 years ago • 3 comments

I've tried to build a project for Android and it tried to link to xcb. Turns out this library depends on xcb :)

Is Android support planned and if not, could we add a compile_error! if the target platform is Android?

torkleyy avatar Feb 09 '18 16:02 torkleyy

Android support is in scope. It looks like the relevant documentation is here. I've asked the Servo folks about recommended crates for poking at android APIs from Rust, and will add that information here once I get a reply.

aweinstock314 avatar Feb 20 '18 15:02 aweinstock314

@torkleyy I would love this too (I use a tablet with Termux when Im away from my PC), much better than a laptop!

@aweinstock314 there is no need to find any Rust/Android APIs, Termux provide these via its termux-api (an API written in Python that can interact with our ugly Java ways :) The API provides many commands including:

  • termux-clipboard-set
  • termux-clipboard-get

The two above values are all we need added! 👍 They work exactly like xclip/xsel so use them as a template, just replace with the the relevent values with the two commands listed above (both termux commands do not take any extra args, just one to set and one to get).

It would be really appreciated! (I found a beautiful text editor but it uses this utility so I am currently unable to copy/paste). Plus, it would close this (3 year old) issue too :+1:

Here is a utility I use (for some reference), its written in Rust, provides a cross-platform clipboard-cli (that includes Android/Termux), hope it helps: https://github.com/yaa110/cb

THANK YOU!

nerd190 avatar Feb 23 '21 16:02 nerd190

I have implemented it. Please take a look: https://github.com/aweinstock314/rust-clipboard/pull/87

Fancyflame avatar Apr 30 '22 04:04 Fancyflame