Getting Xcode static library dependencies to work is way harder than it should be! This weekend I setup a new Xcode OS X workspace with 2 child projects. One project was the app and the other a static library used by the app. Setting the static library as a dependency of the app project took ages. Part of the reason was my lack of knowledge but Xcode should really give a bit more help. Continue reading
AndroVM is a novel alternative to the Android emulator with Android running in a virtual machine (VM) using VirtualBox. It works quite well and for some requirements can be significantly faster than the Android emulator. Continue reading
I recently created a custom UITableViewCell with a UIButton as a subview. Pretty standard except that the highlight state of the button was only activated if you held your finger on the button for more than some fraction of a second. The solution is quite straight forward but is subtle enough to justify a quick blog post. Continue reading
A state list drawable is a really useful Android resource for displaying different drawables for a view depending on the state of that view. e.g. we can define a state list drawable for the background of a button that defines a colour for both pressed and unpressed states. The button takes care of switching between the two drawables depending on the state.
You can make state list drawables even more useful by defining custom states. Continue reading
There are a few common operations I infrequently perform related to the Android screen:
- Converting a pixels value to the corresponding density independent pixels (DIP) value and vice versa
- Getting the screen dimensions
- Checking what orientation the device is in
- Getting the screen size (small, normal, large, extra-large)
They’re not difficult but it is annoying having to remember exactly how they’re done so I created a utility class to make it a bit easier. Continue reading
The activity lifecycle is central to Android development. Although it is quite well defined, it does take a bit of getting used to. One aspect new developers perhaps struggle with is that rotating the device will by default destroy and recreate the activity.
A well behaved activity will restore its state after a rotation so the user can continue using the application with no lose of state. e.g. EditText widgets should restore the text they contained when the device was rotated and a long running operation should resume without restarting. Continue reading
My colleague, Nick Street, and I gave an ‘Android vs iOS Development’ presentation for Edinburgh Student Techmeetup on behalf of Kotikan. We only had about 25 minutes so didn’t go into too much depth. Was good fun and worth a watch just to find out who wins.
Just finished reading ‘Application Security for the Android Platform: Processes, Permissions, and Other Safeguards’ by Jeff Six. Continue reading
Android TextViews provide suggestions to the user as they type. Although the user can disable this feature in the system settings there are cases where the developer wants to always have suggestions disabled for certain TextViews. Continue reading
We started using BugSense at work recently to log uncaught exceptions in our Android applications. It works really well and is very easy to setup, best of all it’s free!
The setup instructions say to call
BugSenseHandler.setup() in your “main/first activity” but we found that calling this method in the subclassed
Application.onCreate() method also works and is better if your application has more than one entry point.
The complete setup instructions can be found here.