Android Question Full Screen Oriented

hdmiacc

Member
Licensed User
Longtime User
Where i can get tutorial for :

1. full screen Oriented.. only for
portrait
2. how to setting for all screen device
 

hdmiacc

Member
Licensed User
Longtime User
Main layout

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

#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region

Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.

End Sub

Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim ph As Phone
Dim imgz As ImageView
Dim lblInfo As Label
Dim lblTitle As Label

End Sub

Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("vdr")
ph.SetScreenOrientation(1)
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub



Sub btnVZ2_Click
StartActivity(vz2)
End Sub

2nd Layout

#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region

Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.

End Sub

Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim ph As Phone
Dim btnCal As Button
Dim btnMain As Button
Dim editZ1 As EditText
Dim editZ2 As EditText
Dim imgZ As ImageView
Dim editVin As EditText
Dim lblVin As Label
Dim lblZ1 As Label
Dim lblZ2 As Label

Dim lblCal As Label
Dim lblCal1 As Label
Dim lblResultVout As Label
Dim lblVout As Label

Dim z1 As Int
Dim z2 As Int
Dim vin As Int

Dim lblAnsZ2 As Label
Dim lblAnsVin As Label
Dim lblAnsZ1 As Label
Dim lblAnsZ22 As Label
Dim lblPlus As Label
Dim lblKurungan1 As Label
Dim lblKurungan2 As Label
Dim lblGarisan As Label

End Sub

Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("vz2")
ph.SetScreenOrientation(1)
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Sub CheckResult

z1 = editZ1.Text
z2 = editZ2.Text
vin = editVin.Text


lblCal.Text = "Vout = Z2 (Vin)" & CRLF & TAB & TAB & TAB & "________" & CRLF & TAB & TAB & TAB & "Z1 + Z2"

lblCal1.Text = "Vout ="
lblPlus.Text = "+"
lblKurungan1.Text = "("
lblKurungan2.Text = ")"
lblGarisan.Text = "_________"
lblAnsZ2.Text = z2
lblAnsZ22.Text = z2
lblAnsZ1.Text = z1
lblAnsVin.Text = vin
lblVout.Text = "Vout ="
lblResultVout.Text = (z1/(z1+z2))*vin

End Sub


Sub btnMain_Click
StartActivity(Main)
End Sub
Sub btnCal_Click
If btnCal.Text = "Calculate" Then
CheckResult
End If
End Sub


Question

1. How to i configure screen oriented only for portrait ~ Done
2. how to setting for all screen device
 
Last edited:
Upvote 0

Eric H

Active Member
Licensed User
Longtime User
Just change this:
#SupportedOrientations: unspecified

To this:
#SupportedOrientations: portrait


And change these:
#FullScreen: False
#IncludeTitle: True

To this:
#FullScreen: True
#IncludeTitle: False


This will remove the title, make your app full screen, and force portrait mode only.



You don't need to use ph.SetScreenOrientation(1) unless you want to change the orientation during the course of running the app.
 
Last edited:
Upvote 0

hdmiacc

Member
Licensed User
Longtime User
ok.. tq Eral..

after i uplode to UI Clould

For
1. Galaxy Tab 2 (10" tablet)
2. Nexus 7 (7" tablet)
refer to upload file


Galaxy Tab 2 (10 tablet).png
Nexus 7 (7 tablet).png


how to i overcome this.. i mean to fix the screen resolution... can u give any idea... this this my 2nd question..
 
Upvote 0

hdmiacc

Member
Licensed User
Longtime User
The UI cloud shows landscape mode even when it is set to set portrait only in code. If you set portrait only like I recommended, no user will ever see landscape mode on a real device

for my 1st question.. already answer.. tq
 
Upvote 0
Top