I've got a simple setup in my car that I'm testing:

Cigarette Lighter Socket -> 12v Inverter (with UK Plug Socket) -> Minix NEO X5 (Android)

This powers the Android based Minix NEO X5 unit fine and I can power it up/down from the devices hardware button. However I now want to automate this so when the ignition off the unit goes into sleep mode, and when the ignition is turned on that it comes out of sleep mode.

Any ideas on how this can be achieved?