Samsung SDKs

Subscription preference

Notification emails are sent to your Samsung account email address.

* Email : anonymous@samsung.com

  

Close

zirconia loading issue

Forums View
Started by Newbie kangyoung.chung , 0 Seed Nov 16, 2012 04:52 Posts : 3 View : 21301 Likes : 0
 Hi,
 
               After implementing zirconia to my game, it increases the loading time for  loading resources.. that too only for the first launch.So please help me out to fix this issue.

                Thanx in Advance.

FYI;Without Zirconia implementation it takes less than 30 secs and with Zirconia it takes 2 minutes.


Regards,
Dchoc Developer



Post Reply
Board View
Newbie a.stepniewsk , 40 Seed Nov 16, 2012 10:28 Post #1 0
Dear Dchoc Developer,

Please refer to the Zirconia documentation file 02_ZirconiaforANDROIDOperationManual_v1_0_EN.pdf and make sure you are following its guidelines, especially this part:

"Do not repeatedly and excessively call the Zirconia.checkLicense() method. Though Zirconia
is not oversized, it uses File I/O, Encoding/Decoding, and Internet Communication to make
an inquiry and storage. When Zirconia.checkLicense() method is called repeatedly, a lot of
internal threads will be created, and resources will be wasted. For example, if this function is
called by a frequently operated action handler, application performance may be influenced
due to continual actions of File I/O and Encoding/Decoding."


I would also advise you to use TraceView tool and compare the results with and without Zirconia and post back your results:
http://developer.android.com/tools/debugging/debugging-tracing.html

Regards,
Artur
Samsung Developers

Post Reply
Board View
Newbie kangyoung.chung , 0 Seed Nov 20, 2012 09:08 Post #2 0
 Hi ,

            Eventhough I invoke mZirconia.checkLicense(false, false) only once while launching the Game for first time to check License it takes more loading time.This game uses lot of threads to handle features implemented in this game(I.e Alljyon Connection,downloading assests from the server).So I might think that Zirconia is not relasing the threads properly after validating.Can you please help me out to fix this.

Note:Zirconia Implementations done for other games is working fine.


Regards,
Dchoc Developer

Post Reply
Board View
Newbie a.stepniewsk , 40 Seed Nov 20, 2012 10:27 Post #3 0
Dear Dchoc Developer,

My suggestions:
- Change the license checking thread's priority using Zirconia#setThreadPrioriy(Thread.MIN_PRIORITY). You could also try other priorities too (1-10).
- Call the Zirconia#checkLicense(false, true) (dontUseThread flag set to true which will cause the method to run on current thread) in a separate thread by using plain Threads or ASyncTasks (or any other method). Please refer to the sample code below.

Additionally:
- Try running TraceView with and without Zirconia and post back your results

public class ZirconiaTest extends Activity {

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        TextView tv = new TextView(this);
        tv.setText("This is a simple test application for Zirconia!\nPlease hold on while verifying the license...");
        setContentView(tv); // setContentView(R.layout.main);

        new ZirconiaAsyncTask(this, tv).execute(0);
    }

    private static class ZirconiaAsyncTask extends AsyncTask<Integer, Void, Boolean> implements LicenseCheckListener {

        private final TextView mTextView;
        private Zirconia mZirconia;
        private final Activity mActivity;
        private Handler mHandler;

        public ZirconiaAsyncTask(Activity activity, TextView tv) {
            mTextView = tv;
            mActivity = activity;
            mHandler = new Handler();
        }

        @Override
        protected Boolean doInBackground(Integer... params) {
            mZirconia = new Zirconia(mActivity);
            mZirconia.doVariablesTest();

            mZirconia.setLicenseCheckListener(this);
            mZirconia.checkLicense(false, true);

            return true;
        }

        @Override
        protected void onPostExecute(Boolean result) {

            mZirconia.doVariablesTest();
        };

        @Override
        public void licenseCheckedAsValid() {
            Log.d("ZirconiaTest", "License is valid");

            mHandler.post(new Runnable() {

                @Override
                public void run() {
                    mTextView.setText("License is valid");
                }
            });
        }

        @Override
        public void licenseCheckedAsInvalid() {
            Log.d("ZirconiaTest", "License is invalid");

            mHandler.post(new Runnable() {

                @Override
                public void run() {
                    mTextView.setText("License is invalid");
                }
            });
        }
    }
}



Regards,
Artur
Samsung Developers

Post Reply