Writing a program to solve or automate a task you do regularly is the best way to learn something new in coding.
Recently I’ve learnt a little bit about Android, java and regular expressions as a by-product of wanting to simplify and automate tasks I perform related to my podcast listening.
I listen to podcasts a lot, and do so by downloading them via WiFi using my phone, and then transferring them to a USB drive for insertion into my car’s front-loader. That is for me the most convenient way of listening to them.
I also like to keep track of what I do each day and publish this to my blog in the weekly-update category. This I learnt from swimgeek who has been doing this for years, and which I find strangely motivating. I record these snippets of information using an Android app called MomentDiary. The podcasts I listen to I’ve made part of this stored information.
So here are three things I set out to make as simple and as automated as possible:
- transferring podcasts to a USB drive;
- including the podcast name as part of my weekly-update;
- generating and formatting the weekly-update blog post.
To solve 1, I wrote an Android app called MoveFiles to do the copying as a one-click step. All it does is move each file, possibly in a directory structure, from the public Podcast directory to the USB drive. This was an exercise in AsyncTask and the Visitor design pattern.
To solve 2, also using the same app, and as part of the file move operation, I make a diary entry for the copied filenames. So my weekly list contains the podcast filenames copied in that week. In doing this I learnt how to share between two apps.
To solve 3, I wrote another Android app called Reformatter to act as an intermediary where the text shared from the diary gets automatically formatted prior to it being shared again to the Android WordPress app. I can then publish in draft form a blog post already formatted the way I like it. In doing this I had some wonderful experience with regular expressions.
I have plenty of projects that I’m initially very motivated to write. However more frequently than not I either never start it, or I drop it early on. This is because it doesn’t solve a problem of mine personally. That personal investment is just not there. However these two apps solve problems of mine and were therefore developed to completion. They don’t do anything complicated, but I rely on them, I use them frequently, and they make my life easier. There’s a great satisfaction in this.
Write code to solve your own problems or automate tasks you perform frequently.