Closed mrexodia closed 5 years ago
See my comments on #14
I implemented the interface for every platform, but I have no idea how to get the information from Java to copy to the clipboard. Some direction would be appreciated!
I found this SO answer: https://stackoverflow.com/questions/19253786/how-to-copy-text-to-clip-board-in-android
The easiest way would be to add a function to NativeRootActivity.java ( probably a public static
function ), then make that function available to C++ via android/NativeRootActivity.h and call it from android/UIApplication.cpp
Yeah that’s what I did, but you need getSystemService which is a member function so it cannot be called from my static method...
You can use NativeRootActivity.getRootActivity() to access the main activity object. NativeRootActivity.getRootActivitiy().getSystemService(...) should get you there.
Thanks, I will look into it @Maddimax!
Alright, I implemented and tested Application::copyToClipboard
for all platforms and rebased on the latest master. Locally I have modifications to bodendemo
with a button to test the function, should I add that too?
Is there a way to have AndroidStudio show the cpp/java files like Xcode? It was lagging horribly and I couldn't get it to work, so I just ran ./boden build
instead for testing Android.
Yes, a test button in the demo app would be nice!
You should be able to see the cpp/java files in Android Studio. If you can't find them, double press Shift and it should bring up a quick open dialog (similar to Ctrl/Cmd+P in Sublime). If you enter the filename there, it should show up.
Regarding the Android Studio and lagging: Yes, that's an issue. It's usually caused by Gradle sync and it's worse when the project is first opened. We found that it gets better if you generate a single target only (using boden open -t bodendemo
). It should get faster once the initial indexing/sync is completed. Unfortunately there doesn't seem to be much else we can do about it right now.
Alright, I re-added the page, hopefully everything is done now :)
Thanks a lot for the time and effort you put into this!
Usage:
Currently I do not have enough disk space to test on an emulator on Android unfortunately. I will try to make space and implement it for Android and OSX too. I'll sign the CLA in a separate PR once that's applicable.