My Codex usage cap has reset, so it's time for another big porting project. This time, replacing my crummy old Android version of Lights Off with a version that matches the modern iOS app 1:1.

Whenever it goes astray, I tell it to look back at the iOS code and make things look / layout exactly like that

And with an evening of prompting, I have got a complete port of the modern version of Lights Off on Android, in Java/XML, complete with responsive layout, themes, settings, animation, sound and more, using the latest iOS codebase as a reference. It matches the version on iPhone and iPad almost down to the last pixel. I haven't touched a line of code manually (except for the original Swift code), and Codex 5.3 did all the work. It completely replaces the old Android version I wrote a decade ago
It is really hard to design a beautiful modern Android app, because no two apps on the system look the same, and there are no good references from Google, at all. And if a human won't have a clue, an LLM certainly won't know what to do either. The freaking Clock and Recorder apps are the best examples I can draw from
Codex is trying its hardest, though
OK, I've done my research, I've pointed it at the APIs and styles I want, and I've painstakingly guided it through the process, so this is my best attempt at a Material Design 'settings' view for Lights Off on Android
And here are the screens in picture form. I used the recommended MDL3 Expressive styles from the design docs, I checked as many system apps as I could for reference, it uses the inherited system theme colors as appropriate, and on foldables it expands out into a navigation rail view
I don't think I have anything more to add to this project. It's a complete one-to-one recreation of the entire iOS version of Lights Off, every feature and corner of the app intact, with native Material Design 3 Expressive UI, and full support for phones, foldables and tablets. It is absolutely leagues better than the previous version of Lights Off I wrote for Android back in the early 2010s, and I haven't touched a line of code myself. I need to redo the app icon by hand, but it's ready to ship
Since I have so much extra time to work with, I inserted a new dynamic theme that inherits the user's Material You system theme colors, drawn from the user's wallpaper

You may have a different opinion, but I believe I have put together a beautiful version of Lights Off for Android. I started it late last night, picked it back up at 9am this morning, and I've started submitting builds to Google Play's internal testing mechanics at 1pm.

(I have burned through 19% of my Codex weekly limit on the $20 plan)

Since people are fascinated by the behind-the-scenes, here's the starting prompt.

I wish I had taken screenshots of the first run, because it didn't look anything like what I have now. But through iteration, perseverance, getting it to refer to the iOS source code over and over again, and doing quite a bit of design research of my own, I got exactly what I wanted, and much more

Some more Material You colors from the dynamic theme. Just change the wallpaper on your Android device, and Lights Off automatically updates with the theme colors

It has been eleven years since the last build of Lights Off was submitted to Google Play.

It was culled in 2016, along with all my other Android apps, because it hadn't been updated to the latest SDKs

Since it's interesting to some, I have exported what seems to be my full set of Codex prompts to get Lights Off to Android in the finished state you see here, with the starting point of my iOS codebase. Only my side of the conversation, because the other side is information overkill for every reply and lots of references to source code and files (and I tend to not read the replies anyway). I only wish I had taken screenshots of every time I ran the app; maybe next time

https://gist.github.com/steventroughtonsmith/2b8d1c35d0e1d2fd8a59b956e3c3c1b4

Lights Off iOS -> Android

Lights Off iOS -> Android. GitHub Gist: instantly share code, notes, and snippets.

Gist

⭐️ Here's a closer look at Lights Off for Android, ported from the iOS Swift codebase to Android's Java, screen for screen, in full, by Codex 5.3. It uses the latest Material Design 3 patterns and styles, and it even has an adaptive 'dynamic' theme that inherits your system colors. It supports phone, foldable and tablet devices, with an expanded layout to match, and it runs all the way back to Android 5.0 (Lollipop)

Download: https://play.google.com/store/apps/details?id=com.steventroughtonsmith.lightsoff

(Scroll back up the thread for more detail)

Oh and hey, if you've been following along, you can now download Lights Off from Google Play 🥳

https://play.google.com/store/apps/details?id=com.steventroughtonsmith.lightsoff

Lights Off - Apps on Google Play

The classic game is back and better than ever!

@stroughtonsmith I’m guessing what I see in the Danish description is automatic translation? It’s… not great for figuring out what it was meant to say 😅
@trezzer I certainly only provided US English!
@stroughtonsmith I figured you wouldn’t try to sell it with “subpar animations” and “quiet sound effects”
@stroughtonsmith
only for devices with locked bootloader? 🤔
@ccgx it has the recommended level of Play Protect, yeah, though that sounds harsh
@stroughtonsmith
Then "recommended" excludes devices with unlocked bootloader, just checked with another device. Thats more "security" than my banking app wants 😂
@ccgx I have lowered it a notch; not sure if that will enable unlocked bootloader devices (Google does a shit job of explaining the options) but let me know if you see it
@stroughtonsmith
still not installable on my unlocked device
@ccgx I've turned it all off. You're going to find this so anticlimactic 🤣
@stroughtonsmith
well, it least it works now :D
@stroughtonsmith if more Android apps had this attention to detail I’d switch in a heartbeat
@notkoalas Codex did its part, I did my part. Neither were trivial
@stroughtonsmith JAVA? Is that even a real app now?
@stroughtonsmith can you say anything about the quality of the generated code? Would you touch it to do further maintenance?

@pilif haven't even looked at it! If I were to touch it, it would be through a prompt. If I were to add features to the iOS version, I think I would try handing the pull request as a diff to Codex and have it figure out how to port it into the Android app. The iOS code is the source of truth.

On previous projects the code generated was indistinguishable from my own, so I rapidly stopped double-checking it. But I told it to use Java/XML just in case, since I know how to make Android apps like so

@stroughtonsmith This is incredibly nice of you to share. Thank you! So Cool.

I can see you have used image attachments also. I have not have that much luck with that kind of interaction.

Do you think you would try more with words if you had to do it again? Or the other way around, try more with images?

@gahms I don't know about others, but Codex is particularly good at understanding what I'm showing in a screenshot. So the flow is: prompt, build and run, screenshot the device, drop the picture back into the prompt, and repeat. I'm sure this can all be automated with MCP
@stroughtonsmith There are some games that didn’t make the leap to 64bit around iOS 11 (the remakes of Karateka and Sid Meier’s Pirates) and this is making be hopeful those decisions could get revisited. 🤞
@stroughtonsmith Although it's fascinating this works, frankly writing these kind of prompts woud bore me to death. I much rather do the work myself. There's joy in creating things. It's why I left a management job to be an independent developer.

@eerko I don't find it boring, but I do find it /exhausting/. It's exercising different muscles to programming, not ones I use a whole lot, and even a week of this has me tired out.

Re joy, I fully agree with you. But I still feel like I've created something — it exists, exactly as I imagined it, where it didn't before — even if I didn't have to write the code. I get the same joy from that end result. And I certainly did a ton of work to make it happen, just not the same kind of work as coding

@stroughtonsmith would you be open to sharing some of the later, more ‘in the weeds’ prompts that you used to steer it on target — e.g., when you had to persevere.

@grork I should have thought to just ask it to generate a transcript, which it did.

I lost last night's transcript because there's a broken image in the chat and it blew up after that, so I had to start a new thread. So this is part 2

https://gist.github.com/steventroughtonsmith/2b8d1c35d0e1d2fd8a59b956e3c3c1b4

Lights Off iOS -> Android

Lights Off iOS -> Android. GitHub Gist: instantly share code, notes, and snippets.

Gist
@grork managed to recover part 1, so updated the gist
@stroughtonsmith does the LLM handle Java/XML better than Kotlin/Compose, or was that just personal preference?
@thomasjoulin preference; that's how I know to write Android apps. If I need to dig into the code myself, I don't want to have to learn a new language on top of it
@stroughtonsmith I'm feeling a bit ambivalent now about my architecture for Deluge -- one reason I went for compiled CQL with codegen was so that I could do cross platform later (same business logic, new codegen script to produce native interface in kotlin or whatever). I sincerely doubt AI can set up that infra for me (since it's not something there's many examples of)... have I overcomplicated myself for no reason?
@amyworrall doing it the 'real' way is almost certainly always going to be better, especially if the project is critical. I can afford to try this stuff on the apps that aren't going to affect my bottom line, learn how it works, refine my approach, etc
@stroughtonsmith You‘ve said it before: RIP cross platform frameworks. From now on everyone should just build the perfect iOS app and then let AI port it to Android. I‘m in shock.
@stroughtonsmith Also good riddance maybe? The experience with any cross platform built app hasn‘t been great on any platform in the first place.
@albrecht @stroughtonsmith Actually I've managed to make something good with Expo and that's a cross platform framework, even got IOS native tabs working and back buttons and headings like a Swift app has. I don't have a mac so that's the only way I can develop for IOS lol.

@albrecht @stroughtonsmith I want to nuance this a little bit. I have done a fair amount of work with Claude Code and Codex. I am impressed and see a very bright future for them and for me using them and other tools like them. I know the feeling and what they can do.

I also have some experience as to what they cannot do. Replace Flutter or React Native is definitely not something they can do. Not even close. I fully acknowledge your experiences, I do. Just saying the world is larger.

@albrecht @stroughtonsmith I have used Codex to implement a new feature in a fairly complicated iOS app (Swift and UIKit) that is by no means standard. Most of the work is very obscure and non-UI and the UI part is very much non-standard for good reason. Codex figured it out nonetheless and it took me 3-4 hours, with less than 60 minutes actual work for me, to do what I have estimated would be 3 days of work otherwise.

Still: Will definitely not replace Flutter or React Native.

@stroughtonsmith isn't the purple the default color without dynamic colors from the wallpaper? 🧐 I guess you could also try to turn the game theme colors into dynamic application theme colors, looks good though!
@Memorion screenshot is before I made that change to the compact layout
Release 1.14.0-alpha09 · material-components/material-components-android

Important The compileSdkVersion was updated to 35. The minSdkVersion was updated to 23. Library is now built with AGP 8.11.1 and Gradle 8.13. Dependency Updates None Library Updates Catalog Mak...

GitHub

@stroughtonsmith An extra layer to this issue is what they showed off in the Material 3 Expressive announcement video is barely implemented in anything

What Google has actually released is such a tame version of what they announced