Page 1 of 1

Empty TChart initialization takes 3 seconds

Posted: Mon Mar 18, 2013 11:45 pm
by 17064597
This line takes 3 seconds on my Nexus 4 (using English/UK locale):

Code: Select all

chart = new TChart(this);
The culprit is this line:

Code: Select all

bundle = ResourceBundle.getBundle(languages, currentLocale);
Not sure why this activate() function is even called. It seems it only looks for the line/column separators. Really odd!

Suggestions?

Re: Empty TChart initialization takes 3 seconds

Posted: Tue Mar 19, 2013 3:36 pm
by yeray
Hi,

The activate() function creates the bundle to localize the strings the component shows. The activate() function only retrieves the separator strings, but the bundle is later used for other texts (361 references to getString() function, from Language.java).
As you'll see in the language files, there are more than a thousand translated strings; this may be the reason of this delay.
If you know another way to do this, don't hesitate to let us know.

Re: Empty TChart initialization takes 3 seconds

Posted: Tue Mar 19, 2013 8:10 pm
by 17064597
I removed the localization entirely (assuming "design time") since I do not use any of the localized strings. I did have to set the format for my axis labels explicitly, but I can live with that :)

Regarding localization, why not use the resource system that comes with Android? Just put xml resources in "values", "values-de", "values-nl" etc and load strings using an instance of Context (I think TChart will do) + getResources() + getString().

http://developer.android.com/guide/topi ... ource.html

The resources will automatically adapt to the current locale.

Re: Empty TChart initialization takes 3 seconds

Posted: Mon Mar 25, 2013 11:42 am
by yeray
Hi Kristoffer,

I've added it to the wish list to be investigated for inclusion in next releases (TJ71016547).
Thanks for reporting it.