Wednesday, April 25, 2018

Hard Truths about Android App Design

Here are some hard truths that every hobbyist Android developer needs to face at some point:

1. You are not going to make the next Flappy Bird - I mean seriously, I know that everyone thinks about their golden ticket. I would be lying if it didn't motivate me sometimes, but seriously, take a moment and scroll way way way way way down to the bottom of a search in the Play Store. The app you design is very likely going to be lower than that in search rankings. The likelihood of becoming a viral success is infinitesimal.
2. Your app idea isn't as good as you think it is - Yes, I know your mom (wife/best friend/whoever) told you that it is brilliant. But these are also the people who tell you how adorable your baby looks even though you know it uncannily resembles Yoda. It is hard to get honest criticism from the people closest to you, and it is hard for you, as the developer, to critically assess what you have made. But here is the thing, even if your app is awesome, you still have to contend with number 3.
3. Someone else (probably ten someone elses) have already made the app you are thinking of - Again, do a deep dive into the Play Store and take a look at what is available. I won't go so far as to say that there is nothing new under the sun, but people have been designing applications for Android phones for a long time now, and it is highly unlikely that you managed to come up with a totally original idea. And even if you did...
4. Marketing is as important as actual app quality -  Do you have any idea how much SuperCell spends in advertising? A quick Googling says something like 500 million dollars a year. If you dig into the details, it averages out to a cost of nearly $2 per install if you use a CPI (cost per install) marketing campaign for your Android app. Now, to justify that kind of spending, you have to be able to earn more than $2 per user on average. Can your app do that? If not, you have to look into other ways of marketing your app. Let me tell you from personal experience, marketing is tedious. I started Android development because I wanted to make apps, not beg people to look at them.
5. You are going to get bad reviews - So let's say you overcome all of these obstacles and people are downloading your app. Certain people are going to leave horrible reviews for no apparent reason. Out of six apps that I have have made, I am lucky enough that one of them gets a slow but steady stream of downloads. The problem is that it is a utility app (it allows you to use your phone and a Bluetooth speaker like a megaphone) and I get one star reviews without comment and one star reviews with walls of text criticizing me as a person and one star reviews saying "I don't like this game, it is stupid", and it drives me up the wall. I know that all the other apps in the market face the same issue (the average rating of similar apps is like 3.5, even though they all work generally fine), but it is frustrating that people are apparently writing bad reviews not based on the app itself.

At any rate, Android development can be fun and rewarding, but it isn't the free pass to early retirement that you wish it would be. You need to have thick skin, and you will be surprised how you feel when you release your perfect app, check the console the following day and see that zero people installed it. It is deflating, but that isn't a reason to stop. Keep working on your ideas, keep trying new things. Who knows, you actually might create the next Flappy Bird.

Sunday, April 15, 2018

How Exactly Do I Start Android Programming?

There are two main things you need to begin to learn how to code. The first is practical knowledge, what language to learn, what sort of SDK (software development kit) to use, where to go for help, etc. The second, which I would argue is more important, is motivation. If you have an idea for a project that you want to build, learning to program will be much easier. While it is probably a good idea to start with a simple project, if your dream project is something large and complicated you can still break it down into bite sized chunks.

As for practical knowledge, I mentioned previously that I started by doing the Oracle Java Tutorials and didn't feel that they were helpful in learning about Android programming. However, after sleeping on it, I think that by following those tutorials it 'primed the pump' as it were and helped me understanding all the stuff I learned later.

Anyway, let's do this in list format so it is a bit easier to follow:

  1. Have an idea - before you start it is a good idea to have at least a general idea of what kind of project you want to design. This will help with motivation and guide your learning so you can complete the project. It doesn't need to be a detailed road map, in fact I think it is better to keep your idea flexible so that it can change as your knowledge grows. For example, I have ideas for a lot of projects that turn out to be completely infeasible, but with a flexible mentality they often turn into other projects that are possible for me to complete.
  2. Oracle Java Tutorials - Take a look at the first three to five beginner tutorials here. There is really no need to go further than that because they don't apply to Android development, but definitely the first three will be a great primer on how everything works. Particularly the second tutorial will be useful for people who are just starting out.
  3. Install Android Studio - Now it is time to start the actual task of development. Download Android Studio, install it and get ready.
  4. Use Android Tutorial - Check out the early developer guides provided at These get pretty in depth, but if you go through just the first couple of them that will give you an idea of how Android development works.
    1. Android Studio can compile native C code as well as Kotlin and Java, but I recommend sticking to Java for the time being because there are a huge number of resources for using Java in Android development and that will come in handy as you learn.
  5. Fool Around - Now you should have an extremely rudimentary idea of how to develop a basic Android app. Try things out on your own. Add pictures and text, add links, try to change things programmatically, try to implement some code related to your app idea. A lot of this will not work, and that's OK. You can keep trying things and testing ideas, and it will give you a good idea what you want to learn and what direction you want to take your app idea in.
  6. Search Stack Overflow - This is the single most helpful thing you can do as a beginner Android developer. Once you have figured out what you want to do and have realized that you don't know how to do it, it is a great time to go look at Stack Overflow. Nearly every question under the sun has already been asked and answered with code samples and explanations on how everything works. 
    1. In addition to looking at the code in the answers provided, it is good to look at the code provided in the questions because we can see the kinds of problems people are running into. This will help us avoid these problems in the future.
    2. It is ok if you don't understand what the code means right away. Some of the stuff is more complicated than others, and there is definitely going to be code that is opaque to you.  This is fine, because a nice  thing about Stack Overflow is that people leave explanations in addition to code samples. Follow along as best you can.
    3. Don't be afraid to copy and paste code fragments into your own code and try to make it work. This is a great way to learn and it can help you figure things out on your own.
  7. BACK UP YOUR CODE - Once you start making simple apps it is a good idea to open an account at Github or Bitbucket to keep your code backed up.  Both are fine, and there are other options out there, but I personally use Bitbucket because it allows you to keep your code private (Github does this with a paid tier, but on Bitbucket you can do it for free). This might not be a big deal to you, but I am a little bit ashamed of my code, so I don't want others to see it.
  8. Sign up for a Google Play Developer Account - Once you have an app you feel ready to release, go over to the Google Play Developer page and sign up. Pay the $25 for a lifetime account, and get ready to publish your app!
  9. Release your app through Alpha or Beta channels first - When you go to release your first app, you might feel like it is a good idea to release to production immediately. Hold your horses! If you turn on pre-launch reports (it is in the menu on the left of the Play Developer Console page, under 'Release Management') and upload the app to Alpha or Beta, the app will be briefly tested on a variety of devices. This has saved my bacon on several occasions where I forgot something simple (like switching from test ads to live ads or a weird crash that occurred from the soundpool that I didn't notice because I had sound off) and it causes crashes on the test devices. 
  10. Pop open the champagne, you have an app in the Play Store!

This is a very brief overview of the basic steps that I followed to start Android app development, but I think they might be helpful to some others that feel like they don't know where to start. Over the next few posts I will dive into some of the steps in a bit more detail, and will discuss some of the hurdles that I faced in the very beginning.

Tuesday, April 10, 2018

Why Should Beginners Start with Android Development?

The main reason I decided to make Android apps rather than iPhone apps is because I have an Android phone (makes sense, right?), but there are other pragmatic reasons that make Android more appealing to hobbyist developers like myself.

First of all, to post your apps in the Google Play Store you have to pay a developer fee of 25 US dollars. This is a one time fee and once paid it allows you to post as many apps as you would like to the Google Play Store. Conversely, to post apps to the Apple app store, you have to pay a fee of 99 US dollars every year. While this isn't a big deal for larger developers, it is pretty unlikely for a hobbyist to make any significant money so a lower fee is going to be more comfortable.

While developing for the Apple app store might be slightly easier (fewer devices and screen sizes lead to less possible issues, Android's Java is notoriously bad at memory management, among other things), to a novice developer there won't be much difference at first. Also, this minor benefit is greatly outweighed by the ease of publishing on Android. Both app stores nominally review all apps that are posted, but Android has a much more lax set of standards which are easier for beginners (like me) to meet. This is good because as design novices it is very unlikely for us to create something amazing in our first go around and being able to see your app in the Play Store is much more motivation to continue compared to receiving a rejection letter from Apple.

Also, the Apple App Store has a policy of removing older, un-updated apps. While this is a reasonable policy, if you are creating apps as a hobby after your kids go to bed (like me!), it is a hassle to maintain all of your previous apps to ensure they meet future guidelines.

For these reasons, I think it is better to start out creating with Android. It is cheaper, it is easier to remain motivated, and your apps are likely to remain available longer.

A Journey of a Thousand Miles Begins with a Single Step

So a couple years ago I used to do Amazon Mechanical Turk to pass the time. I didn't really need the money, but it was fun (for some value of 'fun') and earned me a few spare dollars on the side. I never got super into it, but would just randomly do tasks that piqued my interest, and as such wasn't exactly efficient. At the same time, I wasn't really doing it for the money, so it didn't really matter.

Mechanical Turk is how I got interested in coding, though. One day I saw a long term job for like $10 or something (this was in 2016, so I am not totally sure) to test a Python teaching site. Aside from typing in lines of BASIC from the back of old computer magazines and doing some very, very basic coding in the same, I had no real experience with that side of things. At the same time, it was something I had been curious about and this spurred me to check it out. Plus, they would pay me to do it (sure, it was only like ten bucks, but why not?).*

After spending a few days going through the Python course I started thinking about how I could apply this to my own life, and decided that I wanted to try my hand at making Android apps. Knowing nothing about Android, I did a quick Googling and saw that most Android apps were created using Java. I then Googled how to learn Java and found the Oracle site, which had plenty of tutorials and documentation.

What I didn't realize at the time was that regular Java and Android Java were not exactly the same thing. I think doing those tutorials helped me grasp some basic concepts about object oriented programming and how everything fit together, so it was probably worthwhile, but had I known that they weren't directly related I might have skipped the Oracle stuff. Of course it is hard to tell how much it actually helped me, and I only spent a short time there, so it doesn't really matter much.

Next, I wanted to learn about how to put Android apps together. After a couple false starts, I ended up downloading Android Studio and from there began my incredibly successful and lucrative** app career.

Ok, the past two posts have briefly explained where I am coming from, and now the following posts will be a bit more pragmatic in nature so that they can hopefully help people like me who are just getting started. Until then, be cool and try to do something nice for a neighbor.

*I went back through my old emails and found the site but it is no longer active, which is unfortunate because I kind of want to reach out to the creator know that they at least helped me out. But I digress.

**this part is not true. 

Monday, April 9, 2018

Frist Post

So blogging is dead, but I have recently begun learning Android app design and wanted to kind of chronicle my progress. Unfortunately I might have waited a little bit too long because I already have six apps in the app store.

None of them are very complicated (or popular), and I think I only released my first app about a year ago (I just checked, it was about 18 months ago), though, so I am still very much a beginner.

One of the main reasons that I want to write about stuff here is that this is just a hobby to me. I am a university professor (totally unrelated field) and students are all under the impression that they can become zillionaire app developers or Youtubers or whatever. I would like to be able to point them somewhere that shows how making even a simple app is a ton of hard work and even if the app is perfect (as all of mine are ;)) that is no guarantee that anyone will download them.

Anyway, because of my job, I am lucky enough to have free time to do this as a hobby, but I also have three young kids so it isn't like I have hours and hours a day to spend coding and doing stuff. My main hope is that I can dissuade people who think that app making is a get rich quick scheme, and conversely I can hopefully help people who want to learn a bit about coding but are kind of scared and don't know where to start. To that end, my next post will discuss how and why I ended up designing Android apps. Until then, have a nice day and try to be kind.