some questions

Cor

Active Member
Licensed User
Longtime User
Hello Erel,

first thanks for basic4android , it looks promising

some questions:

1. why not using integer instead of int
Dim startNummerHoogte As Integer

2. how to define the following
Dim Type(IDID, trajectnr, landmeter) lezing

3. will there a an apppath command
databaseFile = AppPath & "\Project.sqlite"

now is use
databaseFile = File.DirInternal & "\Waterpassing" & "\Project.sqlite"

thanks

Cor de Visser
My 60's-80's band
Time Machine, een band die u terug brengt naar de sixties, seventies en eighties
YouTube - Time Machine - Long train running
 

Cor

Active Member
Licensed User
Longtime User

Erel

B4X founder
Staff member
Licensed User
Longtime User
1. why not using integer instead of int
Dim startNummerHoogte As Integer

2. how to define the following
Dim Type(IDID, trajectnr, landmeter) lezing

3. will there a an apppath command
databaseFile = AppPath & "\Project.sqlite"
1. It could have been Integer instead of Int. Eventually I preferred Int as it is shorter and it matches the Java Int type (all types match their Java types).
2.
B4X:
Sub Globals
 Type lezingType (IDID As String, trajectnr As String, ..)
 Dim lezing As lezingType
 Dim lezing2 As lezingType
3. There are several folders related to any application. They are all available with the File object.

These are good suggestions. Not sure what will make it to version 1.0 though.

See this tutorial for a tip about suggestion #1: http://www.b4x.com/forum/basic4android-getting-started-tutorials/6546-ide-tips-new-post.html
 

Cor

Active Member
Licensed User
Longtime User
layout question

I startup with a flash layout, there is a button on it

when i click i want to load the second layout
which works, only the first layout is also shown

What is the best way to handle this?

switch between layouts?


Sub Activity_Create(FirstTime As Boolean)
activity.LoadLayout("frmSplash")
activity.Title="TB-Waterpassing Version 1.6"
End Sub


Sub butOK_Click
activity.LoadLayout("frmHoofdMenu")
End Sub

gr
Cor
 

derez

Expert
Licensed User
Longtime User
I checked this issue yesterday and found "StartActivity(<module name>)", going back from that activity to the main is done by Activity.Finish .
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
It is possible to load several layout files. However the previous loaded views will not be removed.
There are several things you can do. First you can create another activity and then switch to the second activity (with StartActivity keyword).
You can also do something like:
B4X:
Sub Globals
    Dim pnlSplash As Panel
End Sub

Sub Activity_Create(FirstTime As Boolean)
    pnlSplash.Initialize("")
    Activity.AddView(pnlSplash, 0, 0, 100%x, 100%y)
    pnlSplash.LoadLayout("frmSplash") 'load the layout to the panel
End Sub


Sub Button1_Click
    pnlSplash.Visible = False
    Activity.LoadLayout("frmHoofdMenu")
End Sub
 
Top