Emulator runs fine, but real device is slow

39 views
Skip to first unread message

ad...@java-tuts.com

unread,
Aug 29, 2013, 4:44:34 AM8/29/13
to codenameone...@googlegroups.com
Hi I'm hoping you can help me.

I have a problem, with a Slotmachine I'm trying to program. In order to animate the slots have I made use of a Single UITimer, that is schedueled every 17th second. When the timmer ticks, I call update and repaint methods on each slot.

When I run this, on my computer everything works fine, but when I run it on my actual device (HTC Desire ~http://www.gsmarena.com/htc_desire-3077.php) it's just lacking alot. Since the HTC desire processor is a 1Ghz processor and my computer has around 3.2Ghz, this could be the reason, 
But this shouldn't be a problem, since I'm not using any kind of heavy calculations during updates.

Do you have any surgestions to, what I should do to improve the performance :) ?




sincerely,
Kevin
X2Runnable.java
Slot.java

Shai Almog

unread,
Aug 29, 2013, 2:48:46 PM8/29/13
to codenameone...@googlegroups.com, ad...@java-tuts.com
Remove the usage of fill linear gradient and use an image instead or better yet avoid drawing altogether if possible.
If you will show me images containing the result you are interested in achieving I might be able to give you better advice.

ad...@java-tuts.com

unread,
Aug 29, 2013, 3:19:13 PM8/29/13
to codenameone...@googlegroups.com, ad...@java-tuts.com
Thx Shai,
It really did power the speed up on the device, I had no clue that radialGradients required, so much from the device :)

The container I'm interested in achieving is a Slot Wheel where it looks like it's scrolling, kind of what you see in this picture

Shai Almog

unread,
Aug 29, 2013, 3:23:57 PM8/29/13
to codenameone...@googlegroups.com
Why not use a generic spinner or just 3 lists one next to the other?
Reply all
Reply to author
Forward
0 new messages