I know that sqlite does not support Boolean and we need to use int columns to mimic the behavior of Boolean . But does Room support Boolean ? What if have a Boolean in my entity ? Will it work as expected?
Yes it does. When you store boolean using room, it automatically stores 1 for true
and 0 for false
.
And same case while reading. It converts 1 or 0 to true/ false respectively.
Tags: androidandroid, database, variables