Implementing a timer that other users can access and display?

I am having a little bit of trouble implementing a timer that other users can access and display when they login. I tried using a the atomic counter, however, I did not see where one would initialize the atomic counter and set its values.

All I see is
IAtomic<Long> counter = Backendless.Counters.of(CurrentUser.getUserInstance().getObjectId(),Long.class );
Your increment, decrement, add methods return a null exception.

Could you please tell me if I am on the right track?


Hi Parwinder,

Did you do Backendless.initApp call in your app?

I just ran the following code and it worked just fine for me - no exceptions at all.

        IAtomic&lt;Long&gt; myCounter = Backendless.Counters.of( "my counter", Long.class );
        Long value = myCounter.incrementAndGet();
        System.out.println( "Counter value is " + value );