rock_win
rock_win

Reputation: 755

Android Swarm Leaderboard unexpected behaviours

So, I finally decided to use Swarm Leaderboards for my Game.

The setup was easy, but seem to have introduced bugs to the application with its unexpected behaviors.

Would help is someone can shed light on it:

  1. The application always keeps running in the background. Even after the close of the final UI activity. Surely there is some thread that Swarm is keeping which is preventing it from closing. Any ideas, how i can completely close my application, rather than bogging user with a background application.

  2. They spawn a service in a separate PID space, is it necessary. What if I modify it and make it to be maintained in one single PID

  3. The SDK sometimes show the Login-Dashboard, while I prefer my users to play as guest and thus not calling the showDashboard. Why is it still getting called? any way of preventing it. OR if it is to be shown - then any callback that I can associate with it, so that the rest of UI is more interlaced, rather than abrupt popup(s)

Upvotes: 2

Views: 708

Answers (1)

Dan
Dan

Reputation: 21

Lead dev of Swarm here. First off, glad you're trying out Swarm, hopefully we can get this cleared up :)

1) This sounds like the default behavior for Android. Apps are left running explicitly (code in memory, not actively on the CPU) until the memory is needed, at which time they are evicted. If you're seeing something more than this, it is possible you missed a call to Swarm.setInactive() in one of your activities. We use setActive() and setInactive() as hooks to know when your game is running, and when we should shut down everything on our side.

2) This is configurable. In the manifest there should be a line that says android:process=":swarm". Remove this line and it will be run in the same process as your app. One of Swarm's features is push notifications, and if this feature is used, running in a separate process is highly valuable, because it doesn't require all of the application code to run all the time (saves device memory).

3) You're most definitely not required to show the dashboard ever. The only screen that is required to be shown is the login screen (which like you mentioned, they can click "Play as Guest" to get through quickly). All of this is controlled by the way you call Swarm.init(), and offers callbacks for the full login process (loginStarted(), loginCanceled(), userLoggedIn(), and userLoggedOut()). Please see our docs for more info.

Upvotes: 1

Related Questions