#Region Project Attributes
#ApplicationLabel: KVS Example
#VersionCode: 1
#VersionName: 1
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#BridgeLogger: True
#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.
Public kvs As KeyValueStore
Private Stringexample(10,3) As String
Private listExample As List
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.
Private Button1 As Button
Private Label1 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("Layout1")
Activity.LoadLayout("Main")
If FirstTime Then
listExample.Initialize
listExample.InsertAt(0,0)
If File.Exists(File.DirInternal, "datastore") Then
kvs.Initialize(File.DirInternal, "datastore")
Else
For AA = 0 To 9 'Write "Strings" in to Stringexample
For BB = 0 To 2
Stringexample(AA,BB) = " "
Next
Next
kvs.Initialize(File.DirInternal, "datastore")
kvs.Put("Stringexample", Stringexample)
kvs.Put("listExample", listExample)
End If
Stringexample = kvs.Get("Stringexample") 'Error occurred on line: 50 (Main)
listExample = kvs.Get("listExample")
End If
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
kvs.Put("Stringexample", Stringexample)
kvs.Put("listExample", listExample)
End Sub
Sub Button1_Click
listExample.Add(Rnd(10,20))
Label1.Text = Rnd(0,100)
End Sub