If you are loading your images as drawables, the framework will pre-scale the bitmap for you so it shouldn't need to be scaled at draw time. If you are using the lower-level APIs to load bitmaps, you will need to use these appropriately to have them scaled for you. You can look at the various APIs introduced in 1.6 for controlling the scaling.
Fwiw, there are no "stability" problems I know of with SurfaceView in 1.5. It is used quite a bit throughout the system. On Thu, Jan 7, 2010 at 6:38 AM, Andrea <[email protected]> wrote: > Hi Jason, > > On 7 Gen, 05:11, Jason Arora <[email protected]> wrote: > > Are you drawing in a separate thread (like the LunarLander example)? > > If not and your game is real-time, I seriously recommend switching to > > that model. > > I don't use a SurfaceView (like LunarLander) but a normal view because > in my tests I found it much more stable then the surfaceView. Keep in > mind that android was 1.5. With 1.6/2.* things maybe changed, I have > to test it. There are no threads in the game apart the one used for > loading all the images before the game starts. > > > > > Also, I don't believe you should be seeing a slow-down in > > compatibility mode... In my experience, it has worked pretty well. > > Trust me, with the code structure explained before the frame rate > slows down, I tested it on the DROID device at last london android > lab. > > Andrea > > > On Jan 6, 11:56 am, Andrea <[email protected]> wrote: > > > > > Hi Robert, thanks for the reply. > > > Ok the images are loaded as Bitmaps (not drawable) and drawed on the > > > onDraw(Canvas c) method of a view. Inside that method I invalidate() > > > all the view. So the game runs as fast as it can. The game is using > > > dirty rects technique to redraw only the portions of the screen that > > > need to be changed. Here is the simply code structure: > > > > > //on a view > > > private void onDraw(Canvas c){ > > > > > //do staff > > > > > invalidate(); > > > > > } > > > > > if you need some other info, tell me it. > > > > > a.p. > > > > > Robert Green ha scritto: > > > > > > What's your design like? How are you drawing everything? If you > tell > > > > me that, I can offer some suggestions. > > > > > > On Jan 6, 9:02 am, Andrea <[email protected]> wrote: > > > > > Hi > > > > > I developed a game with the g1 in my mind. Now I want to support > large > > > > > screen sizes but I don't want to add in the apk different images > for > > > > > different screen sizes because now the apk is 3mb and when > installed > > > > > trought market it became 6mb (due to protection on). If i have to > > > > > double the images to support new screens, the apk would be too > heavy > > > > > (about 13mb, i think) so I'm wondering to know if scaling images at > > > > > runtime by myself (without compatibility mode) maybe the best way > for > > > > > supporting larger screens. Someone tried this solution? > Compatbility > > > > > mode does a great work in scaling images but it slows down > drastically > > > > > the framerate (i think because the scale operation is made every > time > > > > > an image is used/moved and not only once on the load of the image > > > > > itself). > > > > > > > Thanks > > -- > 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]<android-developers%[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

