This is part three in the series How to Build an Android App in a Week.
Now that we have an idea of how Android works, we can start designing the app.
As I stated in my last post, I found viewing Activities as logical divisions with discrete entry and exit points the most intuitive. Capitalizing on that, I will center my design around that. BUT WHAT AM I DESIGNING.
WHAT IS HE DESIGNING?
When looking at what I want to make, I settled on a few axioms:
- I want something people will use
- It needs to be small enough to complete in a week
- It can’t be anything too “cool,” or else it won’t get completed/people won’t use it.
I want something people will use, so I looked at what I’d really like to use. In about a month I’m going on a trip for a few weeks, and I’ve noticed keeping in budget can be pretty difficult. Whether it’s spring break, a weekend trip, or a holiday vacation to mom n’ pop’s, it’s hard to have a concrete idea of how much I can spend today, tomorrow, or any other day and stay in the sweet-spot. Overspending is bad, but underspending is even worse. JUST THINK OF ALL THE FUN YOU MISSED WHEN YOU COME HOME WITH MONEY.
Building on that, it needs to be small enough to write in a week (or just 3 more days, AAAAGGHH!). Luckily, this is in harmony with “something people will use.” Features should be minimal, and the app should be streamlined to make entering costs as easy as possible, so you don’t need to drop out of the action too long to keep it up to date.
Last, it can’t be too “cool.” I’ll just have to keep this in mind as I’m thinking about all those dream features.
Thinking about all of the above, I settled on some bullet-points:
- The app shouldn’t get in the user’s way. Input should be validated as soon as it’s input, so the user can see in real-time what he’s entering. Second, except for the cost, every other field should be optional.
- Trips should be easy to set up and intuitive. That means as few fields as possible.
- The app should be easy to manage. This means that when the app fires up, it should read the user’s mind. Ideally, it should open up the last accessed trip on the current day, so checking your budget is immediate and entering new expenses is just a number and a button press away.
Building on this, I have for a Trip object:
- A start date (mm/dd/yy)
- An end date (mm/dd/yy)
- A budget
- minimum daily amount, which is the minimum amount necessary to live on in a day.
That last one bears some explanation. Minimum daily amount is the minimum amount you need to get through a day of the trip. This includes travel expenses, food, and whatever else. It should be just a little generous. This’ll prevent someone from inputting a future cost that wipes out all their money for the day. For example, if your taking a week-long trip, your budget is $700, you’ll have a budget of $100/day. Let’s say you need at least $50 to make it each day, and on the second day you buy $80 tickets. Since that leaves you only $20 for that day, the rest of that $50 will have to come from other days. Thus, $30 / 5 = $6 will be taken from the remaining days of your trip, leaving you with $94 per remaining day in your budget.
Each expense should give you a basic idea of what it’s for, should be for an amount, and should tell you when it was made. This means a Trip object should have:
- A date (mm/dd/yy HH:MM)
- A cost
- An (optional) description (ie food, gas, tickets)
Following, the app should read the user’s mind. The easiest way to do that is to separate every screen into an activity, and have a screen leading to another call that activity. This way the app can be navigated using the Android back button, which essentially calls the finish() command in code. Whatever the user accessed last will be the first thing they see when they fire this baby up.
The slightly harder decision is how it should look, and how it should flow. I mapped these out the old-fashioned way:
Apologies on the quality, but my house is almost always lit like a Tim Burton movie. The first are just some takes on the different screens, and the second details how activities and intents will link together the different parts. There will be a main screen, a Trip View screen, A CalendarView screen that’ll allow you an overview of your finances, and maybe some settings/other stuff. Not included are the Activities that will run the non-UI stuff, namely the DatabaseConnector which will abstract out the SQLite calls needed to get the data. It’ll be some serious CRUD (ha ha). The other piece will be the Trip class that’ll manage the state of your trip and do the calculations necessary to make everything work. Each Activity will be responsible for creating the listeners that will glue the back-end to the front-end, and things are starting to look pretty complete.
From here I’ll move on to coding (Finally!). Check back soon to see the finished product.



