mohd-faraz

_blogs

// blogs / 20260822.md

Dev Log: August 22 Wrap-up

2026-08-22
#Android#Kotlin#CSV Export#Clean Code

Overview

Today was one of those 'closing the loop' days. I spent the morning documenting a whirlwind of fixes from the past week—everything from Regex bugs to encoding issues—and then spent the afternoon finally shipping a feature I've been putting off: CSV exports for the expense tracker.

What I Worked On

Giving users their data back (CSV Export)

I finally got around to implementing a CSV export feature. While I personally prefer JSON for backups because it’s easy to import back into the app, most people just want something they can open in Excel or Google Sheets to send to their accountant.

I wanted to make sure it wasn't just a raw database dump. Instead of showing internal category IDs, I joined the data so the CSV shows actual names like 'Food' or 'Rent'. I also had to be careful with string escaping. If a user has a comma in their transaction note, a naive joinToString(",") would break the entire spreadsheet layout. I went with RFC 4180-style escaping to keep things robust.

/* 
 * Mapping transactions to a spreadsheet-friendly format. 
 * We wrap strings in quotes and escape existing quotes to 
 * ensure the CSV doesn't break on special characters.
 */
val csvRow = listOf(
    data.date,
    data.categoryLabel,
    "\"${data.note.replace("\"", "\"\"")}\"",
    data.amount
).joinToString(",")

Reflecting on the week's 'Ghost' Bugs

While I was updating my internal logs, I spent some time thinking about that weird double-encoding bug I hit a few days ago with the backend decorators. It’s funny how RestTemplate tries to be helpful by automatically encoding strings, which is great until you’ve already handled the encoding yourself. Switching to passing a URI object instead of a String was a tiny "aha!" moment that saved a lot of headache.

I also cleaned up some UI logic in the onboarding flow. I noticed a bug where the 'Upload' button stayed active even after a process finished. It’s a small thing, but disabling that button once the state hits 'Executed' makes the whole experience feel much more intentional and less like a 'beta' tool.

Version 1.2.1

With the CSV export finished and the UI feeling a bit snappier, I felt it was a good time for a version bump. I pushed v1.2.1 to the repo. It feels good to see the version number climb, especially when the changes are things that actually make the app more useful for power users.

Wrapping Up

The app is starting to feel a lot more mature. Now that the export logic is out of the way, I might look into some more advanced data visualization or maybe just take a break and refactor some of the older Compose components tomorrow. We'll see how I feel in the morning.