Designer Scripts Issue and Crashing Issue

sarim123

Member
Licensed User
Longtime User
Hi Everyone
Im having a major issue with my app I am trying to finish up. There are 2 issues.

1) My app doesn't look very good on tablets. There are major position issue with my app on tablets. Here is an examples

This is on a Nexus 7
This is a Kindle Fire HD 10.1

Heres the Designer scripts

B4X:
PanelMain.Height = 100%y
PanelMain.Width = 100%x

ButtonSta.HorizontalCenter = 50%x
ButtonPre.HorizontalCenter = 50%x
ButtonAnt.HorizontalCenter = 50%x

ButtonAme.Left = 0%x + 10dip
ButtonFac.Left = 0%x + 10dip
ButtonCre.Left = 0%x + 10dip

ButtonCon.Right = 100%x - 10dip
ButtonImp.Right = 100%x - 10dip
ButtonPle.Right = 100%x - 10dip


ButtonAme.VerticalCenter = 60%y
ButtonFac.VerticalCenter = 75%y
ButtonCre.VerticalCenter = 90%y

ButtonPre.VerticalCenter = 60%y
ButtonSta.VerticalCenter = 75%y
ButtonAnt.VerticalCenter = 90%y

ButtonCon.VerticalCenter = 60%y
ButtonImp.VerticalCenter = 75%y
ButtonPle.VerticalCenter = 90%y

Not quite sure whats happening there

2)

Then when i click on presidents it crashes on the Kindle.
I have around 40 pictures in a scrollview. Maybe it is running out of memory or something, im not sure and i really need help.

Can someone look at my code and just touch it up please. Thanks.


Here is the code
https://docs.google.com/file/d/0B0XAaRqj65TeQVVzNDRZbllsalE/edit?usp=sharing
 

NJDude

Expert
Licensed User
Longtime User
You should remove the 480x800 variant on the MAIN layout, that's the one with the "funny" buttons.
 
Upvote 0

sarim123

Member
Licensed User
Longtime User
The Main Activity and Layout is giving me the trouble. There should be 9 Boxes. The amendments and constitution buttons are stretched on the nexus 7 and is also stretched on the kindle.

As for the logs, i am not quite sure how to access the logs on a kindle. i just transferred the apk on to the kindle to test it. My images are mostly 200x300 and are about 10kb each.

Thanks
 
Upvote 0

NJDude

Expert
Licensed User
Longtime User
The amendments and constitution buttons are stretched

They are indeed, but only in the variant I mentioned on my previous post, you could remove it, if you do, you won't see that issue anymore.
 
Upvote 0

sarim123

Member
Licensed User
Longtime User
Oh got it NJDude Thanks.

However i am still experiencing crashes on the kindle? Ideas? Maybe it could be me. Anyone else seeing this issue? Any way to log this?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Why don't you use the UI cloud? You will immediately see that something is not fine with your layout. As NJDude wrote you should remove the second variant.

2) Do you have access to the logs? I guess that it is a memory issue. You are loading very large images. Are you using LoadBitmapSample? You may need to use smaller images.
 
Upvote 0

sarim123

Member
Licensed User
Longtime User
Thanks for helping me Erel but the button issue is fixed. I am currently looking for a way to prevent the crashing when i load the 40 images on the kindle fire. It works on phones but not on the kindle.
 
Upvote 0
Top