DONN FELKER

Lessons Learned From the Software Industry

  • Home
  • About
  • Development Training
  • Fragmented Podcast
  • Learn to Work for Yourself
  • Contact

Connect

  • GitHub
  • Google+
  • Instagram
  • LinkedIn
  • RSS
  • Twitter

Powered by Genesis

Why You Should Use a GIT SHA in Your Crash Reporting

June 24, 2015 by Donn Felker 8 Comments

A common problem developers encounter when developing applications that use a crash reporting tool like Crashlytics is determinig if a particular crash/bug has been fixed/addressed or not.

For example assume that you get a crash report for a recent release. But you released three times this week already … which release does it apply to?

This is usually solved by reviewing the version code and verison name in Crashlytics. But even then you have to be properly tagging your releases. If you’re doing that you can trace back the release to a particular commit and then investigate.

However … Lets be 100% honest here – not everyone does this. Unfortunately , very few companies do this in my experience and it declines even more when the size of the team deminishes to even a single developer. There’s a lot going on, its easy to miss. Furthremore, chasing down a tag, then finding a commit, well … its kind of a pain. If someone forgot then its all for nothing.

That said, here’s a quick tip that can save you a ton of time when you’re performing crash and bug triage with tools like Crashlytics.

Adding The GIT SHA
In your Android application, open the build.gradle file and add the following above the android block.

// Hat tip to Jake Wharton for this - found it in the u2020 app
def gitSha = 'git rev-parse --short HEAD'.execute([], project.rootDir).text.trim()

Back in the Android block add a git sha build config constant.

android {
 compileSdkVersion 19
 buildToolsVersion "21.1.0"

 defaultConfig {
 applicationId "co.your.appname"
 minSdkVersion 19
 targetSdkVersion 19

 buildConfigField "String", "GIT_SHA", "\"${gitSha}\""
 }

}

Now go back to where you’ve set up your Crashlytics instance in your application code (example shown below). Just below the initialization script add the following code:

Crashlytics.setString("git_sha", BuildConfig.GIT_SHA);

What this will do is set a string with the key value being “git_sha” and the value being the short git-sha from your source control.

Now, when your application crashes you’ll get a bug report in Crashlytics and you’ll be able to see what the latest commit was on that code.

Reviewing in Crashlytics
Open Crashlytics and go to one of your crashes. Then click on “more details”. Here you will see (screenshot below) the git_sha that the application was built off of.

Then you’ll see this ..

 

Remediation
Once you have identified the crash and the git-sha you can checkout that exact version of the code by issuing

git checkout git_sha_goes_here

At this point you’re in a detached head state. You’ll want to see what caused the crash in this state. Then you’ll want to return to your current develop branch or tagged branch to fix/hotfix the issue and release the fix.

The git_sha saves a ton of time and its super easy to set up. You no longer have to dig through git logs, tags, patches, etc to find “what commit is this crash happening on? Did we fix it already? How can I find out?” Simply check the git sha, look for the bug, see if it’s fixed yet. If it is, cool. If not, fix it and be on your way.

I hope that helps!

** Update **

Jake had a great comment in the reddit thread that I wanted to share …

Worth noting that this will break incremental compilation as you commit (and thus cause the value to change). Internally we switched to writing the SHA to a file if it is missing and using the file’s value (we do the same with build timestamp). This means that only a clean build gets fresh values. Since CI builds and making releases are always clean (right? RIGHT?) it keeps developer builds fully incremental yet still gives the right values where it matters. – Jake Wharton

Filed Under: Development, Mobile Tagged With: Android

Fragmented Podcast Episode 2

March 3, 2015 by Donn Felker Leave a Comment

We just released Episode #2 of the Fragmented Podcast.

This week Kaushik and I discuss our IDE of choice – Android Studio (and IntelliJ).

Enjoy. 🙂

Filed Under: Development, Mobile

Is Google IO Worth It?

February 16, 2015 by Donn Felker 2 Comments

Update 2017-04-04: I’m revisiting this because I’m once again at an inflection point – do I go this year or not? I found myself running the numbers again (as I do in the post below) and what I came to the conclusion is: I don’t think its worth it. Why the flip-flop? Well, simply put … last year was a disaster from what I hear. Also, I’m looking at the schedule and I’m not convinced its that I’ll learn a ton. What about the social aspects and networking? No doubt that it is a huge thing. Networking and such is the primary draw IMO. Hang with me for a second though … Unfortunately, with my new estimates I’m seeing the costs, for an indy developer like me, to be around $4,500. The cost is lower than the calculation below because this new calculation cuts off Friday (I’d be leaving a day early and flying in late the night before the conf). At this point I ask myself … “If someone told me Google IO would cost me $4,500, would I say ‘HELL YEAH!’ or would I say ‘No.’?” To me, that’s an instant “No” (please read this post by Sivers on “HELL YEAH” decision making). Lets recap …. $4,500 for a conference? I’m also cutting it a day short? Meh, no thanks. For that level of money the conference had better be something that I can ONLY get while in person, and preferably something life changing (you can go on amazing vacations for this same amount). Maybe thats what you’re doing (treating this like a vacation and you’ve never been to CA/GOOG/etc. In that case, cool. However, I’ve been to the valley before, there is no allure there anymore. On the flip side of the coin though … if I were a full time employee and I only had to pay 1/6 of this amount it would be a HELL YEAH, unfortunately thats not the case.

Update 2015-09-01: After getting more and more involved with the Android community over the last year+ I’ve found that Google IO is worth it. You just have to know where and what you’re doing it. In the end, it’s about networking and learning and exposure. Getting out there and being with like minded folks. The post below outlines how it feels when your expectations of the event mimic the advertisement of the event. I do feel like it’s mis-represented and the content could have been more on topic with developers and the tracks could have been clearer. 🙂


 

This is the question I asked myself last year before I went to Google I/O 2014. I’m an independent consultant who has to foot the bill for all of these types of trips. So not only does the ticket price get you in the wallet but so does the flight, hotel, meals and time off of client work. After weighing the options, I spoke to previous attendees and figured out what they got out of the conf and I figured it was a no-brainer. Totally worth it based upon their personal feedback.

I still decided to calculate the costs. When all said and done, this conference can easily cost any consulting firm around $7,500 per person.

You might be shocked, but let’s break it down.

  • Google I/O Ticket: $900
  • Flight: ~$300
  • Hotel in SF near Conf: ~$1200 (if you’re lucky)
  • Meals/Etc: $300
  • Lost Billing Time: $4800

Billing time is calculated at a very common rate of $150/hr for most consulting shops that perform quality work. Again this is a rough estimate.

With these numbers, you can ask yourself “Is going to Google I/O worth $7,500? It’s ultimately up to you to decide, but here’s what I determined …

I Came, I Saw, I Left Depressed

I know that may sound harsh, but it was exactly how I felt when I left Google I/O 2014. You may be wondering “its nearly 8 months since the conference happened, why is he bringing this up?”. Simply put – I was not sure what the network effect would be of Google I/O. The network effect does not happen overnight, it takes some time and that’s what I wanted to give it – more time.

I’ve probably written this post a few times now, each time I’ve deleted it. Yup, typed it into the editor, reviewed it, edited it, then deleted it. Today, it feels right, so I’m writing it and posting it.

On my way to Google I/O I was pumped. The only other conference I’ve been to of this magnitude was TechEd in Orlando in 2008 (I think /build is the new big one in place of TechEd, I think). When I went to TechEd I was blown away. Seeing that Google was the new hotness in the industry, I figured this con would blow TechEd out of the water. Unfortunately, that was not the case. I showed up with some teammates from MyFitnessPal  and we walked to the Moscone center where the conference was. I was dumbfounded. There was a line wrapped one and half times around the building. This was the line to get into the Keynote. INTO THE KEYNOTE. It was 4-6 people wide and looked like a gigantic snake of people around the building. We got in line and waited. If it’s this popular, it’s got to be good, right?

After about 35-40 minutes of truffle shuffling around the building we got in. There were barely any seats left and the line still went around the building. Crazy. Seat nabbed, time for action to begin.

The keynote was nothing spectacular. A new OS which looked cool, Android Auto, Android TV, and Android Wear all came out of their shell in a big way, but I’ve been skeptical of all of these technologies for a bit. Not because I don’t believe in them, but because I don’t think they’ll work right now. I feel that these technologies that we have (wear, auto, tv) are all stepping stones to something bigger and better. We have to go through this phase of technology to get to the better stuff. People hate vendor lock-in and that’s exactly what Wear, Auto and TV are: Android Vendor lock-in. Don’t get me wrong, I love Android – I can’t stand using iPhones. What the developer side of me saw was cool new tech, but the realistic business side of me saw vendor lock-in and a fight for a portion of the market. I saw three new products that needed to have some major push behind them to work and I didn’t feel any of them were going to get the public relations and developer relations attention they need to succeed. In my eyes, I was looking at something that was not a huge starter for me. The one exception to that was Android TV with the ADT-1. Mixed with Chromecast I think there are a lot of opportunities to take existing tech to the next level (in some areas).

The keynote being a bust wasn’t really a concern of mine. To me, keynotes are usually huge marketing webinars, but with $1000 ticket price to watch in person. Honestly, think about that next time you’re in a big keynote (Apple, Google, Microsoft, etc) … Does this feel like a webinar? Probably. You’ll be surprised. Next up was the sessions.

I went to numerous sessions throughout the days. Covering Wear, Material Design, Async Design Patterns and so forth. All from Google employees. If I had to rate them, most of them would be 4-5 stars out of 10. Not because the presenter stunk (though there were a few of those) but because the content was so shallow that I felt like I was being shown the magic and nothing behind the curtain. I felt like some of them were mini-keynotes for niche areas of Googles product teams.

All Is Not Lost

While the sessions were a big let down I did find some amazing other areas of the conference. Usually these were on the floor. I wouldn’t call these sessions but more watch and learn labs where the presenter is talking to 10-30 people around an open podium. I got to witness how to use Dart and some advanced features of Android. How to write Go and so forth.

Another area that myself and a couple employees from MyFitnessPal took advantage of were the hands-on labs. You could pull up a chair and try out some code. I was able to learn polymer quite quickly and then if I remember correctly I did a bunch of AngularJS because it was something I had already been playing with and wanted to dive into more. The Android topics were all very shallow and didn’t go too crazy. It was all stuff that I had done before. I think those courses would have been great for a beginner though.

The most interesting area of the conference to me was the open discussion/presentations that were around entrepreneurship. Two of the best talks I heard were very short, but packed with insightful tips for those interested in building apps/companies. These two talks were my sanity savers at Google I/O. Those two talks were by Aaron Harris of YCombinator and Adora Cheung of Homejoy. These talks should have been much longer and more open. Both were packed.

Google Goodies

As with every Google I/O goodies were to be had. I was able to make it out with the following:

  • An LG G Watch MSRP: $229
  • A Moto 360 Watch (later shipped to me in Aug/Sep time frame) MSRP: $249
  • A Piece of Cardboard MSRP: FREE for DIY or $15 for a kit

I was also lucky enough to speak to one of the Google TV folks and asked him if I might be able to get my hands on an ADT-1. He said they were all gone but he’d take my info just in case, but he re-assurred me that I would most likely never get one. 3-4 months later a magic box shows up at my door – it’s an ADT-1. I don’t remember your name good sir, but thank you very much. I’ve been playing/testing/etc for a bit. 🙂 From my research online it looks like ADT-1’s are being sold for around $350 through various channels (EBay, Craigslist, etc).

Extraciricular Events

Though the Google I/O sessions were lack luster one great thing was the Google I/O party. They had great food, great drinks (lots of micro brews) and great entertainment. It was good to be with friends, meet new ones and have a good time.

The other events that made this trip better were the other parties going on in the area. Twitter’s being the first one. This was a great place to go. Lots of great people and such a cool vibe. Bit thanks to Hemal for getting us in there. We also went to the first Big Android BBQ in SF. Met some cool folks there and I’m still rocking the Phandroid pint glass that I got there to this day. There were many parties, too many to get to. That’s where it seemed like the real networking came into play.

Was It Worth $7500?

No. Not really. You can take all my goodies away and I’d still stay the same thing and I would not be upset. I feel that this conference at one time may have been a great event. Unfortunately in 2014 Google I/O turned into a marketing conference and the content was rather shallow. I hope that changes, because I love Google’s products and I like the Android platform alot. However due to what I experienced in 2014 I have no interest in attending in 2015.  I look at it objectively – do I feel that am I going to get $7,500 in value out of it? Combine the learning, the networking, the goodies and the mental vacation from being away from the office and I have a quotient for me that says: Nope, doesnt work. Again, this may not be the case for you, but this is the case for me.

 

Filed Under: Business, Development, Marketing, Misc, Mobile

Android Studio Espresso 2.0 ClassNotFoundException

January 13, 2015 by Donn Felker 9 Comments

File this under “I’m writing this so when I Google for it in 6 months, it pops up”. 

 

I recently set up an existing Android project with Espresso 2.0 and immediately stared running into this error when I ran the tests: 

Running tests
Test running started
Test running failed: Instrumentation run failed due to 'java.lang.ClassNotFoundException'
Empty test suite.

I spent some time last night fighting this error and then I figured out the solution this morning.

The problem is that I’m using Dagger in this project and Espresso 2.0 also uses Dagger (see Espresso Dependencies). The core problem is that the ‘javax.inject’ dependency was borking the test run. 

How to to Fix

Change this

androidTestCompile('com.android.support.test.espresso:espresso-core:2.0')

to this: 

androidTestCompile('com.android.support.test.espresso:espresso-core:2.0') {
   exclude group: 'javax.inject'
}

 

Problem solved. 

Filed Under: Development, Mobile Tagged With: Android

Android From The Trenches

April 29, 2014 by Donn Felker 5 Comments

I recently was slated to present at Philly Emerging Tech last week. Unfortunately a few things came up and I was not able to make it at the last minute. However, I did record my talk and send it to the Philly Emerging Tech team to distribute to their attendees. They have since uploaded the talk to their Vimeo page for everyone to view. Below is that talk. The talk covers my experience in having two apps in the top 100 free category in Google Play. Enjoy.

ETE 2014 – Donn Felker – Android From The Trenches from Chariot Solutions on Vimeo.

Filed Under: Business, Development, Marketing, Mobile, Screencasts

« Previous Page
Next Page »
Donn Felker Google Android GDE Fragmented - An Android Developer Podcast

Projects / Apps

Caster.IO
Fragmented Podcast
American Express Android
Aaptiv
AndroidJobs.IO
Groupon
MyFitnessPal
Poynt

Books

  • Android Developer Tools
  • Android App Dev For Dummies V2 (V1)
  • Android Tablet App Dev for Dummies

Categories

  • Book
  • Business
  • Development
  • Health
  • Marketing
  • Misc
  • Mobile
  • Screencasts
  • Uncategorized