Hi all,
There might be a few devs here who can help hopefully....Programming for android(java), is it more efficient to use ints or these days are you are well off using floats?
Quite hard to find an answer. In the google docs http://developer.android.com/guide/practices/performance.html they say to use floats sparingly....but other sources say that the real world performance hit on newer devices is minimal?
I use quite a few floats(a lot are needed to be floats for opengles but could be cast at the last minute)in my game and so wondering whether to convert prior to release....
well floats are generally more complex and so will need more performance, but as you say these days all devices have quite sufficient power to handle more than a few floats, so it's probably not that big a deal unless you're doing loads of complex calculations...
but generally i use ints when i can, but ints are only whole numbers, so any time you need anything with decimal points you have to use a float.
I'd say leave it. Garbage collection related performance issues (going back a few years and never programmed on Dalvik) in Java are likely if you're doing a lot of 3D jazz. The chances of being able to resolve it by trimming floats to ints are unlikely though. Good practice and all that, but may not be worth your time. Â
It'll be the graphics and textures themselves rather than the numerical data types they're using, that canes the processor so look at optimising that if you get issues. Â
cheers lads, its only a 2d game and i guess there arent THAT many floats involved,performance seems fine....i do use ints where ever possible....i think ill leave well enough alone and actually concentrate on getting the game released. *gulp*
This looks like a good place for this question: what's the best way to go about developing Android stuff on a Mac? There an Eclipse plugin that sets up the whole environment for you or anything? Specifically, I'm interested in making widgets.