Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Android™ Runtime Development

Reply
Highlighted
Contributor
Posts: 14
Registered: ‎03-13-2012
My Device: Not yet
My Carrier: Gonna change

Scaling problems on the Playbook

Hi there !

I'm new to the BlackBerry Platform and trying to put my app on the AppWorld but experiencing some issue.

 

Actually I thought everything was going well until I recieved a mail saying my app hasn't been approved.
I finally manage to try on the Playbook Simulator (I was doing it wrong so I only tested on the Android Emulator on which everything is running well) but there is indeed a problem.

My app acts as if it was resized and take only a small part of the screen (my images are in the drawable-hdpi so there shouldn't be any resizing right ?).

I don't know how to fix it.

 

Anyone could help me ?

Thanks. 

Contributor
Posts: 29
Registered: ‎03-06-2012
My Device: Developer

Re: Scaling problems on the Playbook

This is confusing because you don't give enough information. You don't say:

1. What was scaled. What is it? An ImageView? A custom view? What is scaling incorrectly?

2. What do you mean it "acts as if it was resized"? What do you mean it takes only a small part of the screen? If it's taking a small part of the screen, what's on the other part of the screen? You have to be more specific when you're describing things.

 

"my images are in the drawable-hdpi so there shouldn't be any resizing right"

The drawable folders hold different assets for different density displays. This by itself has nothing to do with resizing. You don't give enough information about your app or what you're experiencing, there could be a lot of things causing "resizing" to occur, you could have seen it fine on Android Emulator because you used one virtual device and you tailored the UI to fit that one virtual device well without considering resolution independence or designing your UI to dynamically position its components and sizes based on the screen dimensions at runtime. It could be because you're using absolute values as opposed to relative values and what you're seeing on the virtual device looks fine because it's on the virtual device but when you move to the Playbook the UI shrinks because the pixel density is different and thus the "50px" has a different value due to the difference in pixel density. Again, we need more information about your app, about what you're experiencing, about how you've done your layout and coding and what you used for your virtual device. It would also be great to know what your rejection reason was.

Contributor
Posts: 14
Registered: ‎03-13-2012
My Device: Not yet
My Carrier: Gonna change

Re: Scaling problems on the Playbook

[ Edited ]

Well sorry for lacking of precision.

The reason my app was refused is : "The Apps didn't appear properly on the device, please fix the scaling issue"

Here are screenshots to explain what's wrong :
http://imageshack.us/photo/my-images/828/bugus.png/ (I eventually changed drawable-hdpi to drawable and it fits better but as you can see it still not convenient).
Whereas on the Android emulator : http://imageshack.us/photo/my-images/824/workingr.png/
I configured the andoid emulator to fit the Playbook resolution so there shouldn't be these changes right ?

I can't see why.

Furthermore, it seems that the application does not respond. I cannot click on the links of my app.

My app uses only the SDK provided by Google for Android and works with one Activity and a SurfaceView to draw my images.

What do you mean by the positions with the Playbook, the Playbook android emulator is not working as a real Android for scaling images ?

Sorry for no providing the elements you need to conclude but I can't see what could actually do that and I cannot really tell you everything, it would be to much right ?
What's missing then from what you see ?

 

Thanks.

Contributor
Posts: 14
Registered: ‎03-13-2012
My Device: Not yet
My Carrier: Gonna change

Re: Scaling problems on the Playbook

Hi… I didn't really solve the problem but I used canvas.scale to increase manually the size of my images but it's not the best I could do regarding the fact that all my images are made to fit the Playbook screen…

Contributor
Posts: 14
Registered: ‎03-13-2012
My Device: Not yet
My Carrier: Gonna change

Re: Scaling problems on the Playbook

Sorry to answer again but there is a major update.

Actually, I have a friend who tried on his Playbook and the problem isn't present. It seems it occurs only on the simulator.

 

I have no idea why… 

Contributor
Posts: 21
Registered: ‎03-07-2012
My Device: Developer
My Carrier: T-Mobile

Re: Scaling problems on the Playbook

Strange. Maybe you've specified a height or width somewhere in your styles, ambiguously. I'd go over all the elements that have specified size and work it out. Just experiment without specifying some of the parameters. In some cases, one parameter may be hiding the effect of another. Bottom line is to try and clean up your styles as much as possible.
Contributor
Posts: 14
Registered: ‎03-13-2012
My Device: Not yet
My Carrier: Gonna change

Re: Scaling problems on the Playbook

Well, actually nothing in my game really sets the size… (I'm really new to this)

 

I though that using the different drawable folders might be enough for a game…

Contributor
Posts: 21
Registered: ‎03-07-2012
My Device: Developer
My Carrier: T-Mobile

Re: Scaling problems on the Playbook

What I now feel is that your background is not scaling or something of that sort. You might wanna read up on some tutorials about scaling and styles for Android. It's pretty simple, just like for websites.
Contributor
Posts: 14
Registered: ‎03-13-2012
My Device: Not yet
My Carrier: Gonna change

Re: Scaling problems on the Playbook

Well I know that but the thing is that It doesn't display the same on Playbook and Simulator (also touch envents are only working on an Actual Playbook) so…

 

I'll be seeking for some more information.

Contributor
Posts: 29
Registered: ‎03-06-2012
My Device: Developer

Re: Scaling problems on the Playbook

I really wish I could help you but it's just so hard without more information for this kind of problem where it's hard to pinpoint the causes. I don't want you to give me all of your code, that's not what I mean.

 

I've read all of your posts and it's been helpful, I now have a better opinion on what's going on:

1. You said you changed from SurfaceView to View and your problem with force close went away. I do agree that it's probably a threading issue. Did you copy the code from the LunarLander example? I think you implemented the threading wrong while doing this. At your level you might not be ready for threading. Don't worry, there's another way...

 

2. When you said you touch the screen and nothing happens on the simulator but something happens on the actual Playbook, that sounds weird and contradictory. But when you say a force close message pops up that makes me feel like the touch events are handled properly, you're just not seeing it because the app is frozen.

 

3. At this point I need to ask you what you're using the SurfaceView for. Going back to your picture...

http://imageshack.us/photo/my-images/824/workingr.png/

Explain to me what the SurfaceView was intended to do for you in that picture. I feel like there are painless ways of doing what you're trying to do and you're doing it harder than you need to. I'm confident we can get past this issue, you just need to explain what you're trying to do with the SurfaceView.