With Android Core Development I mean Tips & Tricks where to look at if your building a Core Android OS from scratch. I am not talking about app development here.
- research topics
- handling system certificates
- handling key events
handling system certificates
create the platform dependent keys
create a keystore for creating correctly signed system applications for easier debugging
If you add apps to the system image they are directly part of the image and will be signed with the platform key. To being able to extend and debug such an app you need to be able to sign the new app with the same key. So you need to add the platform key to your local keystore to use it in eclipse.
steps to create the keystore
- copy the platform.pk8 and platform.x509.pem file to a new tmp directory
openssl pkcs8 -inform DER -nocrypt -in platform.pk8 -out platform.key.pk8
openssl pkcs12 -export -in platform.x509.pem -inkey platform.key.pk8 -out platform.p12 -password pass:android -name androiddebugkeyIt's very important to name it androiddebugkey or it will not be recognized by eclipse as such.
keytool -importkeystore -destkeystore platform.keystore -srckeystore platform.p12 -srcstoretype PKCS12 -srcstorepass android
keytool -list -v -keystore platform.keystoreto verify that the new platform.keystore really holds the data.
use the new keystore in eclipse
- copy the platform.keystore to your local ~/.android/ directory
- in eclipse adt go to "Window / Preferences / Android / Build"
- assign your newly created platform keystore in the field "Custom debug keystore"
handling key events
This is just a rudimentary note and may not be true at all. The goal is to note it down for later research on this topic.
You want to be able to change the way how system wide key presses are handled. For example if you intend to change the way how the HOME button of your Android core system works.
WindowManager (?) --> ?.?.PhoneWindowManager (?)
Window (abstract base class) --> android.policy.PhoneWindow (implementation)
- The PhoneWindowManager handles all windows in the system. The PhoneWindow is running inside your app. To change system wide key events you need to modify the PhoneWindowManager.
- If you intend to be able to modify the system wide behaviour of key handling in your app the PhoneWindow has to be modified.
In case of the HOME key it means:
- the default handling must be removed from PhoneWindowManager so that the HOME key is received by apps.
- If an app does not handle the HOME key you can modify the PhoneWindow to act on the HOME key.
This way you can use the HOME key in your app and if nobody handles it you can run a default action from the PhoneWindow.