Re-Charging

Development can get frustrating, and at those times I look for ways to get renewed and find the passion again.

This weekend I stumbled across the “Hello World Podcast”. It interviews various developers, writers and speakers in the tech world and talks to them about their 1st computer, 1st program and 1st job. The interview usually extends beyond that… but those 3 things are fun to listen to. Listening to others talk about why they started programming reminds me why I did. And this week I have already found myself writing extra code at night and thinking about programming than I was just last week.

So, if you have not found this podcast yet, I highly recommend that you give it a try. Make it a priority if you are finding yourself non-motivated.

UN-STUCK!!!

Last post I talked about that horrible feeling when you are completely stuck and cannot figure out what to do.

Luckily I am not at one of the best feelings a developer can have… getting unstuck again. I think it is proportional to the length and depth you were stuck… so needless to say I am on cloud-nine right now.

Here is what I was stuck on and how I finally solved it.

For the past few months I have been working with some friends on a new kid’s game for the Android system. The last piece on my plate was to add in Google Play Services so that I could add achievements and leaderboards. Tons of games have already done it and there seemed to be a ton of documentation from Google on the topic, so I figured it would be an easy win.

Unfortunately after a lot of effort to prep everything, when I fired up the app and tried to sign in, I got the error “Invalid Application” stating that my project Id or SHA1 cert was incorrect. I looked at over and over and found the client id tags in the Google Developer Console (remember this), and made sure the entry was added to match. Still no change. I then found myself going to Stack Overflow, blogs and using troublshooting guides on Google to try and find the answer. All to no avail.

The application stated that it might be because my account was not listed as a tester. Not being a stranger to weird things that happen with the project account being my own account… I had the other dev on the project try on his phone after ensuring he was registered as a tester. Same result.

So then I started to try everything I could think of…
– Add a new testing Google+ testing account, change my phone to that
– Manually install the APK with the ADB commands
– Publishing the apps and game services
– Turning on all of the Google APIs
– Deleting all the client Ids and re-entering them
– Release mode, debug mode, new mode…

Nothing. The same error message continued to mock me on every app start.

The only thing that I saw in the back of my mind was that the project id had the old project name in it, rather than the new one. I had changed the files I thought I needed to do in Android Studio… but maybe something was still wrong. So I spent a couple of days creating the app from scratch, copying over the code that was needed, making sure everything was set up as the new application, swapping over the git repo. When it was done, I fired up the app and…. same error screen.

This was about the time I started to question my skills and I got annoyed just to open other apps on my phone that had Google Play enabled because I was upset others were able to do it, but somehow I had failed.

Also I was annoyed, not only that I had wasted nearly 2 months of time, but now the developer console was a mess with remnants of both app versions. So I reached out to Google support finally to ask if they could assist in cleaning one (or both up). Email was slow and painful… and then I found that during the day Monday-Friday they had online chat (which I love… all sites should offer this if possible). After talking with a Jeff J for 30 minutes, my console was as clean as it was going to get and I was ready to try again.

I entered the minimum information that was needed, re-installed the application and… BOOM. Same error message. It was not looking good for our favorite developer my friends. Might Matt had struck out.

Okay… back to the drawing board. WHAT WAS I DOING WRONG?

I reread EVERY line of the Google Play Services troubleshooting page, and followed every step to the letter. I found that my APK signing key was having issues with the space in the name, so I recreated it from scratch with no spaces in the key name. Still got the error, but something told me to keep following the steps. A few more steps down I found a small line of text that I had missed before… “You must create the new client ID in the Google Play Developer Console, not in the Google Developers Console.”

I stared at that line for minutes in disbelief and started to check that I had indeed been adding the matching SHA1 certs in the “wrong” console… even though they both link to the same place. I cleared out the ones I had entered, and re-entered them in the correct console.

I pushed out the changed application and waited for it to start…

“SIGNED IN!”

That was the best debug message I had seen in a long time.

I want to blame Google for allowing me to enter something in the “wrong” place. With all the recent changes, the instructions and troubleshooting are off slightly from what is actually there… but that was there the whole time, I just never read it closely enough.

And THAT is why you need to read all troubleshooting steps carefully, even when we think we already tried it.

Hope you all got some joy out of this, I am too happy to feel silly at this point (and I am sure it will happen to me many times in the future).

Stuck

Have you ever come up against a coding issue that you have no idea how to solve? Every been truly stuck? I do not find that it happens a lot, thanks go Google and Stack Overflow… but it does happen. Right now I am stuck on Google Play Services. I have tried every troubleshooting tip I can find, changed every setting, entered and re-entered everything only to come up blank. It is frustrating and definitely takes the joy out of that night of hacking… and the longer it goes on the harder it gets.

What do you try when you are stuck in a situation like this?

The final 20%

I think the 80/20 rule is the one rule that has about 1,000 different uses in the development arena. I have heard so many interpretations that I could not even begin to guess which one is the original. However, the fun thing about it, is that it does seem to work for all of the ways that it is used.

The current Android App that I am working on, Pet Life, is in the last stages of getting version 1 out the door. Six or Eight weeks ago, the three of us working on the game made a list of nice-to-haves and need-to-haves for the game and decided that when we got all of the needs done, we would ship. This meant that we could get the game into the hands of the players as fast as possible so that we could see if the nice-to-haves were relevant, or if we missed any needs. This has helped us to stay very focused and rapidly get stuff done. If the code/views worked, we went with it… because we could always change it later. The freedom that this gives you is something that you need to experience if you have been in Enterprise mode for too long. You start just coding… and making it work. And we have been amazed at some of the great innovations that have come out of this just from the organic way things have come together.

So now we are done with the 80-90% of the need-to-haves and starting the last few tasks to get that final 100% done. What I am seeing now is a lot of new “nice-to-haves” that we are adding as we start to get a good grasp on how the game is actually working, and yet at the same time… all of them are items that could probably be done in a few hours of coding at the most. But this 20% is definitely the hardest of the bunch… yet we are still moving at a rapid pace.

Our goal is to launch version 1 this weekend and see where it goes. There are a lot of fun things we have planned if the game gets traction and people respond well to it. If they do not, we have a laundry list of other apps and services that we want to create.

If Flappy Bird has taught me anything, it is that a perfectly polished game, especially in the mobile realm, is not necessarily where the next big thing is going to be. Rapidly prototype your ideas, get your products in the hands of the users and see where they want to take it. Then you can focus your time on meaningful work if you find yourself with a hit, rather than spending months on items that no one ever appreciates it. And if 100 quick apps later… no one has bitten on anything you made… you will have learned a lot more about shipping code, and that in itself is very valuable.

Fresh Perspective

I fell into a common coding trap over the past week. I found an issue with my current Android project and spent the week trying everything that I could to get it to resolve. In the end I think I ended up back at where I started… without success. I know a lot of ways that do not work now, and for that I am thankful, but I was really burnt out and frustrated last night.

After talking to another team member, I decided it was best to shelve it with the version that I found that worked the best (just a minor case that broke the app, rather than the large quality that was there originally) and focus on something else. Within 30 minutes I had a ton of small tasks off of my plate and a few fun pieces added as well. It felt great and I was instantly re-engaged in the project. I have a few ideas on how to fix my problem now, but still going to wait and make sure I can really approach it fresh again.

It does not always work but I have found over the years that it is always worth the effort to try. Give yourself a break, work on some tasks you know you can accomplish and come back at the problem again. You will find yourself in a better spot when you do.

Repo

One of the tools that I always felt was a secondary thought and did not matter much was the VCS. That was until I finally started using Git last Summer. It took some getting used to since I decided I wanted to force myself to use command-line controls instead of a tool. I felt that this gave me the most control, and the best way to truly understand the power of the VCS rather than what an intermediate tool was making easier or harder and go from there.

If you are reading this, I am sure you have had a similar experience with Git, and if not… you need to give it a try. The online tutorials where you can play with a sample repo is pretty amazing… and above all, you will learn that a VCS can take a lot of pain out of your development process. I remember the first time I heard about branching and how amazing it sounded… but after trying it through the years and experiencing painful merges upon painful merges, felt it was not really a solution. Git just makes that simple.

I need (really want) to get back to coding so I am going to keep this short… but another recommendation I cannot talk up enough is BitBucket. It just works. Easy to use, free for even small (5-10 depending on current promotions) team member repos. It is a great service and I never hesitate to recommend to everyone I can. Give it a try.

New Horizons

Where I have been? Well I got further into Unity deving than I expected and actually got a game into a late Alpha state with another dev friend. We were able to do some test plays and get a fun product… but with the overwhelming costs of licenses on the horizon we turned to Kickstarter to see if our game (KickPunchFireball.com) had a chance of getting funded. We saw a bunch of friends and family come out to support us and were able to get new faces, but it ultimately did not succeed.

Is this the end of our hero? Not by a long shot.

The one thing I found that bugged me during the first game though was that my oldest son was interested… but because of the violence I did not feel it was something I could readily share with him. That had to change.

I have had a lot of ideas in my head the past few years… and some kept coming back up. One of those was a fun kids game that could appeal to older ages as well. So I enlisted two other friends and we have started making a very straight forward version of the game. Why? Well I want to see how the reaction to the game is. We are doing it on Android because that was what we all owned, and I like the environment. We already have a playable version in just a few weeks and should be able to launch it in the store in a few more. (More to come on that).

It has been an amazing release from the stress of the day. Just coding and having fun coding. Sure I am using some design patterns and other tricks I have learned… but when I get into a situation where I am not sure the “best way” to code something… I remind myself just to get it to work and I can refactor it later. No one is going to judge me on the code … and I have found myself coding faster and better as I go. And most importantly… having fun.

And now I have been able to show my son and even let him play some early rough versions to see if he liked it.. and he even came up with a better name for the game than I did that we are going to use… something which made his day that he was going to have a credit in a real video game.

So much fun. Never realized how far from my initial love I had moved… coming back to it has been a great experience.

Follow

Get every new post delivered to your Inbox.

Join 318 other followers