Profile your code.

On Mon, Aug 8, 2011 at 10:59 AM, Sebastian Tomaszewski <
[email protected]> wrote:

> Bring this to the TOP again... See if someone has the potential answers...
> Thank you ahead of time....
>
>
> Sebo
>
> On Thu, Aug 4, 2011 at 4:01 PM, Sebastian Tomaszewski <
> [email protected]> wrote:
>
>> Hello All,
>> I have a little dilema with the Timing on one of my Screen Capture
>> applications:
>>
>> 1. Currenlty I am using the following code in oroder to capture the SCREEN
>> SHOT of the device:
>> "
>> v1 = linView.getRootView();
>> v1.setDrawingCacheEnabled(*true*);
>> bmp = v1.getDrawingCache();
>>  "
>> Which gives the following timing when I try to capture every second:
>>    TIME Time to Get Data 1  111MS  2  28MS  3  1MS  4  1MS  5  4MS  6
>> 1MS  7  1MS  8  1MS  ----RESTARTED WHILE APP RUNNING-----  9  2MS  10
>> 31MS  11  3MS  12  1MS  13  1MS  ----RESTARTED WHILE APP RUNNING-----  14
>>   1MS  15  28MS  16  2MS  17  1MS  18  1MS
>>
>> As you can see that the very 1st time it takes forever, comparing to the
>> other times.  Also, always at the second capture it takes more as well.
>> Would anyone know why?  Is there some way that I coudl improve this?
>>
>> 2. The above code is a lot better from the timing perspective then the
>> following code:
>>
>> bmp = Bitmap.*createBitmap*(width , height, Bitmap.Config.*ARGB_8888*);
>>
>> canvas = *new* Canvas(bmp);
>>  3. Finally could anyone tell me if there is another/better way to
>> capture the Screen Shot of the device, which could improve my timing?
>>
>>
>>
>> Please let me know.
>>
>> Thank you and Best Regards,
>>
>>
>>
>> Sebo
>>
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Dianne Hackborn
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to