Open daylightwarbler opened 2 days ago
Yeah I do want to support this automatically. But I wanted a concrete thing I could test somehow first. Is there an example Rust program along with perhaps a CI setup that demonstrates the full end to end need here?
Basically, I haven't written Rust programs on Android before. I do have a good idea of what needs to be done based on prior art research, but I don't know exactly how I should go about iterating and testing. If someone can help me with that part, then I can do the rest.
Ok, here’s an example Android app build with Jiff and a Github actions CI workflow. The app runs some Rust code at startup and then shows some text. The test installs and starts the app in a running emulator and checks if the app crashed or not. If an assert fails then that causes a crash and test failure.
Getting the current time works as expected, but using the system Time Zone Database and obtaining the system time zone both require additional crates and lower-level Jiff methods. If Android was supported out of the box, then that would also improve ergonomics for cross-platform Android/iOS projects, since Jiff's API could be used the same way on both targets.
On Android, the Time Zone Database is in an Android-specific format. The
android-tzdata
crate provides TZif data for a time zone name.The system time zone can be obtained with the
iana-time-zone
crate.