Image by Andrew Martin

How is it going to work ?

The Issue

Behavioral Economics. -From a non-Econ perspective-

FirebaseDatabase.getInstance().getReference().child("#your_node_path").runTransaction(new Transaction.Handler() {
public Transaction.Result doTransaction(MutableData mutableData) {
long max = mutableData.getChildrenCount();
for (MutableData data : mutableData.getChildren()) {
Node node = data.getValue(Node.class);
if (node!= null ) {
node.index = (int)(Math.random() * max +1);
return Transaction.success(mutableData); …

Dhia Kennouche

Full Stack Developer| Loading…

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store