Search Unity

Kindle Fire HD - Auto Rotation

Discussion in 'Android' started by darthEez, Sep 28, 2012.

  1. darthEez

    darthEez

    Joined:
    Nov 22, 2010
    Posts:
    23
    Has anyone had an issue where the landscape auto rotation is always backwards? I just picked up the Kindle Fire HD last night for testing. I'm not sure if this happens on other Kindles. I have Unity 3.5.6f4

    Example: Launch the app and hold it landscape, it is upside down. Flip the device, it rotates again to be upside down.

    I also noticed this when I downloaded Battleheart from the store, which was built in Unity (though I believe is no longer supported).
     
  2. Wiredcoach

    Wiredcoach

    Joined:
    Jan 31, 2011
    Posts:
    10
    Yes, we just got a Kindle Fire HD and have the same issue. We do not have this issue on old Kindle Fires, Nexus 7, Nook and a few others we've tested.

    We will be trying to solve this, if we are able to, I will certainly post here. If anyone figures it out, please post here.
     
  3. PixelEnvision

    PixelEnvision

    Joined:
    Feb 7, 2012
    Posts:
    513
    Is that also happens when you are using a fixed orientation or only when using autorotation?
     
  4. Wiredcoach

    Wiredcoach

    Joined:
    Jan 31, 2011
    Posts:
    10
    Our programmer says he was not using Unity's auto rotation because that caused crashes on Android 4.1. We are working on iOS releases right now, and won't get back to the Android versions for another week or two. If we can figure this out, I will be sure to post here.

    We are wondering if Unity might fix this issue with an update?
     
  5. bpritchard

    bpritchard

    Joined:
    Jan 29, 2009
    Posts:
    444
    Amazon changed in the new Kindle os (for the new devices) how rotation works... and you have to Manually manage that. We haven't had a chance to mess w/it yet but apparently its sending either the opposite rotation information or its sending the portrait versions as landscape.
     
  6. Bigshoes

    Bigshoes

    Joined:
    Aug 3, 2010
    Posts:
    69
    Anyone have any luck with this issue?
     
  7. ladron

    ladron

    Joined:
    Mar 16, 2012
    Posts:
    47
    Is the orientation correct if you disable auto-rotation and force landscape, or is it still upside down?
     
  8. bpritchard

    bpritchard

    Joined:
    Jan 29, 2009
    Posts:
    444
    Yeah, if you set it to a landscape mode the app launches fine in that mode... but whenever autorotation is on it rotates to the opposite view mode. I know that the kindle team is essentially sending the messages backwards (as i understand it this was an intentional change)... so i'd imagine that there has to be special code written to handle the kindle hd ONLY rotation issues and send the opposite messages when rotation happens.
     
  9. ladron

    ladron

    Joined:
    Mar 16, 2012
    Posts:
    47
    Thanks for the info - I guess I'll force landscape left for now.
     
  10. gametr4x

    gametr4x

    Joined:
    Apr 22, 2009
    Posts:
    86
    I'm currently corresponding with the people over at Amazon over this exact issue. This is the solution they gave me (which is not unity-code but you get the idea):

    Now, since we can't insert that piece of code after Unity calls setRequestedOrientation for us, I'm currently trying the following:

    I then use their information "Amazon" and "WFJWI" to check if it's the Kindle Fire HD, and use the opposite orientation.

    I don't have a Kindle Fire HD to test this on though, so could somebody check if it works? Here's the code I use to change orientation:

     
  11. bpritchard

    bpritchard

    Joined:
    Jan 29, 2009
    Posts:
    444
    @gametr4x

    That code works... i just added it to one of my main update functions so its persistent. I will note that for some reason my Kindle HD (which is the kindle HD not the kindle hd 8.9) returns a Model of KFTT. I've set mine to check for both model numbers... but yea, that code works well!
     
  12. gametr4x

    gametr4x

    Joined:
    Apr 22, 2009
    Posts:
    86
    Good to know. I found a quick post somewhere that lists the model numbers as follows:

    1st gen Kindle Fire: Kindle Fire
    2nd gen Kindle Fire: KFOT
    7”HD Kindle Fire: KFTT
    WiFi 8.9“HD Kindle Fire:WFJWI
    WAN8.9"HD Kindle Fire:WFJWA

    So you'd need to add all of the HD's in those checks to account for the issues... Kind of annoying as this would need to be updated with every new model. I'll ask Amazon if there's any way to check for this in the future without having to re-export the game.
     
  13. bpritchard

    bpritchard

    Joined:
    Jan 29, 2009
    Posts:
    444
    Thanks gametr4x.... added in the additional platforms. Not sure if update is the best place to put the code but it seems to work flawlessly there. :) Really appreciate you doing the legwork on it!
     
    Last edited: Oct 29, 2012
  14. eriQue

    eriQue

    Unity Technologies

    Joined:
    May 25, 2010
    Posts:
    595
    The last two are incorrect

    WiFi 8.9“HD Kindle Fire: KFJWI
    WAN8.9"HD Kindle Fire: KFJWA

    See https://developer.amazon.com/sdk/fire/specifications.html
     
  15. HazeTI

    HazeTI

    Joined:
    Jan 12, 2012
    Posts:
    83
    We've had reports from Amazon about this issue but we've yet to bring one in to test it ourselves. It does sound like the fault is with Amazon and it's an issue that Amazon should deal with rather than us, but thanks for the input from everyone here.

    When we get the HD in I'll try the code reported above and report.

    Thanks.
     
  16. eriQue

    eriQue

    Unity Technologies

    Joined:
    May 25, 2010
    Posts:
    595
    Well, it is technically 'OK' for them to configure the device to have reverseDefaultRotation = true, but it makes the terminology LandscapeLeft/Right in Unity a bit awkward.
    In Unity 4.0 we've made sure AutoRotation works with both of the Landscape modes (same way as Portrait works).
     
  17. HazeTI

    HazeTI

    Joined:
    Jan 12, 2012
    Posts:
    83
    One can just use the Unity SystemInfo.deviceModel. I've only managed to test this on the "Amazon KFTT" (Kindle Fire HD 7") model. I am assuming Unity reports the other models in a similar manner.

    So to modify the code supplied above

    Code (csharp):
    1. if (SystemInfo.deviceModel == "Amazon KFTT" || SystemInfo.deviceModel == "Amazon KFJWI" || SystemInfo.deviceModel == "Amazon KFJWA")
    2. {
    3.     if(Input.deviceOrientation == DeviceOrientation.LandscapeLeft )
    4.     {
    5.         Screen.orientation = ScreenOrientation.LandscapeRight;
    6.     }
    7.     else if(Input.deviceOrientation == DeviceOrientation.LandscapeRight )
    8.     {
    9.         Screen.orientation = ScreenOrientation.LandscapeLeft;
    10.     }
    11. }
    12. else
    13. {
    14.     if(Input.deviceOrientation == DeviceOrientation.LandscapeLeft )
    15.     {
    16.         Screen.orientation = ScreenOrientation.LandscapeLeft;
    17.     }
    18.     else if(Input.deviceOrientation == DeviceOrientation.LandscapeRight )
    19.     {
    20.         Screen.orientation = ScreenOrientation.LandscapeRight;
    21.     }
    22. }
     
  18. gametr4x

    gametr4x

    Joined:
    Apr 22, 2009
    Posts:
    86
    It's funny that the "WFJ..." are incorrect, because amazon themselves sent me the incorrect ones then as well...

    Guess I missed the SystemInfo.deviceModel variable. Why did they decide to put those two values together btw? That just makes it less handy to work with.

    EDIT: Based on all the info I have I'm now checking for the following device models (including the incorrect ones amazon gave me, just in case)

    Code (csharp):
    1. ( BuildAndroid.MODEL.Substring(0,2) == "KF"  BuildAndroid.MODEL != "KFOT" ) || BuildAndroid.MODEL == "WFJWI" || BuildAndroid.MODEL == "WFJWA"
     
    Last edited: Nov 2, 2012
  19. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,264
    Been following this for a while, seems fixed in 4.0 beta as eriQue mentioned.

    Source:
    http://unity3d.com/unity/beta/notes
     
  20. John-Sandrey

    John-Sandrey

    Joined:
    Jul 2, 2012
    Posts:
    119
    I wonder if they plan on fixing this for 3.5? I got $4500 dollars tied up into 3.5 and it would be a shame if the stopped updating 3.5 and went to 4.0. Took me for ever to get the cash for 3.5 and it will take me a while to get the cash to upgrade to 4.0.
     
  21. bpritchard

    bpritchard

    Joined:
    Jan 29, 2009
    Posts:
    444
    Likely not, but the above fixes work perfectly and are SUPER easy to integrate.
     
  22. John-Sandrey

    John-Sandrey

    Joined:
    Jul 2, 2012
    Posts:
    119
    Don't mind me I was just venting, just bought all the pros for unity as out a year ago and it's going to cost me another $2000 just to upgrade.
     
  23. lifeisfunxyz

    lifeisfunxyz

    Joined:
    Aug 9, 2017
    Posts:
    8