2

そこで、最終的にゲームに Swarm Leaderboards を使用することにしました。

セットアップは簡単でしたが、予期しない動作でアプリケーションにバグが発生したようです。

誰かがそれに光を当てることができれば助かります:

  1. アプリケーションは常にバックグラウンドで実行され続けます。最終的な UI アクティビティが終了した後でも。確かに、Swarm が保持しているいくつかのスレッドがあり、それが閉じるのを妨げています。バックグラウンドアプリケーションでユーザーを悩ませるのではなく、アプリケーションを完全に閉じる方法を教えてください。

  2. 必要に応じて、別の PID 空間でサービスを生成します。それを変更して、単一の PID で維持されるようにするとどうなりますか

  3. SDK はログイン ダッシュボードを表示することがありますが、私はユーザーがゲストとしてプレイすることを好み、showDashboard. なぜまだ呼び出されているのですか?それを防ぐ方法。または、それを表示する場合 - それに関連付けることができる任意のコールバックにより、UI の残りの部分が突然のポップアップではなく、よりインターレースされます。

4

1 に答える 1

1

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.

于 2013-01-12T18:50:58.137 に答える