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 / Now we move on to Tier 2 Android Orientation issues

Author
Message
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 23rd Aug 2012 23:29
Okay, I have my game 99.999% done, fully converted and working in Tier 2.

I had it successfully working in Windows and iOS (iPod Touch, iPad2).

So, time to get it working in the Android world. And, after some issue that I don't know what it was but I managed to make it disappear, I got it compiling and working (almost) on my Android devices.

These are my Android test devices:
1. Toshiba Thrive 7", Android version 3.2.1 Honeycomb
2. VIZIO VTAB1008, Android version 3.2.1 HTK55
3. Nexus 7, Android version 4.1.1 Jelly Bean

They all happily loaded and looked correct, but did not quite play correctly.

The Toshiba played fine, but the orientation (based on which side the top is tilted to) is the reverse of how it plays on the iOS devices (I've posted how to fix the misunderstanding between AppGameKit and iOS about which side the home button is on for orientations 3 and 4). But that doesn't worry me at all, as long as it sticks with one orientation and doesn't flip (which it doesn't).

The Nexus and Vizio show the same orientation as the iOS devices. However the actual values returned by the accelerometer while in orientation 3 are not correct.

So, I decided to run an app to show what was reported for the orientations.

I created both a Tier 1 and a Tier 2 version.

Here is the Tier 1 code (very simple):


Here is the template.h file (you can see I have it set up for multiple platforms):


And template.cpp:


(See post http://forum.thegamecreators.com/?m=forum_view&t=198533&b=44 for an explanation about appGetResumed and how it is used.)

Pretty straight forward. I built the apps first in Windows, which worked of course without actually allowing me to rotate the app.

Then I made Tier 1 and Tier 2 projects in both Xcode and Android, all using exactly the same code listed above.

On the iOS devices, both Tier 1 and Tier 2 reported the same things and adjusted orientations as expected.

The Android apps behaved quite differently, between Tiers and devices.

These are the orientation definitions as they are working on my iOS devices:
AGK Orientation 1 - iOS Portrait with home button on bottom (Xcode - Portrait)
AGK Orientation 2 - iOS Portrait with home button on top (Xcode - Upside Down)
AGK Orientation 3 - iOS Landscape with home button on right (Xcode - Landscape Right)
AGK Orientation 4 - iOS Landscape with home button on left (Xcode - Landscape Left)

(It was these last two that were causing a problem on iOS until I figured out the fix, see post http://forum.thegamecreators.com/?m=forum_view&t=198994&b=44.)

This table will show what happened on each device and tier, the numbers are the AppGameKit orientations:


Okay, we have a native usage issue again.

Comparing the Core.cpp files, there is a section in the Tier 1 file that was commented and set as OLD that still exists in the Tier 2 file.

So, the native stuff does not appear to be being used in the Tier 2 Android stuff.

Cheers,
Ancient Lady
AGK Community Tester
JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 24th Aug 2012 00:35
How annoying. I'm under a bit of pressure but will try tomorrow to see what happens in a Pascal version on my tablet.

I suspect that some of this is Android mess.

-- Jim DO IT FASTER, EASIER AND BETTER WITH AppGameKit FOR PASCAL
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 24th Aug 2012 15:40
It's definitely in the Android specific code.

The fact that one file lists code as 'old' and goes to great lengths to get the native orientation information and the other doesn't indicates that some of the core AppGameKit stuff needs updating.

For anyone not worrying about using the accelerometer, it shouldn't be an issue.

Cheers,
Ancient Lady
AGK Community Tester
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 25th Aug 2012 01:19
I have updated the Android tier 2 template and the Android beta player with some of the latest fixes merged with 1076. They can be found in your products section.

The Vizio tablet looks like it may still misbehave with the new version, let me know what happens.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 25th Aug 2012 06:09
Thanks Paul, I'll give it a try tomorrow (time for bed).

Cheers,
Ancient Lady
AGK Community Tester
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 25th Aug 2012 21:08
Paul, I am a happy camper!

I had to remember to copy over all the right files and then it worked beautifully!

The Toshiba Thrive 7" still shows the same. But, since it is basically correct with portrait vs landscape, not a problem (except may for using the camera).

The Nexus and Vizio are both now good.

And my game plays properly on all the devices.

Awesome and Thank You!

Cheers,
Ancient Lady
AGK Community Tester
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 26th Aug 2012 14:29
new template!

thanks for supporting t2

Login to post a reply

Server time is: 2024-05-02 04:54:38
Your offset time is: 2024-05-02 04:54:38