Boolean variables missing - Android

Through the android app I can see all my Double and Integervariables, but I do not see the boolean ones. They show up fine on the web console. Is this a known issue?

There is no special treatment for bool. They will be treated as int.

BTW, as per the docs for Particle.variable() the only supported types are int, double and String/char[]/char*

Can you show the code that exposes the respective variables?

     Particle.variable(String::format("%s_heat", name.c_str()).c_str(), &m_heating, BOOLEAN);

(m_heating is a class member. I’m not sure it has to use the old syntax, but the new one didn’t work the first time I tried it)

In the android app it’s completely missing. In the web console is shows up and works fine:

boot

I guess it may be that the mobile app adheres to the documented behaviour (where BOOLEAN is a not explicitly supported datatype) more closely than the console.

I’m surprised that you can even pass BOOLEAN as datatype for the old syntax - it’s cretainly not expected to work.

@rickkas7, any idea why the discrepancy?

It appears to be a combination of a few factors. BOOLEAN has been a data type for quite some time, but it has never been documented.

Since it was never documented, the Android SDK does not support it.

The easiest workaround for now is to cast as an int.

2 Likes