Android Question Samsung Galaxy Tab S2

aaronk

Well-Known Member
Licensed User
Longtime User
Hi,

Does anyone own a Samsung Galaxy Tab S2.

If so, are you able to run the following code and let me know what it says when you run the tablet in portrait and when it runs in landscape.

B4X:
Log("ApproximateScreenSize = " & GetDeviceLayoutValues.ApproximateScreenSize)
Log("Width = " & Activity.Width)
Log("Height = " & Activity.Height)

Can you also confirm the OS version you are running.
 

Star-Dust

Expert
Licensed User
Longtime User
Samsung Tab 2 10.1

Portrait
ApproximateScreenSize = 9.180958555619343
Width = 800
Height = 1151

Landscape
ApproximateScreenSize = 9.278469701410895
Width = 1280
Height = 671

 
Upvote 0

aaronk

Well-Known Member
Licensed User
Longtime User
I
Samsung Tab 2 10.1

Portrait
ApproximateScreenSize = 9.180958555619343
Width = 800
Height = 1151

Landscape
ApproximateScreenSize = 9.278469701410895
Width = 1280
Height = 671
What version of Android is it running ?

Also, one last thing, what happens when you run this code:

B4X:
If Activity.Width = "800" And Activity.Height = "398" Then
    log("800x398")
  Else
    If GetDeviceLayoutValues.ApproximateScreenSize > 6 Then
        phone1.SetScreenOrientation(0)
          Log("** tablet **")
      Else
        phone1.SetScreenOrientation(1)
        Log("** phone **")
    End If
End If

The reason I ask for this is because I have a customer who has my app and when they run it on a Samsung Galaxy Tab S2 it just keeps switching between portrait and landscape, but I find on my tablets I don't get this issue, however I don't have a Samsung Galaxy Tab S2.

I have 2 customers both with a Samsung Galaxy Tab S2 and they are running Android 7.0 (Nougat). - http://www.gsmarena.com/samsung_galaxy_tab_s2_8_0-7439.php
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
Android 4.2

The last officer
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
Have you Set Attribute?

B4X:
#Region  Project Attributes
    #ApplicationLabel: B4A Example
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: landscape
    #CanInstallToExternalStorage: False
#End Region
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
I
What version of Android is it running ?

Also, one last thing, what happens when you run this code:

B4X:
If Activity.Width = "800" And Activity.Height = "398" Then
    log("800x398")
  Else
    If GetDeviceLayoutValues.ApproximateScreenSize > 6 Then
        phone1.SetScreenOrientation(0)
          Log("** tablet **")
      Else
        phone1.SetScreenOrientation(1)
        Log("** phone **")
    End If
End If

The reason I ask for this is because I have a customer who has my app and when they run it on a Samsung Galaxy Tab S2 it just keeps switching between portrait and landscape, but I find on my tablets I don't get this issue, however I don't have a Samsung Galaxy Tab S2.

I have 2 customers both with a Samsung Galaxy Tab S2 and they are running Android 7.0 (Nougat). - http://www.gsmarena.com/samsung_galaxy_tab_s2_8_0-7439.php

Sorry, the link you sent me is Samsung Tab S2 But I understood Samsung Tab 2
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
My original post is for a Samsung Tab S2.
I have it set as:
#SupportedOrientations: unspecified

If you want it to be fixed, you need to set either Landscape or Portrait as you prefer, or rather how you thought the application should work
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
It does not make this effect because it's in your device set in Setup that does not rotate while your customers have set differently.

Setting "unspecified" he relies on the device settings
 
Upvote 0

aaronk

Well-Known Member
Licensed User
Longtime User
If you want it to be fixed, you need to set either Landscape or Portrait as you prefer, or rather how you thought the application should work
I have had it like this since day one and it has worked fine until now. The customer has updated to Android 7.0 (Nougat) and now have this issue. I will have another look.
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
I have had it like this since day one and it has worked fine until now. The customer has updated to Android 7.0 (Nougat) and now have this issue. I will have another look.

By updating the default settings of the device will be overridden and most likely the display rotation is set.

The fact that it has not happened to this day could only be a case or a fortune, because often to fix some problems some fix the screen. But it may always happen to have a client who prefers to have the rotation, so it's best to predict.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
I tested this code on my Samsung Galaxy Tab S2, Android V7.0:

B4X:
Log("ApproximateScreenSize = " & GetDeviceLayoutValues.ApproximateScreenSize)
Log("Width = " & Activity.Width)
Log("Height = " & Activity.Height)

If Activity.Width = "800" And Activity.Height = "398" Then
    Log("800x398")
Else
    If GetDeviceLayoutValues.ApproximateScreenSize > 6 Then
        phone1.SetScreenOrientation(0)
        Log("** tablet **")
    Else
        phone1.SetScreenOrientation(1)
        Log("** phone **")
    End If
End If

The result is:
ApproximateScreenSize = 8
Width = 2048
Height = 1376
** tablet **
** Activity (main) Resume **

If I turn the tablet it remains in landscape !
 
Upvote 0

aaronk

Well-Known Member
Licensed User
Longtime User
I tested this code on my Samsung Galaxy Tab S2, Android V7.0:
Thanks heaps!
The result is just like what I thought it would be. I must have a bug somewhere else and will need to go though my code to figure it out.
 
Upvote 0
Top