Re: [android-developers] Re: android.text.format.DateFormat.format performance

2011-10-18 Thread Thierry Legras
Wow nice! I haven't tried JNI before as well and I could not imagine it would be interesting for such small functions. In my case though I will stick to Calendar use as the time spent for time formating is now little enough compared to the remaining parts. Si I won't gain significant in further op

Re: [android-developers] Re: android.text.format.DateFormat.format performance

2011-10-17 Thread Studio LFP
Thanks for the update! I just sat down and put together a JNI routine that uses strftime in C and I took my formatting from 50%+ of the routine that was populating my view down to 0.2%. I would call that a significant improvement! Here is the code I used: Java Class public class JN

Re: [android-developers] Re: android.text.format.DateFormat.format performance

2011-10-17 Thread Thierry Legras
I do confirm using Date is about 2x faster. But I tryed using Calendar as Date.getHours/Minutes etc. is deprecated. The good news is that is even faster: Almost 6x faster than my original which was using DateFormat.format Here is my code: private static Calendar sTmpCalendar = Calendar.get

Re: [android-developers] Re: android.text.format.DateFormat.format performance

2011-10-14 Thread Thierry Legras
No I don't. Time as been converted from string to timemilli on a serveur for efficiency, and I have to convert them back to String when I want to display it. 2011/10/14 Zsolt Vasvari > Sure, if you don't care about localization issues. > > On Oct 14, 5:26 am, Thierry Legras wrote: > > Hi, > >

Re: [android-developers] Re: android.text.format.DateFormat.format performance

2011-10-14 Thread Thierry Legras
Thanks Steven! I will try that. As Date.getHours() etc. methods are mentioned as deprecated. I will check with Calendar class as well if it is still faster than DateFormat. Thierry. 2011/10/14 Studio LFP > It is slow and so is String.format(). I've been messing around with it a > bit and here