Closed karivatj closed 2 years ago
This depends on PR #46
Converted to draft because it depends on an unmerged PR. That being said, I think it is better to separate behaviour changes affecting all platforms and services and refactoring that only changes internal code to different PRs.
Alrighty I will split these into different PR:s maybe this PR could be rejected in that case.
Hello,
Here is a proposal for a refactored version of
android-gpgs
client. The current version uses deprecated Google APIs and should be updated or eventually the code stops working.I've updated all of the API calls with current versions as described in the Google docs.
All
AsynTasks
have been removed because the API calls useTasks API
which are asynchronous by default. No need for AsyncTasks as they might leak memory.Remove obsolete interfaces from android-gpgs and remove unneeded method overrides.
Modify
IGameServiceListener
to include a Integer resultCode in the callback methods. This is useful to inform the client of the statuscode of the callback e.g. if operation was cancelled, a network error occurred etc. The result is especially important when the client requests a explicit sign out from the Game Service. If this happens we shouldn't try to connect to the server until the user explicitly requests to sign in.Modify
IGameService
interface to addgetPlayerData
method. The method is implemented in android-gpgs client and allows the client to fetch player related data. I've added method stubs to other clients and made them throwUnsupportedOperationException
exception if invoked.Add new package
playerdata
and within the package createIPlayerData
interface which describes the fields related to the player. Also, addIPlayerDataResponseListener
interface which is used for player data update callbacks.Finally, I noticed the build produces a lot of warnings because of missing Javadoc stuff. I added descriptions here and there to get rid of the warnings.