Hey folks 👋
I’m working on a
conversational flow for expense splitting in my Android app (something like the screenshots attached).
Now I’m trying to refine the flow to handle
multiple real-life scenarios dynamically.
---
### Scenario 1: User uploads only the bill (no prompt)
👉 Flow should go like this:
1.
Bill uploaded card
* “Bill uploaded successfully. Whom do you want to split this with?”
* Collect participants (e.g. me, Akhil, Prasanna).
2.
Split method card
* “How would you like to split this expense? (Equally / By item / Custom share)”
* If “Split by item” → show existing item assignment card.
3.
Payer card
* If no payer is mentioned → “Please select who covered this expense.”
4.
Final summary card (new)
* Show expense summary (total, split details, payer).
* On confirm → Call API once with all collected data.
---
### Key rule: Skip unnecessary cards
* If participants are already mentioned in the prompt → skip step 1.
* If split method is mentioned → skip step 2.
* If payer is mentioned → skip step 3.
* If everything is provided → directly show summary card.
---
### My question to the community 🔎
Right now I’m thinking of two possible approaches for handling
edge cases (when user mentions some details in the prompt but not all):
1.
Keyword-based detection on frontend
* Extract participants / split method / payer locally.
* Show only the missing cards.
* Make
one final API call at the end.
2.
Delegate parsing to backend
* Send the raw prompt to backend.
* Backend decides what info is missing and returns the next step.
* This would mean
calling API at every step of the flow.
💡 Which approach do you think is more
efficient and scalable for a chat-like flow in Android?
Is keyword-based detection on frontend enough, or is it safer to rely on backend parsing even if that means more network calls?
Also, what patterns have you found clean for structuring these
multi-step conversational flows in Compose?
I’m leaning towards a
state machine in ViewModel (sealed classes like
BillUploaded
,
SelectParticipants
,
SelectSplitMethod
,
AssignItems
,
SelectPayer
,
ShowSummary
) but curious if there’s a more elegant solution you’ve used.
Any suggestions / best practices would be really helpful 🙏