Smaller APKs with Classy Shark

A big thanks to my friend Enrique López Mañas for giving me feedback on how to improve this post, and of course Boris Farber for creating Classy Shark. App Size An app I am working on feels a lot larger than it should be, my hunch that this is due to dependencies that are being included in the APK that …

Exploring Tiles in Android N Preview Release

There are some cool new features slated for N(I’m voting that N stands for Nutella, cause this cake is amazing). In this post I will be covering my discoveries while using the new Tiles API. Note the online android developer docs don’t yet contain info about the new N APIs, but you can download the docs here for offline reading. …

Go With the Flow – Handling Configuration Changes with Flow

Last week we covered how to use flow with a master-detail view. I got some great feedback from Ray Ryan and Logan Johnson from the Square team. This week I’m going to be covering how to handle rotation. Crash on Rotation If you had tried rotating last weeks example you would have noticed a bug. Specifically when you rotate from …

Code Highlighting with Prism.JS

I have been using prismjs for a bit now. I like it. I noticed today though that it doesn’t color annotations in Java. My initial attempt at annotation coloring worked. Prism.languages.java = Prism.languages.extend(‘clike’, { ‘annotation’: /(@{1}\w*\(.*?\))|(@{1}\w+)/i, ‘keyword’: /\b(abstract|continue|for|new|switch|assert|default|goto…)\b/, ‘number’: /\b0b[01]+\b|\b0x[\da-f]*\.?[\da-fp\-]+\b|\b\d*\.?\d+(?:e[+-]?\d+)?[df]?\b/i, ‘operator’: { pattern: /(^|[^.])(?:\+[+=]?|-[-=]?|!=?|<<?=?|>>?>?=?|==?|&[&=]?|\|[|=]?|\*=?|\/=?|%=?|\^=?|[?:~])/m, lookbehind: true } }); Until but it failed to color annotations with parameters for some reason. …

Master Detail with Square’s Flow

Update I got some amazing feedback from Ray Rayan and Logan Johnson. I’ll likely be creating a supplemental post to cover their notes. One thing that should definitely go in this post is that Flow is in Alpha and the API isn’t stable. The api can change, so if you decide to use it and I hope you do 😉 …

More Kotlin Features to Love

Constants are important One of the things that I’ve come to appreciate more and more as a programmer are constants. Before I would have yawned and said big deal why? Now I’d say they are so important as they prevent so many needless bugs. If we are guaranteed that something is not null then we can focus simply on getting …

Debugging with Jack

Overriding Variable Contents in the Debugger Debugging is always a very important feature of an IDE. One useful tip that I don’t hear much about while debugging is being able to change the contents of a variable in the middle of debugging session. If the debugger is halted on a line you simply need to execute the Evaluate Expression Command(⌥+F8). …

Love for Kotlin

I spent a fair amount of time learning how annotation processors work. I made a sample library called ascent on github for injecting custom fonts into fields. It was a great way to learn. The benefit of annotation processors is boilerplate destruction. I’ve always disliked having to write code over and over again, one example of that is converting values …