I have an app on a number of appstores, including Amazon Appstore, that I developed a few months ago with Basic4Android (if interested, it’s Grades2Go Mobile). Because the whole business of creating layouts that would look good on all devices seemed nothing short of daunting at the time (the pre-Designer Scripts age!), I focused on three screen sizes to start, because of the three devices I own: a DroidX (480x854), an HTC Incredible 2 (480x800), and an Amazon Kindle Fire (600x1024). It was subsequently accepted by Amazon for the Fire – probably because I made sure the 600x1024 layout fit its screen perfectly. I had heard that detecting the screen size on the Fire isn’t so straightforward because of the menu bar on the bottom edge.
First of all, I can’t say enough about the quality of Basic4Android as a development tool. I’ve put B4A through all conceivable calisthenics and it has rarely (ever?) crashed for me – and it keeps getting better and better thanks to Erel’s constant efforts. When he added the Designer Scripts feature, I knew the time had come to update Grades2Go to accommodate most of the screen sizes out there.
Designer Scripts is fantastic! I can’t tell you how much time and headaches it has saved me over the last week or so. Very easy to use, and powerful features. I’m pretty much ready to upload the new versions.
But I’d like to share something I learned about Kindle Fire behavior in the process, as well as a quick solution that might help others experiencing the same problem. After creating a universal script that would accommodate any screen size, it worked perfectly on the DroidX and the Incredible 2. And after installing it on the Fire and responding “Open” to the final prompt, the initial activity (Main) loaded its layout perfectly, with the bottom of the layout just above the on screen-menu bar. I was thrilled because it had been so easy. However, I then went to the Kindle’s home screen to do something else. When I returned to Grades2Go, the layout had expanded downward, to the bottom edge of the menu bar (bottom physical limit of the screen)! After that, I found no way to make this not happen. Only reinstalling made it OK again – but as soon as I left Grades2Go and returned again, the problem was back. Expletives.
So what to do? This problem is obviously a weird inconsistency about how the Fire reports its screen size. I’ve seen some discussion on the B4A Forum about this, but no definite conclusions as to how to handle it. If someone happens to understand why the Fire behaves this way, I’d love to hear about it. Maybe Erel knows?
I happened to notice that the rest of my screens, ie those that were the result of a StartActivity() command, always appeared correctly. I therefore decided to use this fact in a way around the problem. I made my Main activity consist of nothing but a short timer, at the end of which I called my previous Main activity (now called “Home”). The code looks like this:
No more problem! I hope this will be of help to others.
First of all, I can’t say enough about the quality of Basic4Android as a development tool. I’ve put B4A through all conceivable calisthenics and it has rarely (ever?) crashed for me – and it keeps getting better and better thanks to Erel’s constant efforts. When he added the Designer Scripts feature, I knew the time had come to update Grades2Go to accommodate most of the screen sizes out there.
Designer Scripts is fantastic! I can’t tell you how much time and headaches it has saved me over the last week or so. Very easy to use, and powerful features. I’m pretty much ready to upload the new versions.
But I’d like to share something I learned about Kindle Fire behavior in the process, as well as a quick solution that might help others experiencing the same problem. After creating a universal script that would accommodate any screen size, it worked perfectly on the DroidX and the Incredible 2. And after installing it on the Fire and responding “Open” to the final prompt, the initial activity (Main) loaded its layout perfectly, with the bottom of the layout just above the on screen-menu bar. I was thrilled because it had been so easy. However, I then went to the Kindle’s home screen to do something else. When I returned to Grades2Go, the layout had expanded downward, to the bottom edge of the menu bar (bottom physical limit of the screen)! After that, I found no way to make this not happen. Only reinstalling made it OK again – but as soon as I left Grades2Go and returned again, the problem was back. Expletives.
So what to do? This problem is obviously a weird inconsistency about how the Fire reports its screen size. I’ve seen some discussion on the B4A Forum about this, but no definite conclusions as to how to handle it. If someone happens to understand why the Fire behaves this way, I’d love to hear about it. Maybe Erel knows?
I happened to notice that the rest of my screens, ie those that were the result of a StartActivity() command, always appeared correctly. I therefore decided to use this fact in a way around the problem. I made my Main activity consist of nothing but a short timer, at the end of which I called my previous Main activity (now called “Home”). The code looks like this:
Sub Globals
End Sub
Sub Activity_Create(FirstTime As Boolean)
End Sub
Sub TimerPreSplash_Tick
End Sub
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim TimerPreSplash As Timer
'These variables can only be accessed from this module.
Dim TimerPreSplash As Timer
End Sub
Sub Activity_Create(FirstTime As Boolean)
TimerPreSplash.Initialize("TimerPreSplash",10) 'show it for 10 ms
TimerPreSplash.Enabled = True
TimerPreSplash.Enabled = True
End Sub
Sub TimerPreSplash_Tick
TimerPreSplash.Enabled = False
StartActivity("Home")
StartActivity("Home")
End Sub
No more problem! I hope this will be of help to others.
Last edited: