Possible Multi orientations for b4xpages

Unobtainius

Active Member
Licensed User
Longtime User
We hired a little genius, 17yrs old, still in school to help us out and give someone a little real world work experience. Turns out he's the one teaching us The!

The app we got him to build is online/offline. It consists of data collection pages that are three levels deep. So not huge. But the orientation is set to unspecified and we have two variants for each page, portrait and landscape. The app is for tablets and the customer required it to be mounted in trucks and because the truck's layout determines how the tablet can be mounted, one orientation just wouldn't do. Presently you can swap orientations as much as you like and your data is not affected at all.

I haven't had a deep dive yet but he's using the android view state objects to rebuild the B4XPages page stack when the orientation change restarts the main activity. It seems to work flawlessly. It does however make me feel like I'm getting a little too old and way too dumb for this game!

I'm happy to share his work as I'm sure the single orientation confines of b4xpages is a little disheartening for some since it's such a great framework to be sure.

Obviously having to hire him in the first place means I'm absolutely flat out and I won't see him for another week. That's right I see him once a week and he gets through in one day what would take me a week. But I will make it a personal mission to get some of his work into the forum. If I can strip away the superfluous stuff down to bare bones so even I can understand it, then it may be of some benefit to us all.
 

Unobtainius

Active Member
Licensed User
Longtime User
Next time hire a random non-genius old man, for example LucaMs, and... you won't have these joys ?
I am a random old non-genius too. This guy just blows my mind. Finding him was like all my Christmas' have come at once.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
There is no magic. With complex apps it becomes more and more complicated to maintain and recreate the state, especially when you have all kinds of tasks running in the background.
Depending on your requirements it might be simpler to add a second activity to handle a specific feature that requires different orientation (full screen video or camera for example).

Many of the advantages listed here, will no longer be true once you need to deal with recreating B4XPagesManager and all pages: https://www.b4x.com/android/forum/threads/b4x-b4xpages-what-exactly-does-it-solve.119078/#content
 

Unobtainius

Active Member
Licensed User
Longtime User
He got one of his mates into work with us as well. He's like maybe 75% as smart but that's still 50% smarter than the rest of us?
 

Unobtainius

Active Member
Licensed User
Longtime User
There is no magic. With complex apps it becomes more and more complicated to maintain and recreate the state, especially when you have all kinds of tasks running in the background.
Depending on your requirements it might be simpler to add a second activity to handle a specific feature that requires different orientation (full screen video or camera for example).

Many of the advantages listed here, will no longer be true once you need to deal with recreating B4XPagesManager and all pages: https://www.b4x.com/android/forum/threads/b4x-b4xpages-what-exactly-does-it-solve.119078/#content
Easy for you to say @Erel you're another brainiac ?
 

LucaMs

Expert
Licensed User
Longtime User
The fact is we don't remember how smart we were at that age and therefore underestimate them.

At that age you are much less experienced but more "alert", more ready to learn and even to intuit.


This applies to all of you, of course; I am a genius at any age
Pinocchio.png
?
 

agraham

Expert
Licensed User
Longtime User
I'm sure the single orientation confines of b4xpages is a little disheartening for some since it's such a great framework t
Unfortunately it's the confinement to a single orientation that makes B4XPages work as it creates a single Activity that never needs to be recreated so avoiding the Activity life-cycle complications. Well that and a feature of Android that Erel tells me doesn't kill Activities in the background.
 

AnandGupta

Expert
Licensed User
Longtime User
I haven't had a deep dive yet but he's using the android view state objects to rebuild the B4XPages page stack when the orientation change restarts the main activity.
What Erel disabled (i.e orientation killing the activity and recreating - feature of Android), he is doing it manually.
Just show him the list of benefits of one orientation lock of B4XPages, he will understand what he is missing.

As for numerous discussion on B4XPages locking orientation, Erel is not stopping you to use default Activity environment for the app.

I say this because I have made both default many activity app (as per requirement) and B4XPages app (as per requirement). Erel gave you both. Choose what you like.
 

Unobtainius

Active Member
Licensed User
Longtime User
I do think there is a valid argument for the simplicity afforded to us by the single orientation aspect of B4XPages as far as the whole android activity thing goes. I started off in B4A having to deal with it so that's why I love b4xpages soooo much.

If we can get this thing working as simple as possible so you can sort of set it up then forget about it, I still think it could be useful, but it's got to be simple enough for the likes of myself to use. ?

The last thing I would want to do, guys and gals, is to introduce something to detract newbies from how awesome this product has become.

As for the rest of us, it's something to have a look at just for the fun of it and maybe learn something.
 

Unobtainius

Active Member
Licensed User
Longtime User
What Erel disabled (i.e orientation killing the activity and recreating - feature of Android), he is doing it manually.
Just show him the list of benefits of one orientation lock of B4XPages, he will understand what he is missing.

As for numerous discussion on B4XPages locking orientation, Erel is not stopping you to use default Activity environment for the app.

I say this because I have made both default many activity app (as per requirement) and B4XPages app (as per requirement). Erel gave you both. Choose what you like.
Thanks for your input @AnandGupta, always appreciated and I agree with you.

This was more a case of completing the app in B4XPages only to find out the whole need for both orientations thing until afterward. Yes it was bad gathering of requirements on my part, so having this guy come up the ability to provide it, for such little cost to me, was way easier than arguing with the long term client about the need for the original quoted price to increase by close to 50%.

Sometimes the universe does smile upon me.
 
Top