Indulge my ignorance about this thread.
I gather the Gemini's LEDs are meant for eventual configuration to alert one to, say a phone call or text message and whatever.
Currently that functionality is in limbo waiting on PC to complete post-deliveries to backers.
What do you mean by "Luckily Java has reflection, so it is not a problem for third-party utilities."?
Have you made a work-around to get the limbo LEDs functioning as intended?
Thanks.
Ifanafi
When you build an Android app you have to use the Android API. For example the Notification Manager API is documented here:
https://developer.android.com/reference/and...ficationManagerWhen you download the Android SDK it includes a list of every API call. If you try to use a method which is not in the API, your app will not compile.
What Planet have done to make the LEDs work is change the Android Notification manager and add a new method called openLed. You will not find that method in the above documentation. In LEDison they call it like a normal API method:
[div class=\'codetop\']CODE[/div][div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']
NotificationManager nm = context.getSystemService(Context.NOTIFICATION_SERVICE);
nm.openLed(led, r, g, b, 0)
[/div]
If you try to compile that code with the normal Android SDK it will just generate an error because it does not know about the openLed method.
However, Java has something called reflection, which means that code can inspect itself at run time. This means you can get a list of methods on an object dynamically. We can ask the Notification Manager for the openLed function at run time, without needing the SDK to be aware of it. The following example is equivalent to the above except it will compile in the standard SDK:
[div class=\'codetop\']CODE[/div][div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']
NotificationManager nm = context.getSystemService(Context.NOTIFICATION_SERVICE);
Method method = nm.getClass().getMethod("openLed", int.class, int.class, int.class, int.class, int.class);
method.invoke(nm, led, r, g, b, 0);
[/div]
So using reflection we can call non-standard Planet API additions without needing to have access to their patched version of the SDK.