The Android styling and theming system can be an enigmatic beast at the best of times. In some of the SDKs at Zendesk, we need to resolve theme attribute colours at runtime, and today I learned that there’s a big difference depending on whether you specify a colour as a reference or as a literal value.
Picasso is an awesome library for downloading and caching images. If the images that you need to download require authentication you can do that by specifying a custom Downloader class. If you do this you can no longer use the with method to initialise Picasso.
Just a quick one. You probably already know that you can automatically convert URLs in a TextView into clickable links like this: mTextView.setAutoLinkMask(Linkify.WEB_URLS); I recently learned that this will only work where you can call setAutoLinkMask() before setting text in the TextView. The simple solution is to set the text after calling setAutoLinkMask(), but if […]
All Android devices offer the user some form of external storage. The storage may be a separate partition of flash memory in the device or bone-fide external storage like an SD-memory card. As developers we need to be aware of the pros and cons of using this type of storage.
In an app I’m making I have the need to copy a file from my app to the local filesystem. Not a complicated task but I hit snag and it doesn’t appear to be that well documented so I thought I’d share.
Roboguice is an awesome thing. If, like me, you put off looking into it for fear it might be time consuming then don’t fear: it is really, really easy. Using it simply you can forget about loads of boilerplate code like findViewById, Context.getSystemService and so on. The project’s getting started page tells you all you […]
Here’s another possible Android gotcha. Say you have a colour like this defined in an xml file: <color name=”red”>#FF0000</color> Then in some code you do something like: TextView textView = new TextView(context); textView.setTextColor(R.color.red); You’ll find that the text comes out like some darkish grey colour and this is because it used the resource id (which […]