Is it possible to draw a random object from a database built with Room and put it into the variable?
CodePudding user response:
You can try using random
function as SQL.
@Dao
interface SomeDao {
@Query("select * from some_table order by random() limit 1")
fun findRandom(): SomeEntity
}