Software development

How to include all permissions in the Android manifest

March 31, 2014

If you wish your Android app to require all permissions then add this XML to your Android.manifest file: <uses-permission android:name=”android.permission.ACCESS_COARSE_LOCATION” /> <uses-permission android:name=”android.permission.ACCESS_FINE_LOCATION” /> <uses-permission android:name=”android.permission.ACCESS_LOCATION_EXTRA_COMMANDS” /> <uses-permission android:name=”android.permission.ACCESS_NETWORK_STATE” /> <uses-permission android:name=”android.permission.ACCESS_WIFI_STATE” /> <uses-permission android:name=”android.permission.ADD_VOICEMAIL” /> <uses-permission android:name=”android.permission.AUTHENTICATE_ACCOUNTS” /> <uses-permission android:name=”android.permission.BATTERY_STATS” /> <uses-permission android:name=”android.permission.BIND_ACCESSIBILITY_SERVICE” /> <uses-permission android:name=”android.permission.BIND_NFC_SERVICE” /> <uses-permission android:name=”android.permission.BIND_NOTIFICATION_LISTENER_SERVICE” /> <uses-permission android:name=”android.permission.BIND_PRINT_SERVICE” /> <uses-permission […]


ContentResolver.addPeriodicSync doesn’t work – never syncs

March 7, 2014

Probably you’ve followed Google’s Android sync adaptor training guide up to http://developer.android.com/training/sync-adapters/running-sync-adapter.html#RunPeriodic and are wondering why syncing never happens. There are two mistakes in the training guide as far as explaining how to make addPeriodicSync work: You must call ContentResolver.setSyncAutomatically with true as the third (sync) parameter to enable syncing for your adaptor. The fourth (pollFrequency) […]


“No resource identifier found for attribute ‘export’ in package ‘android'”

February 27, 2014

I bet you’re here because you’re trying to compile an Android application that includes the Provider manifest declaration from http://developer.android.com/training/sync-adapters/creating-stub-provider.html. The error is because the code example there includes the XML parameter “android:export”. Change this to “android:exported” and try compiling again. Pretty disappointing that Google’s own documentation contains bugs, huh?


.hgignore file for Android Studio

December 3, 2013

There are several Stack Overflow questions about this but none seems definitive. Github suggests https://github.com/github/gitignore/blob/master/Android.gitignore for general Android development, but that doesn’t take account of IDE files. The developers of Android Studio give advice on IDE files to ignore at https://intellij-support.jetbrains.com/entries/23393067 I have ended up with: #Android files – see https://github.com/github/gitignore/blob/master/Android.gitignore # built application files glob:*.apk glob:*.ap_ # […]


USB driver for debugging on Motorola Android device

December 2, 2013

I am using Android Studio for development, but I am sure this would apply to Eclipse and other IDEs. The Android development guide (http://developer.android.com/tools/device.html) says that USB drivers are required for debugging on a device connected by USB. I installed the USB drivers by going to https://motorola-global-portal.custhelp.com/app/answers/detail/a_id/88481/action/auth and clicking Download for Windows. I ran the downloaded installer […]


Resharper for free

July 26, 2013

I installed Resharper 7 (at that time the newest) 3 months ago in my new job. I haven’t actually done any programming since then but I noticed Resharper had expired on the rare occasion I opened Visual Studio. Today I actually do want to use VS and Resharper seems to work, unlicensed. The licencing screen […]


How to set the page title and meta fields of WordPress posts

August 30, 2011

OK so I honestly don’t know if this is a feature of my theme or if this is a standard feature of WordPress itself but when I’m editing a post I can click Screen Options at the top right of the page and I get a list of options, including one called SEO. If I […]


Versioning databases

August 2, 2011

I have a create script for the database. The last line in the create script sets the database version (this is stored in the system keys table). The program has a database version constant that has the same value as the version number in the create script. I have an update file per database version […]


Backing up a WordPress site

July 25, 2011

As far as I know (I’m a WordPress amateur), the most important parts of a WordPress site to back up are the database and the theme. On most sites posts will be added much more often then the theme updated. Regular database backups are important to ensure that minimal content is lost in the case […]


Making a multilingual WordPress site

July 25, 2011

I’m trying qTranslate. Seem simple to use, albeit you probably need to be a programmer to be able to add and edit the available languages. I shall update this post with any problems I find.