If I speak in the tongues of men or of angels, but do not have love, I am only a resounding gong or a clanging cymbal. If I have the gift of prophecy and can fathom all mysteries and all knowledge, and if I have a faith that can move mountains, but do not have love, I am nothing. If I give all I possess to the poor and give over my body to hardship that I may boast, but do not have love, I gain nothing.
Rupert Rawnsley's WebLog
I've started so I'll finish.
Friday, March 29, 2013
Love and the Singularity
Friday, March 23, 2012
Android Emulation on x86 Machines
Now thanks to some wizardry from Intel, the performance has been significantly improved by taking advantage of virtualization. Although x86-based Android devices aren't going to take over the world anytime soon, this does mean that we now have a viable Android emulator to use on the desktop.
Installation
The instructions are here and I suggest you follow them all. The only sticking point is if your machine supports Virtualization Technology or not. You can find that out by checking Intel's list or running their processor information tool. Even my budget ACER i3 laptop has it:Then you need to run the Android SDK Manager and download version 17 of Android SDK Tools and the x86 system image:
One limitation is that the only AVD image available at the moment is for Android 2.3.3, but (depressingly perhaps) that covers 95% the devices out there. There is also an Intel configuration tool (in the Extras section) that you must install and run (see the aforementioned instructions). Note that the virtualization manager is memory hungry (I recommend a 2GB allocation), but RAM is so cheap that maxing out my laptop to 8GB only cost about £30 (it's the best investment you can make).
When you next open Android AVD Manager, you should be able to create a new x86-based VM:
Configure to your hearts content and launch...
You should find it a much faster experience than the ARM emulator and identical for Java-based applications. I'm not sure if NDK applications would work the same - comments welcome!
The possibility of developing applications completely on one machine really lowers the barrier to entry.
Tuesday, November 29, 2011
Android Permissions - Protection Levels
Android applications declare the permissions they are likely to require in their manifest (a short file that describes the contents of the 'package'). This allows the system to sandbox them from critical resources and gives the user some indication of what havoc they might reap. That's the theory at least, but the first time I installed an application and read the permissions page I had no idea what they were on about! Clearly this system needs to be changed, but that is not what I want to talk about today.
As an application writer I need to know the protection level of these permissions, i.e. which of these permissions are normal (can cause the user no real harm), dangerous (might require a greater level of trust, such as the ability to read SMS messages), signature (only granted to applications that are signed by the people who built the OS), signatureOrSystem (like signature, but also allowed if they have been pre-installed in a system folder). I was surprised to find no easy reference for this in the documentation, but I did find the relevant information in the source.
You can of course probe the android package itself for this information, which is useful if you don't have access to the particular version of Android you are running. Here is some code that does just that:
// Get the permissions for the core android package
|
...and here are the results in case you need to know them at a glance...
| Permission | Protection Level |
|---|---|
| android.intent.category.MASTER_CLEAR.permission.C2D_MESSAGE | signature |
| android.permission.ACCESS_CACHE_FILESYSTEM | signatureOrSystem |
| android.permission.ACCESS_CHECKIN_PROPERTIES | signatureOrSystem |
| android.permission.ACCESS_COARSE_LOCATION | dangerous |
| android.permission.ACCESS_FINE_LOCATION | dangerous |
| android.permission.ACCESS_LOCATION_EXTRA_COMMANDS | normal |
| android.permission.ACCESS_MOCK_LOCATION | dangerous |
| android.permission.ACCESS_NETWORK_STATE | normal |
| android.permission.ACCESS_SURFACE_FLINGER | signature |
| android.permission.ACCESS_WIFI_STATE | normal |
| android.permission.ACCOUNT_MANAGER | signature |
| android.permission.ASEC_ACCESS | signature |
| android.permission.ASEC_CREATE | signature |
| android.permission.ASEC_DESTROY | signature |
| android.permission.ASEC_MOUNT_UNMOUNT | signature |
| android.permission.ASEC_RENAME | signature |
| android.permission.AUTHENTICATE_ACCOUNTS | dangerous |
| android.permission.BACKUP | signatureOrSystem |
| android.permission.BATTERY_STATS | normal |
| android.permission.BIND_APPWIDGET | signatureOrSystem |
| android.permission.BIND_DEVICE_ADMIN | signature |
| android.permission.BIND_INPUT_METHOD | signature |
| android.permission.BIND_WALLPAPER | signatureOrSystem |
| android.permission.BLUETOOTH | dangerous |
| android.permission.BLUETOOTH_ADMIN | dangerous |
| android.permission.BRICK | signature |
| android.permission.BROADCAST_PACKAGE_REMOVED | signature |
| android.permission.BROADCAST_SMS | signature |
| android.permission.BROADCAST_STICKY | normal |
| android.permission.BROADCAST_WAP_PUSH | signature |
| android.permission.CALL_PHONE | dangerous |
| android.permission.CALL_PRIVILEGED | signatureOrSystem |
| android.permission.CAMERA | dangerous |
| android.permission.CHANGE_BACKGROUND_DATA_SETTING | signature |
| android.permission.CHANGE_COMPONENT_ENABLED_STATE | signature |
| android.permission.CHANGE_CONFIGURATION | dangerous |
| android.permission.CHANGE_NETWORK_STATE | dangerous |
| android.permission.CHANGE_WIFI_MULTICAST_STATE | dangerous |
| android.permission.CHANGE_WIFI_STATE | dangerous |
| android.permission.CLEAR_APP_CACHE | dangerous |
| android.permission.CLEAR_APP_USER_DATA | signature |
| android.permission.CONTROL_LOCATION_UPDATES | signatureOrSystem |
| android.permission.COPY_PROTECTED_DATA | signature |
| android.permission.DELETE_CACHE_FILES | signatureOrSystem |
| android.permission.DELETE_PACKAGES | signatureOrSystem |
| android.permission.DEVICE_POWER | signature |
| android.permission.DIAGNOSTIC | signature |
| android.permission.DISABLE_KEYGUARD | normal |
| android.permission.DUMP | dangerous |
| android.permission.EXPAND_STATUS_BAR | normal |
| android.permission.FACTORY_TEST | signature |
| android.permission.FLASHLIGHT | normal |
| android.permission.FORCE_BACK | signature |
| android.permission.FORCE_STOP_PACKAGES | signature |
| android.permission.GET_ACCOUNTS | normal |
| android.permission.GET_PACKAGE_SIZE | normal |
| android.permission.GET_TASKS | dangerous |
| android.permission.GLOBAL_SEARCH | signatureOrSystem |
| android.permission.GLOBAL_SEARCH_CONTROL | signature |
| android.permission.HARDWARE_TEST | signature |
| android.permission.INJECT_EVENTS | signature |
| android.permission.INSTALL_LOCATION_PROVIDER | signatureOrSystem |
| android.permission.INSTALL_PACKAGES | signatureOrSystem |
| android.permission.INTERNAL_SYSTEM_WINDOW | signature |
| android.permission.INTERNET | dangerous |
| android.permission.KILL_BACKGROUND_PROCESSES | normal |
| android.permission.MANAGE_ACCOUNTS | dangerous |
| android.permission.MANAGE_APP_TOKENS | signature |
| android.permission.MASTER_CLEAR | signatureOrSystem |
| android.permission.MODIFY_AUDIO_SETTINGS | dangerous |
| android.permission.MODIFY_PHONE_STATE | dangerous |
| android.permission.MOUNT_FORMAT_FILESYSTEMS | dangerous |
| android.permission.MOUNT_UNMOUNT_FILESYSTEMS | dangerous |
| android.permission.MOVE_PACKAGE | signatureOrSystem |
| android.permission.PACKAGE_USAGE_STATS | signature |
| android.permission.PERFORM_CDMA_PROVISIONING | signatureOrSystem |
| android.permission.PERSISTENT_ACTIVITY | dangerous |
| android.permission.PROCESS_OUTGOING_CALLS | dangerous |
| android.permission.READ_CALENDAR | dangerous |
| android.permission.READ_CONTACTS | dangerous |
| android.permission.READ_FRAME_BUFFER | signature |
| android.permission.READ_INPUT_STATE | signature |
| android.permission.READ_LOGS | dangerous |
| android.permission.READ_OWNER_DATA | dangerous |
| android.permission.READ_PHONE_STATE | dangerous |
| android.permission.READ_SMS | dangerous |
| android.permission.READ_SYNC_SETTINGS | normal |
| android.permission.READ_SYNC_STATS | normal |
| android.permission.READ_USER_DICTIONARY | dangerous |
| android.permission.REBOOT | signatureOrSystem |
| android.permission.RECEIVE_BOOT_COMPLETED | normal |
| android.permission.RECEIVE_MMS | dangerous |
| android.permission.RECEIVE_SMS | dangerous |
| android.permission.RECEIVE_WAP_PUSH | dangerous |
| android.permission.RECORD_AUDIO | dangerous |
| android.permission.REORDER_TASKS | dangerous |
| android.permission.RESTART_PACKAGES | normal |
| android.permission.SEND_SMS | dangerous |
| android.permission.SET_ACTIVITY_WATCHER | signature |
| android.permission.SET_ALWAYS_FINISH | dangerous |
| android.permission.SET_ANIMATION_SCALE | dangerous |
| android.permission.SET_DEBUG_APP | dangerous |
| android.permission.SET_ORIENTATION | signature |
| android.permission.SET_PREFERRED_APPLICATIONS | signature |
| android.permission.SET_PROCESS_LIMIT | dangerous |
| android.permission.SET_TIME | signatureOrSystem |
| android.permission.SET_TIME_ZONE | dangerous |
| android.permission.SET_WALLPAPER | normal |
| android.permission.SET_WALLPAPER_COMPONENT | signatureOrSystem |
| android.permission.SET_WALLPAPER_HINTS | normal |
| android.permission.SHUTDOWN | signature |
| android.permission.SIGNAL_PERSISTENT_PROCESSES | dangerous |
| android.permission.STATUS_BAR | signatureOrSystem |
| android.permission.STOP_APP_SWITCHES | signature |
| android.permission.SUBSCRIBED_FEEDS_READ | normal |
| android.permission.SUBSCRIBED_FEEDS_WRITE | dangerous |
| android.permission.SYSTEM_ALERT_WINDOW | dangerous |
| android.permission.UPDATE_DEVICE_STATS | signature |
| android.permission.USE_CREDENTIALS | dangerous |
| android.permission.VIBRATE | normal |
| android.permission.WAKE_LOCK | dangerous |
| android.permission.WRITE_APN_SETTINGS | dangerous |
| android.permission.WRITE_CALENDAR | dangerous |
| android.permission.WRITE_CONTACTS | dangerous |
| android.permission.WRITE_EXTERNAL_STORAGE | dangerous |
| android.permission.WRITE_GSERVICES | signatureOrSystem |
| android.permission.WRITE_OWNER_DATA | dangerous |
| android.permission.WRITE_SECURE_SETTINGS | signatureOrSystem |
| android.permission.WRITE_SETTINGS | dangerous |
| android.permission.WRITE_SMS | dangerous |
| android.permission.WRITE_SYNC_SETTINGS | dangerous |
| android.permission.WRITE_USER_DICTIONARY | normal |
| com.android.browser.permission.READ_HISTORY_BOOKMARKS | dangerous |
| com.android.browser.permission.WRITE_HISTORY_BOOKMARKS | dangerous |
Thursday, June 30, 2011
Cloud Production
I've always been fascinated by 3D printers and recently ordered one from the crowd-funded Huxley project.This project has raised far more than the initial expectation, and has forced the company that runs it to increase it's production capabilities by an order of magnitude. Now because these printers can print parts for themselves, eMaker are reaching out to other 3D printer owners to help them cope with the demand.
Imagine a future where you order something online and rather than coming from a local warehouse it is manufactured in a local facility that can make anything. As long as the quality is acceptable you don't have to know or care where it came from. The benefits of this from a production and supply chain point of view are enormous and efficiencies in the supply chain would mean cheaper goods for consumers. Couple this with the environmental benefits (less transportation and waste) and you have a game-changing technology: Cloud Production.
Friday, May 27, 2011
Passpack - Online password management

Passpack is a website that manages your passwords and other login details. It is simple to use and allows you to share passwords with colleagues and family members.
For instance, if you add a link to the login page for the site, it will auto-complete the login fields (using a bookmarklet).
I can also recommend the automatic password generation, which helps you avoid principal danger of password reuse.
It has a neat system whereby the passwords are decrypted locally in the browser using your security pass-phrase. This means that even the Passpack folks can't see your passwords. Of course this means you should keep you pass-phrase written down somewhere - I recommend keeping it with your will :-)
For extra simplicity, you can login with your ID from Google, Facebook, Twitter, or and OpenID provider. This doesn't help with the pass-phrase, but it stops you needing two passwords: one to login and one to decrypt your data.
Until true SSO is a reality, this makes identity management much simpler.
Thursday, May 05, 2011
ShareSafe.TV
Here is an example: http://www.safeshare.tv/v/YXM3wrIhcwY
Wednesday, April 20, 2011
MSTest and 64bit
If you are lucky enough to be able to write your applications in pure .NET, then you may never encounter 32bit/64bit platform issues. However, if any dependent library or plug-in is compiled for a specific architecture, then your whole application must be run in that mode. This is why the default Window's Internet Explorer is still 32bit despite the 64bit version shipping since Vista: it has to be the same architecture as any legacy plug-ins. By contrast, Notepad doesn't have any plug-ins, so it can get away with being 64bit only.
My companies applications rely on many native libraries, which are obviously compiled for specific architectures (x86 and x64). Deploying an application for multiple target processors is a complex subject in itself that can be solved with a range of strategies from dynamic library linking to processor-specific installers, but however you deploy, your application will behave differently in these two different modes so they must both be tested.
For better or for worse, we use MSTest to control application quality. Since the release of Visual Studio 2010 this has been able to run in 64-bit mode as well as 32-bit mode, but there are certain subtleties that complicate the practical aspects of administering your tests.
To understand the problem, consider the way MSTest works: Testing is done using two programs MSTest.exe and QTAgent32.exe. MSTest is told what assemblies to load and it scans those assemblies (using reflection) to find any classes and methods annotated as tests using the various test attributes. To do this it must be able to load the assembly and all its dependent assemblies and because MSTest is a 32bit process, none of these assemblies can be exclusively 64bit. Once loaded, MSTest instructs QTAgent32 to run these tests, which means QTAgent32 must load the assemblies itself and execute the test methods, but because it is also a 32bit process it cannot load 64bit assemblies either.

Friday, February 18, 2011
IBM Watson plays Jeopardy
The most amazing computer demonstration I have ever seen.
Wednesday, May 12, 2010
Microsoft's Click-to-Run and Office Automation
We use Excel automation via C# in our application, and when testing against the new versions of Office we hit a bump in the road. Office Home and Business 2010 typically installs via Click-to-Run, which is designed to have a small footprint, and as such does not register itself for programmatic automation.
So when you hear this sound: "Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80040154" even though Excel is apparently installed, you probably have this issue.
More here about Excel automation and the expected registry keys.
It is suggested that there will be an alternative MSI-based installer that presumably will not have this problem.



