Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Has anyone figured out how to put up a startup image (like iOS does) for Android?

Author
Message
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 7th May 2013 22:42
With iOS, you have a bunch of Default.png images (one for just about every orientation and iOS device and resolution). And the app displays the appropriate one when it starts and it stays up until the first Sync() cycle that changes the display.

I very much want to do the same thing for Android. At a minimum, I want to be able to specify an image to display from the moment the app starts until AppGameKit executes the first Sync() call.

And the AGKSplash.png image just doesn't cut it for two reasons.

The first is that it still doesn't display immediately, especially in the case of the first time an app is run after installation.

The second is that it will not display in the orientation the app is set up for using the appropriate settings in all the .xml files (AndroidManifest.xml, etc.).

I've set my Android project up so that it goes straight into Landscape Left orientation (home button on left) the split second it starts up. And with a landscape image named AGKSplash.png in <andproj>/assets, the display is very odd. The main display is in clearly in landscape (even when the device is held in portrait) and the image shows as a squished landscape displayed in a portrait orientation centered within the larger display.

All of the AppGameKit display handling is hidden in the library and I can't find anyway to do something like put up an image and then initialize AGK.

It appears to work beautifully for iOS. There should be a way to do this in Android.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 7th May 2013 22:47
I just load up an image at start up. On android I do not get an black screen, but I immediately get my "loading" screen. Which is nearly immediately followed by my Napland Games splash.
I was never able to get the AGKSplash to work and abandoned it.

I had to do this:
http://forum.thegamecreators.com/?m=forum_view&t=204959&b=46
To enforce the locking of the orientation to make sure there was no squishing.

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 7th May 2013 22:56 Edited at: 7th May 2013 22:57
In Tier 1, it happens very fast and immediate because the AppGameKit engine starts executing the byte code stuff almost immediately.

My issue appears to be Tier 2 related.

Locking the orientation within AppGameKit is easy and not an issue. I have had no problems with this in any platform (and have frequently been the one who helped others get this right).

However you cannot do it in Tier 2 until app::Begin() gets called.

And it appears that AppGameKit does all sorts of stuff before that. One thing in particular is displaying the AGKSplash.png file, if it exists. Otherwise, you get just a black blank screen until the first agk::Sync() call done in either app::Begin() or app::Loop().

I did add the main.xml file to my project and it forced the app straight to the correct landscape orientation. But AppGameKit did not recognize that it was in that orientation and, further, did not recognize that the image was a landscape one.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 7th May 2013 23:00
Oh right.. forgot you're using tier 2.

Not my expertise, but I'd love to know how to fix it too!

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 7th May 2013 23:54 Edited at: 8th May 2013 00:03
I was able to shave some time off the initial blank by adding a new state in the main app::Loop() method that simply does a couple of Sync calls and then sets the state to start the game initialization on the next loop.

The app::Begin() method does a call that sets up the display and shows the loading message.

The old state then immediately went into the game initialization after a couple of Sync() calls.

But, in Tier 2, Sync() calls don't really have as immediate affect as in Tier 1. They appear to really only trigger the final Swap at the end of the app::Loop() method. So, my initial state was calling the long init function and not letting the Sync() happen.

Naturally, now I appear to have done something somewhere else that causes the app to crash the first time when the user enters their name. And this only happens in Android.

Still, I would love to be able to have even those first couple of seconds of blank not be there.

EDIT: And, on my Nexus 7, the backup key doesn't work anymore in the EditBox. On my Samsung Galaxy S III and Toshiba 7" Thrive, it crashes when I click on the enter button on the keyboard.

Also, the initial start up time after installation, still shows about 5-6 seconds of blank. But subsequent start ups only show a couple of seconds of blank.

Now to figure out what I did to break it for Android.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master

Login to post a reply

Server time is: 2024-05-07 02:01:57
Your offset time is: 2024-05-07 02:01:57