Side Project Time Hacks: Automating My Apps’ Store Listings

 

In my last post, I introduced the concept of programming small personal utilities as a means to improve your efficiency in order to squeeze more time out of the day. I also explained that it really doesn’t take much programming knowledge or experience at all to create something that makes a significant impact on your day to day operations.

As my first post in this indefinite series, I’d like to introduce a simple tool I built in an afternoon which has not only saved me hours of time through the past few months, but can also be built by anyone after just taking an introductory-level course in programming.

 

The Problem:

Before I describe the solution, it’s probably best to describe the problem that I was having. If this is your first time visiting my website, you may not know that I create and publish quite a few Android apps. One of my more popular projects is a collection of apps called “Scratch-Off Guides” that help people decide on lottery scratch-off tickets to purchase when they are in the store. Each individual app is for a different state lottery, and at the time of writing this I’ve published 14 so far. If you’d like to read more about what they do and how they work, you can do so here.

The main difference between each of the scratch-off guides for different states is in the ticket data they present, however they are still fundamentally each the same in how they look and function. Because they are all so similar, it means that for things like the App’s store listing, I can write it once and just use that everywhere but replace the relevant state name and abbreviation for each individual app. In other words, there’s no use in writing a completely different app store listing for the California app from the Florida app.

Every time I would go to update the store listings for those roughly a dozen or so apps, I would write it once, copy/paste the new description into the store listing for each app and then replace each occurrence of the state name / abbreviation with the actual state I was on. Easy enough to do, but it actually became extremely time consuming.

Even though it was just copy/pasting and then using the “replace” shortcut in a text editor, it would take me AT LEAST 30-45 minutes to finish updating all of the 14 store listings. Another issue with that process was that I was constantly concerned that I would make a mistake and (for example) accidentally use the abbreviation “CA” instead of “FL” in the Florida store listing. I’d have to check and double check each listing to make sure it was done properly, which added more time to the whole process.

 

The Solution:

Now that we’ve gone through the problem and how much time it was taking from me, we can get into the solution. Essentially all I needed to do was create a tool that automates the process I was previously doing by hand.

I needed something where I could edit a master template store listing description document and it would automatically generate the store listings for each state app (all 14+) in their own individual text files. I also needed it to be configurable to easily add extra apps in the future and also configurable to add in extra templates for each store that I publish on (because there are actually a good number of 3rd party app stores out there).

This means that my new process is to edit the master template file with whatever changes needed to be done to the store listings and with the click of 1 button I’d instantly have 14+ text files generated. From there I can then just copy/paste into the Google Play Store / Amazon Store listings for each app and click “save”.

The new process with the custom tool saves me at least 30 minutes of monotonous busywork every time I go to update the store listings for my collection of Lottery apps. Another thing to consider is that the future time savings scales very well as I expand to other app stores beyond Google Play and Amazon because I can simply create new templates for each new store I need to support.

It also scales well as I add more states to the collection. So if in a few months I expand from 14 to 25 states, the tool saves me even MORE time compared to my old method of copy/paste/replace by hand. Lastly, the new method by using the automated tool makes my job a bit more human-error proof. I no longer need to read and re-read the descriptions to look for any mistakes or missed replacements.

 

How Does it Work?

I mentioned at the beginning that this tool can be built with an introductory level knowledge of programming. I chose Java because it’s the language I’m most comfortable with which means I could write this project fairly quickly, but you can easily write this project in any language you want to that supports file IO. I also haven’t had much experience with the Java 8 NIO stuff and really wanted to try it out. If you want to browse the source code and follow along, you can find it on Github here.

I also have no idea what sort of audience is going to be reading this post, so I’m going to play it safe and explain things on the more verbose side.

 

Lottery Store Listing Generator Package Structure

General Package Structure

 

Looking at the screenshot above, we can see the basic package structure. The configuration package contains the text file called “StateList” which contains all of the states that the generator needs to process. Any time I create a new state app, I can simply add another line to this file with any of the specific state details that I need.

 

StateList.txt

StateList.txt

 

Moving down to the listing_generator package, we have just a single class called StoreListingGenerator. This is where the bulk of the logic for the project is contained, so all the main class has to do is call a method from the StoreListingGenerator.

I also have a package full of pojos (plain old java objects), a directory called “results” to put the output text files, and lastly a directory that contains all of the templates I need to process.

 

SampleAppStoreTemplate.txt

SampleAppStoreTemplate.txt

 

Before we get any further, I wanted to explain how the “templating” works. All I did was write a text file template (see above for sample) and and in that template I’ve included tags that are surrounded by curly braces { }. I use these as tags for myself in a couple of different ways.

First, I have some template metadata at the top of the file that I later use to name the output text files. Then, you’ll see some {st} and {state} tags. When the generator is reading the template, anytime it comes across a {st} tag, it will replace it with the current state’s abbreviation. So things like “FL” for Florida, “CA” for California, etc. The {state} tag serves the same purpose, but it will be replaced with the full state name.

 

StoreListingGenerator.java - Main App Logic

StoreListingGenerator.java – Main App Logic

 

Inside StoreListingGenerator class, all we need to do is automate the process that I previously was doing by hand. The rough pseudocode is as follows:

  • Load in all of the states that I need to process
  • Load in all of the templates that I need to process
  • For each template, generate a store listing for each state and output that to it’s own text file.
  • (Done)

I kept the templating very simple and just replaced each {st} occurrence in the template with the current state’s abbreviation (FL, CA, NC, TX, etc). I then do the same for the full state names (which you can see below).

 

StoreListingGenerator.java - Generating State Listing for Template

StoreListingGenerator.java – Generating State Listing for Template

 

Finally when I go to save the new listing to a file, I make sure to generate a special file name that tells me which template (app store) it’s for, which version the template is on, and lastly which state it’s for.

 

StoreListingGenerator.java - Saving Each Listing Text to File

StoreListingGenerator.java – Saving Each Listing Text to File

 

 

Wrap-Up:

So, that’s about all there is to it! At the click of a button I can now generate all of my different app store listings into their own uniquely named text files, which I can use to just copy/paste into the different online app stores that I use.

App Store Generator Results

App Store Generator Results

While the tool provides immediate value to me today, it also has the potential to save me even more time moving forward as I expand to other app stores and build out additional states – which is exactly something you should be looking for when you consider building your own “side project time hacks”.

The whole point of this blog post series is to demonstrate that it doesn’t take much to build something useful that can automate something in your life – which frees up more of your time to focus on the important tasks and projects you need to accomplish.

If you’re interested in more of my side project time hacks, you can find a running list at the bottom of my series introduction here. Alternatively, I publish other miscellaneous posts from time to time, which you can find here. Thanks for reading!

MNM Applications Logo

 

 

Subscribe to receive future posts straight to your inbox.

* indicates required


 


 

New To Java or Programming?

Here are the top 5 books I recommend to help you get started. Note – these links are affiliated, so if you buy something I get a small kickback of a few cents that helps me afford some coffee here and there. Thanks for the support!

"Effective Java" by Joshua Bloch

  1. Effective Java” by Joshua Bloch

Joshua Bloch is a contributor to several major Java classes / APIs including the java.lang and Java Collection framework, so he is just about as reputable as it gets in terms of someone to learn Java from. The book goes into detail about many best-practices, which are all extremely insightful and things I wish I had learned sooner.

 

 

"Test Driven" by Lasse Koskela2. “Test Driven” by Lasse Koskela

If there’s one thing that slows down or inhibits project development more than anything else, it’s the result of poor testing. Learning the ins-and-outs of Java (or any programming language for that matter) is only part of the equation – the rest is how you use it, and how you test it. This is the best resource I’ve found to learn test driven development – which you’ll find all over the enterprise world. I highly recommend you give this a read.

 

"Java Concurrency in Practice" by Brian Goetz, Tim Peierls, Joshua Bloch, Joseph Bowbeer, David Holmes, and Doug Lea3. “Java Concurrency in Practice” by Brian Goetz, Tim Peierls, Joshua Bloch, Joseph Bowbeer, David Holmes, and Doug Lea

Another extremely important programming skill once you start to get into some bigger projects is concurrency. Essentially, concurrency is a concept that allows you to run different pieces of code at the same time – which can cause for some scalable performance gains or is useful for any network functions you might need to use. If you aren’t careful however, it can cause some very serious problems with race conditions – so if you’re unfamiliar with the concept in Java, I think this is about the best resource you can find on the subject.

 

"Clean Code" by Robert C. Martin4. “Clean Code” by Robert C. Martin

If you’ve ever worked on a large team project, you may know what a struggle it can be to read someone else’s code. Everyone has their own style, habits, and naming conventions. Even how Java should be spaced and tabbed is hotly debated. “Clean Code” will help you learn the best practices to write clean, readable code. Trust me, your future project teams will thank you for it.

 

 

"Elements of Programming Interviews in Java: The Insider's Guide" by Adnan Aziz, Tsung-Hsien Lee, and Amit Prakash 5. “Elements of Programming Interviews in Java: The Insider’s Guide” by Adnan Aziz, Tsung-Hsien Lee, and Amit Prakash

This is one of my go-to coding interview prep resources (alongside of course the ever-popular “Cracking the Coding Interview” by Gayle McDowell). The book will present you with challenging problems and puzzles (similar to what you might come across in a coding interview) and will show you how to think critically to come up with efficient algorithms for your solutions.