Open yschimke opened 1 month ago
Actually maybe the text is missing?
a.png
emulator
For discussion only at the moment, happy to close, but wanted to see if it's viable.
@yschimke Looks amazing. How can we try this? I found some main methods and test code.
Maybe like this?
./gradlew emulator-server:testDebugUnitTest
And then run the emulator-client
test main() in Android Studio?
At the moment it's clunky. I'm running the server in junit temporarily. It saves implementing all the sandbox config logic for a POC.
So run the testServer unit test method, it will print out it's started on port 8080.
Then run ClientMain. I had to turn off building the project on launch otherwise it waits for the unit test to finish which never does.
Sorry it's in such a rough state, but wanted to discuss the approach first
I believe the main point would be to provide an interface shared with the Android Emulator. It sounds very promising. I tried using the android-emulator-webrtc, but setting it up with SSL and CORS is a bit difficult. It would be great if we could avoid these issues for users.
@takahirom what I might try is a minimal project, outside roborazzi. One composable, one preview. Implement there and include a web page, showing android-emulator-webrtc.
This is probably a slow burner project, but wanted to see if it aligns with what you were envisioning.
Thanks. I think there are two use cases for the RNG emulator:
Sharing an interface with the emulator isn't necessary, but it would be intuitive to use the emulator in the usual way for debugging. There may be some challenges, however. If this becomes a blocker, we can proceed without the interface.
@takahirom I like that scope, it actually brings it inline with the POC. running within the test runner actually makes sense then.
So maybe at the start of a run, I'll print out the URL for a hosted webserver, and opening that will show you the internal progress?
@yschimke
I'll print out the URL for a hosted webserver, and opening that will show you the internal progress?
Sounds good! So, you might run two servers, like a gRPC server and a web server, right?
ClientMain (Client -> gRPC -> Server) spits out a similar PNG for SimplePreview, that running on an emulator does.
Quick and dirty POC for an alternative approach to https://github.com/takahirom/roborazzi/issues/176
Current Hacks
Should support client providing the classpath with current classes, instead of limited to current project
Todo (after some discussion)