Slow load layout etc.

bluedude

Well-Known Member
Licensed User
Longtime User
Hi,

I notice all the time when loading my app. that it first shows the title bar with a black screen. The title is the app. title.

It seems to take a while before the layout gets loaded and shown, especially on slower devices.

In every app. this is the case, even the tiny ones. Is there a way to make the loading process more slick?

Tried adding a loading dialog etc. in Activity create but no luck. I guess this is how B4A does the loading process.

Any suggestions?
 

klaus

Expert
Licensed User
Longtime User
It seems that we are turning in circle.
As long as we don't know what exactly you are doing it's impossible to give you concrete advices.
As always, posting a project that shows the problem would have been the best way to get an answer.

How does the attached test program work on your devices ?
It's just a bitmap displayed first and then loads a second layout file and adds 100 buttons.
On my Nexus One no black screen, before the display of the bitmap when running it.

Best regards.
 

Attachments

  • SplashScreen.zip
    41.7 KB · Views: 237
Upvote 0

bluedude

Well-Known Member
Licensed User
Longtime User
As said, i'm doing nothing project wise. Start B4A, create a project and nothing special. There is nothing special to share, any project can be used.

Will try yours but I know the answer :)

Will attach a screenshot what I exactly mean because obvious nobody notices :)

Cheers,
 
Upvote 0

vb1992

Well-Known Member
Licensed User
Longtime User
I am interested in this topic/subject because it's important to know
how our apps will be on slower (possibly bloated) devices.

So thanks BlueDude for creating this topic
 
Upvote 0

bluedude

Well-Known Member
Licensed User
Longtime User
Slow display

Klaus, Erel etc.

Attached a screenshot (this time from the emulator) with the "issue" i mean. I used Klaus's sample for this but I could have used a bare bones project or any other project. It is just how the app. is initiated.

This same screen displays on the device so no need to get a screenshot from that one because I already did that multiple times.

I'm not saying this is a problem but just that its not very nice. The bigger the app. (more in Activity_Create) the longer this displays normally.

However, could cope with that by using Loading dialog.

This screen gets displayed before Activity_Create is initiated. I think it is weird nobody is seeing this although I bet it is there. Maybe i'm too much into the details but I especially think it is annoying on slow devices.

Sorry for consuming all your guys time, was not my intention at all because it isn't a major issue at all.


Cheers and sorry for leaving some people blind.
 

Attachments

  • splashscreen.jpg
    splashscreen.jpg
    5.5 KB · Views: 257
Upvote 0

bluedude

Well-Known Member
Licensed User
Longtime User
vb1992

Just to be clear, it isn't a real showstopper or problematic issue. B4A performs great and layouts are loading fast etc.

My eye for detail is the problem here. I already use B4A for a long time and I'm now in the phase to fine tune a few apps. and this caught my (and others) attention. As said, especially on a few older HTC Hero devices.

So no worries overall :)
 
Upvote 0

eps

Expert
Licensed User
Longtime User
I know what Bluedude is talking about.

When intiating Apps, the whole screen goes blank for a certain amount of time, while the first items of code are executed. The workaround is to put in a splashscreen - all Apps which take a long time do this not just B4A ones.. The trick here is to minimise the time that the screen is blank and do the processing in the background whilst this is displayed.

I would also recommend taking a long hard look at the code being executed on App startup and put Logging in place, to time how long items are taking to execute and then work out how to optimize them.

Ideally something like this could be done..

Start App

Show Splash screen (as quickly as poss)

Do all the other processing stuff to create the App look.

Show App.

As opposed to...

Start App

Do all the other processing stuff to create the App look.

Show App.

It still takes just as long if not longer, but the user perception is that something is happening and it looks and feels more professional.

ETA : My Apps take around 1-2 seconds to display, but this is on a Desire HD. I'm sure on a Hero and slower machines it will take a bit longer than this.. It's just about acceptable on my phone. I know that it's mostly due to pulling records from the DB.
 
Upvote 0

bluedude

Well-Known Member
Licensed User
Longtime User
Exactly. However, never noticed this with apps. not created with B4A. Will need to investigate that a little more.

If devices will become faster and faster that problem will solve by itself.
 
Upvote 0

eps

Expert
Licensed User
Longtime User
I hadn't noticed it either, but it is there, but they put a splash screen in so that you can hardly notice it... :BangHead:
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
There are two issues here. You can show a splash screen before running your initialization code assuming that it takes a second or two. This is the time it takes Android to build the UI elements.

Bluedude was referring to the time it takes before a single line of code is executed. From my experience this time is barely noticeable in most cases.
 
Upvote 0

bluedude

Well-Known Member
Licensed User
Longtime User
Erel,

Correct. So basically the only answer I was looking for is "Can we do anything about it?" I know we can try to do something inside B4A but that does not solve the problem on slow devices

Is this the way how B4A loads or is it Android app. specific? I haven't seen it in other non B4A apps.

If there is nothing we (or better, B4A) can do I let it rest. On future devices, which are way faster, it will not be a problem anymore.

Cheers and thanks for the discussion.
 
Upvote 0

Kevin

Well-Known Member
Licensed User
Longtime User
I remember seeing this thread a little while ago and I knew exactly what BlueDude was talking about. I've been up all night (working a night shift), so perhaps I am missing something as I read this thread now, but it doesn't seem like anyone is really understanding (or acknowledging) what he is talking about.

I've noticed this too (and I agree it isn't a showstopper), and as with all Android apps, you often see a black screen for a brief moment, however, in B4A apps, it also shows the app's title. I think it is that detail that BlueDude would like the option to disable, and I wouldn't mind that option either.

I think it would just look better if the screen were completely blank/black, without the app title. Granted, some apps normally display a title (in which case it is fine the way it is), but in the case of full-screen apps where you wouldn't normally show a title bar at all, it looks a bit funny that we are forced to see the title when the app first runs, even if only for a brief moment.

Not a formal complaint in any way (I love B4A), but I liked where BlueDude was going with it and I wanted to make sure that others understand the idea.

BlueDude: If I have gotten this wrong and I am the one misunderstanding your post, then I apologize (but my 2 cents remain). ;)
 
Upvote 0

latcc

Banned
I have seen this blank startup screen on a slower device. Ideally a splash screen would appear prior to loading the actual program. But that seems impossible if I have read this thread correctly. Would a "Please wait..." text would be possible in this grey basic page?
 
Upvote 0

bluedude

Well-Known Member
Licensed User
Longtime User
Kevin,

That is indeed exactly what I mean, the title is kind of distracting and I got feedback from some people they think the app. isn't working.
 
Upvote 0
Top