0

When I save data to the android cloud using Prime31's PlayGameServices plugin the app is non-responsive for 20+ seconds before returning to normal function. I am using the latest Unity3d engine and Android API 19 is installed. http://prime31.com/docs#androidPlayGameServices

The save data is a 40k-90k character base-64 string, and I save it with the following functions

  • PlayGameServices.setStateData( save_data, 0 );
  • PlayGameServices.updateCloudDataForKey( 0, true );

And I retrieve it with

  • PlayGameServices.loadCloudDataForKey( 0, true );

The length of the freeze correlates to the size of the file. The larger the file, the longer it stays frozen.

I am at my wits end trying to figure out what could possibly be causing this! I can reduce the save string size to 14k-30k characters using string compression, but that is not a good enough solution.

Thank you for reading,

-Mikal Saltveit

p.s. here is our android manifest http://saltve.it/workstuff/AndroidMainfest.txt

  • Sounds like you're connecting to the internet on your application's UI Thread which is causing it to freeze until it's finished the request. Anytime you're ever making a web request, you should be doing it in an asynchronous background thread; not the main UI thread. When the request is finished, you can post back to the main thread with a Handler. – Cruceo Feb 20 '14 at 18:54
  • Any idea how I do that in Unity? I call the function from Monobehaviours Update ( ) – MikalSaltveit Feb 20 '14 at 19:28
  • I uploaded the android manifest http://saltve.it/workstuff/AndroidMainfest.txt – MikalSaltveit Feb 20 '14 at 19:35

0 Answers0