imb.newButton(Panel1,bmp,Rnd(200,255),Rnd(0,255),Rnd(0,255),Rnd(0,255))
Sub Panel2_Click
imi.SosIntent("118")
End Sub
Sub Panel3_Click
imi.OpenFacebook
End Sub
Sub Panel4_Click
imi.OpenGmail
End Sub
Sub Panel5_Click
imi.SmsIntent("+393929824007")
End Sub
#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
Dim Timer1 As Timer
End Sub
Sub Globals
Dim sen As ClassMySensor
Dim Label1,Label2,Label3,Label4,Label5,Label6,Label7,Label8 As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Main")
sen.Initialize(Activity,FirstTime)
Timer1.Initialize("Timer1",10)
Timer1.Enabled = True
End Sub
Sub Activity_Resume
Timer1.Enabled = True
sen.act_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
Timer1.Enabled = False
sen.act_Pause(UserClosed)
End Sub
Sub Timer1_Tick
If sen.result.IsInitialized = True Then
Dim i As Int
i = sen.result.Size
If i > 0 Then
Label1.text = "ACCELEROMETER" & " " & sen.result.Get(0)
Label2.text = "GYROSCOPE" & " " & sen.result.Get(1)
Label3.text = "LIGHT" & " " & sen.result.Get(2)
Label4.text = "MAGNETIC" & " " & sen.result.Get(3)
Label5.text = "ORIENTATION" & " " & sen.result.Get(4)
Label6.text = "PRESSURE" & " " & sen.result.Get(5)
Label7.text = "PROXIMITY" & " " & sen.result.Get(6)
Label8.text = "TEMPERATURE" & " " & sen.result.Get(7)
End If
End If
End Sub
#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
Dim Timer1 As Timer
End Sub
Sub Globals
Dim sen As ClassMySensor
Dim Label1,Label2,Label3,Label4,Label5,Label6,Label7,Label8 As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Main")
sen.Initialize(Activity,FirstTime)
Timer1.Initialize("Timer1",10)
Timer1.Enabled = True
End Sub
Sub Activity_Resume
Timer1.Enabled = True
sen.act_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
Timer1.Enabled = False
sen.act_Pause(UserClosed)
End Sub
Sub Timer1_Tick
If sen.result.IsInitialized = True Then
Dim i As Int
i = sen.result.Size
If i > 0 Then
Label1.text = "ACCELEROMETER" & " " & sen.result.Get(0)
Label2.text = "GYROSCOPE" & " " & sen.result.Get(1)
Label3.text = "LIGHT" & " " & sen.result.Get(2)
Label4.text = "MAGNETIC" & " " & sen.result.Get(3)
Label5.text = "ORIENTATION" & " " & sen.result.Get(4)
Label6.text = "PRESSURE" & " " & sen.result.Get(5)
Label7.text = "PROXIMITY" & " " & sen.result.Get(6)
Label8.text = "TEMPERATURE" & " " & sen.result.Get(7)
End If
End If
End Sub
#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
Dim Timer1 As Timer
Dim imi As ClassMyBattery
End Sub
Sub Globals
Dim Button1 As Button
Dim EditText1 As EditText
Dim EditText2 As EditText
Dim EditText3 As EditText
Dim EditText4 As EditText
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Main")
imi.Initialize
Timer1.Initialize("Timer1",1000)
Timer1.Enabled = True
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Timer1_Tick
EditText1.Text = imi.BatteryLevel
EditText2.Text = imi.BatteryScale
EditText3.Text = imi.BatteryCharging
EditText4.Text = imi.BatteryIntent
End Sub
#Region Project Attributes
#ApplicationLabel: RoundedRectangles
#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
Dim cvsMain As Canvas
Dim Panel1 As Panel
Dim Panel2 As Panel
Dim Panel3 As Panel
Dim Panel4 As Panel
Dim Panel5 As Panel
Dim Panel6 As Panel
Dim Panel7 As Panel
Dim Panel8 As Panel
Dim Panel10 As Panel
Dim Panel11 As Panel
Dim Panel12 As Panel
Dim Panel9 As Panel
Dim Panel13 As Panel
Dim Panel14 As Panel
Dim Panel15 As Panel
Dim Panel16 As Panel
Dim imi As ClassMyButton
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Main")
imi.Initialize
imi.NewButton3(Panel1,"Android","Android.png",255,150,0,0,True,2,False)
imi.NewButton3(Panel2,"Iphone","Iphone.png",255,150,0,0,True,2,False)
imi.NewButton3(Panel3,"BlackBerry","Blackberry.png",255,150,0,0,True,2,False)
imi.NewButton3(Panel4,"Voice Search","VoiceSearch.png",255,150,0,0,True,2,False)
imi.NewButton3(Panel5,"Android","Android.png",255,150,0,0,False,2,False)
imi.NewButton3(Panel6,"Iphone","Iphone.png",255,150,0,0,False,2,False)
imi.NewButton3(Panel7,"BlackBerry","Blackberry.png",255,150,0,0,False,2,False)
imi.NewButton3(Panel8,"Voice Search","VoiceSearch.png",255,150,0,0,False,2,False)
imi.NewButton3(Panel9,"Android","Android.png",255,150,0,0,True,2,False)
imi.NewButton3(Panel10,"Iphone","Iphone.png",255,0,150,0,True,2,False)
imi.NewButton3(Panel11,"BlackBerry","Blackberry.png",255,0,0,150,True,2,False)
imi.NewButton3(Panel12,"Voice Search","VoiceSearch.png",255,150,150,0,True,2,False)
imi.NewButton3(Panel13,"Android","Android.png",255,150,0,0,True,1,False)
imi.NewButton3(Panel14,"Iphone","Iphone.png",255,150,0,0,True,1,False)
imi.NewButton3(Panel15,"BlackBerry","Blackberry.png",255,150,0,0,True,1,False)
imi.NewButton3(Panel16,"Voice Search","VoiceSearch.png",255,150,0,0,True,1,False)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
#Region Project Attributes
#ApplicationLabel: RoundedRectangles
#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
Dim cvsMain As Canvas
Dim Panel1 As Panel
Dim Panel2 As Panel
Dim Panel3 As Panel
Dim Panel4 As Panel
Dim Panel5 As Panel
Dim Panel6 As Panel
Dim imi As ClassMyButton
Dim iml As ClassMyLayout
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Main")
imi.Initialize
iml.Initialize
iml.SettingLayoutPanel(Activity,Panel5)
imi.NewButton4(Panel1,"Android","Android.png",255,79,129,186,True,1,False)
imi.NewButton4(Panel2,"Iphone","Iphone.png",255,79,129,186,True,1,False)
imi.NewButton4(Panel3,"BlackBerry","Blackberry.png",255,79,129,186,True,1,False)
imi.NewButton4(Panel4,"Voice Search","VoiceSearch.png",255,79,129,186,True,1,False)
imi.NewButton4(Panel6,"IMLibrary 1.01","",255,79,129,186,True,2,False)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
#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
End Sub
Sub Globals
Dim imi As ClassMyButton
Dim iml As ClassMyLayout
Dim Panel1, Panel2 As Panel
Dim Panel3 As Panel
Dim Panel4 As Panel
Dim Panel5 As Panel
Dim Panel6 As Panel
Dim Panel7 As Panel
Dim Panel8 As Panel
Dim Panel9 As Panel
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Main")
imi.Initialize
iml.Initialize
iml.SettingLayoutPanel(Activity,Panel1)
imi.NewButton4(Panel2,"","contact_close.png",255,255,0,0,False,1,False)
imi.NewButton4(Panel4,"Keypad","p01.png",255,255,255,255,False,1,False)
imi.NewButton4(Panel5,"Call Trasfer","p02.png",255,255,255,255,False,1,False)
imi.NewButton4(Panel6,"Mute","p03.png",255,255,255,255,False,1,False)
imi.NewButton4(Panel7,"Hold","p04.png",255,255,255,255,False,1,False)
imi.NewButton4(Panel8,"Speaker","p05.png",255,255,255,255,False,1,False)
imi.NewButton4(Panel9,"Call","p06.png",255,255,255,255,False,1,False)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
#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
Dim imi As ClassMyXml
Dim xlist() As List
End Sub
Sub Globals
Dim Button1 As Button
Dim ListView1 As ListView
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Main")
If FirstTime Then
Dim a,b,c,d As String
a = "http://www.ivanomonti.eu/C2013_IVANOMONTI/B4ALItalia.xml" ' percorso file xml nella rete
b = "/B4ALitalia" ' nome folder interna da creare
c = "B4ALitalia.xml" ' nome del file xml da creare
d = "Category,Denominazione,Indirizzo,CAP,Comune,lat,lon,google,Telefono,Email,Url,Note,Extra1,Extra2,Extra3" ' nomi dei nodi xml da filtrare
imi.Initialize(a,b,c,d)
End If
End Sub
Sub Activity_Resume
LoadRecordXml
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Public Sub LoadRecordXml
For i=0 To imi.ls(0).Size-1
ListView1.AddSingleLine(imi.ls(0).Get(i))
Next
End Sub
Sub Button1_Click
LoadRecordXml
End Sub
IMLibrary 1.02 aggiunge anche XML
Nuova aggiunta per chi di xml ne ha scatole piene, ecco come prelevare file xml e salvarlo nel proprio dispositivo usando solo 2 righe di codice... la classe e dinamica, pertanto potete inserire i nomi dei nodi da filtrare.
l
End Sub[/CODE]
java.lang.Exception: Sub CREATE was not found.
di sicuro mi sfugge qualcosa.
con quale versione android SDK/API funziona?
Ciao Ivano, l'esempio xml mi restituisce questo errore
B4X:java.lang.Exception: Sub CREATE was not found.
Questo solo col rapid debug, con il legacy debug funziona
... quindi dovrei risolvere anche io.Si ovviamente ricordatevi di avere gli accessi di scrittura perchè la classe crea una folder e un documento xml nel dispositivo, ho mettere i permessi di scrittura nel manifest... ho dato per scontato questa info. il debug veloce non l'ho ancora usato perchè ha me da problemi con emulatore, aspetto la versione final.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?