Author Topic: ALEDxander - display unique LED patterns on incoming calls  (Read 6757 times)

ali1234

  • Newbie
  • *
  • Posts: 19
    • View Profile
Hello,

I made an Android app to display unique LED patterns when you receive an incoming call. The patterns are generated by turning the phone number into an integer, and then lighting up the LEDs according to the low 15 bits (approx 5 digits). This means each number should display a fairly unique pattern.

Google Play: https://play.google.com/store/apps/details?...z.al.aledxander

The source code is here: https://github.com/ali1234/ALEDxander

Github release page (APK): Releases

Shall I try to upload this to the Google app store?
« Last Edit: May 21, 2018, 08:40:53 pm by ali1234 »

GeorgeG

  • Newbie
  • *
  • Posts: 1
    • View Profile
ALEDxander - display unique LED patterns on incoming calls
« Reply #1 on: May 19, 2018, 11:29:45 am »
Yes! Please do!

Sunyavadin

  • Newbie
  • *
  • Posts: 36
    • View Profile
ALEDxander - display unique LED patterns on incoming calls
« Reply #2 on: May 19, 2018, 07:45:04 pm »
An apk would also be appreciated for those of us whose first action on getting a new android device is to delete play store.

ali1234

  • Newbie
  • *
  • Posts: 19
    • View Profile
ALEDxander - display unique LED patterns on incoming calls
« Reply #3 on: May 19, 2018, 08:11:20 pm »
Quote from: Sunyavadin
An apk would also be appreciated for those of us whose first action on getting a new android device is to delete play store.

The APK is on the Github releases page.

It should be on the play store in a couple of days if it passes review.

a1astair

  • Jr. Member
  • **
  • Posts: 70
    • View Profile
ALEDxander - display unique LED patterns on incoming calls
« Reply #4 on: May 19, 2018, 11:36:14 pm »
Quote from: ali1234
Quote from: Sunyavadin
An apk would also be appreciated for those of us whose first action on getting a new android device is to delete play store.

The APK is on the Github releases page.

It should be on the play store in a couple of days if it passes review.

Great work! Shame Planet cannot get their app working yet. Why don't they publish the source code and get somebody else to work on it?

ali1234

  • Newbie
  • *
  • Posts: 19
    • View Profile
ALEDxander - display unique LED patterns on incoming calls
« Reply #5 on: May 20, 2018, 01:15:30 am »
Quote from: a1astair
Great work! Shame Planet cannot get their app working yet. Why don't they publish the source code and get somebody else to work on it?

The LEDs use a non-standard API that is not available in the standard Android SDK, so you would not be able to compile LEDison even if you had the source code.

Luckily Java has reflection, so it is not a problem for third-party utilities.

Isaac

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
ALEDxander - display unique LED patterns on incoming calls
« Reply #6 on: May 20, 2018, 10:37:22 am »
This is great, thanks for releasing!

Ifanafi

  • Full Member
  • ***
  • Posts: 187
    • View Profile
ALEDxander - display unique LED patterns on incoming calls
« Reply #7 on: May 20, 2018, 01:02:41 pm »
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


Quote from: ali1234
Quote from: a1astair
Great work! Shame Planet cannot get their app working yet. Why don't they publish the source code and get somebody else to work on it?

The LEDs use a non-standard API that is not available in the standard Android SDK, so you would not be able to compile LEDison even if you had the source code.

Luckily Java has reflection, so it is not a problem for third-party utilities.

Sunyavadin

  • Newbie
  • *
  • Posts: 36
    • View Profile
ALEDxander - display unique LED patterns on incoming calls
« Reply #8 on: May 20, 2018, 03:51:25 pm »
Alas, I installed it, authorised it, and then tried to take a call, and every time I do this I get a message upon receiving the call that "aledxander has stopped working". No lights, no nothing.

ali1234

  • Newbie
  • *
  • Posts: 19
    • View Profile
ALEDxander - display unique LED patterns on incoming calls
« Reply #9 on: May 20, 2018, 07:09:30 pm »
Quote from: Sunyavadin
Alas, I installed it, authorised it, and then tried to take a call, and every time I do this I get a message upon receiving the call that "aledxander has stopped working". No lights, no nothing.

Was it an unknown number? I don't know what parseInt does if you give it an empty string.

ADB logs would be helpful.

edit: I have uploaded a new release on github which should not crash on unknown numbers. It won't display any pattern for them as they are treated as 0.
« Last Edit: May 20, 2018, 07:41:35 pm by ali1234 »

ali1234

  • Newbie
  • *
  • Posts: 19
    • View Profile
ALEDxander - display unique LED patterns on incoming calls
« Reply #10 on: May 20, 2018, 07:23:19 pm »
Quote from: Ifanafi
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...ficationManager

When 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.
« Last Edit: May 20, 2018, 07:46:31 pm by ali1234 »

Sunyavadin

  • Newbie
  • *
  • Posts: 36
    • View Profile
ALEDxander - display unique LED patterns on incoming calls
« Reply #11 on: May 20, 2018, 09:57:46 pm »
The call wasn't an unknown number, it was my partner's phone which I was making use of for testing purposes. The most commonly called of my contacts.

ali1234

  • Newbie
  • *
  • Posts: 19
    • View Profile
ALEDxander - display unique LED patterns on incoming calls
« Reply #12 on: May 21, 2018, 06:05:27 pm »
Quote from: Sunyavadin
The call wasn't an unknown number, it was my partner's phone which I was making use of for testing purposes. The most commonly called of my contacts.

Found the problem. Phone numbers that start with 07 or 08 are numerically larger than a Java 32 bit int.

I have released a fix on Github and the Google PLay internal test channel.

I don't think there are any more bugs so I have published it to the release channel on Google Play, however this will take "a few hours" (assuming it passes).

jornada720

  • Jr. Member
  • **
  • Posts: 99
    • View Profile
ALEDxander - display unique LED patterns on incoming calls
« Reply #13 on: May 21, 2018, 09:31:46 pm »
Quote from: ali1234
Quote from: Sunyavadin
The call wasn't an unknown number, it was my partner's phone which I was making use of for testing purposes. The most commonly called of my contacts.

Found the problem. Phone numbers that start with 07 or 08 are numerically larger than a Java 32 bit int.

I have released a fix on Github and the Google PLay internal test channel.

I don't think there are any more bugs so I have published it to the release channel on Google Play, however this will take "a few hours" (assuming it passes).

You can also publish your app on the F-Droid store as well for additional distribution.

Sunyavadin

  • Newbie
  • *
  • Posts: 36
    • View Profile
ALEDxander - display unique LED patterns on incoming calls
« Reply #14 on: June 04, 2018, 03:58:32 pm »
Just tested it with the new version and it's working great. Thanks!