Please help i have a small database where i peak the person's name and then i send the message please help can i create a simple layout like that of whatsup were i can select from the listed names and then i send the message and at the same time view the received response.
the problem with my current layout is i have to click on sendsms to see what i has been sent and also click on received to see recieved . yet i would want to view the entire conversation in a good layout please help me out thanks
the code below reads the received messages from the table
the code below shows sent messages
the problem with my current layout is i have to click on sendsms to see what i has been sent and also click on received to see recieved . yet i would want to view the entire conversation in a good layout please help me out thanks
the code below reads the received messages from the table
B4X:
Sub ShowTable2
B4XTable1.Clear
B4XTable1.AddColumn("DateRecieved", B4XTable1.COLUMN_TYPE_TEXT)
B4XTable1.AddColumn("Sms", B4XTable1.COLUMN_TYPE_TEXT)
'B4XTable1.AddColumn("ID", B4XTable1.COLUMN_TYPE_TEXT)
data.Initialize
Dim rs As ResultSet = Starter.SQL1.ExecQuery("SELECT DISTINCT Daterecieved,Sms as RecievedMessage,ID FROM Recievedsms")
Do While rs.NextRow
Dim row(2) As Object
row(0) = rs.Getstring("Daterecieved")
row(1) = rs.GetString("RecievedMessage")
'& " " & rs.GetString("LastName")
' row(2) = rs.GetString("ID")
'Some of the fields are Null. We need to convert them to empty strings:
'If row(2) = Null Then row(2) = ""
'row(3) = rs.GetString("RecievedMessage")
data.Add(row)
Loop
rs.Close
B4XTable1.SetData(data)
End Sub
the code below shows sent messages
B4X:
Sub ShowTable
If lblSelectedItem.Text="Send" Then
'B4XTable1.Refresh
B4XTable1.Clear
B4XTable1.AddColumn("Datesent", B4XTable1.COLUMN_TYPE_TEXT)
B4XTable1.AddColumn("SentMessage", B4XTable1.COLUMN_TYPE_TEXT)
' B4XTable1.AddColumn("ID", B4XTable1.COLUMN_TYPE_TEXT)
data.Initialize
Dim rs As ResultSet = Starter.SQL1.ExecQuery("SELECT DISTINCT Datesent,Sms as SentMessage,ID FROM Sentmessages")
Do While rs.NextRow
Dim row(2) As Object
row(0) = rs.GetString("Datesent")
row(1) = rs.GetString("SentMessage")
'row(2) = rs.GetString("ID")
Log(row(1))
'Log(row(3))
'Log(row(2))
'& " " & rs.GetString("LastName")
'row(2) = rs.GetString("ID")
'Some of the fields are Null. We need to convert them to empty strings:
' If row(1) = "Null" And row(2) = "Null" Then
'Return
'Else
' If row(1) = "Null" Then row(2) = "Null"
'row(1) = rs.GetString("SentMessage")
data.Add(row)
'End If
Loop
rs.Close
B4XTable1.SetData(data)
B4XTable1.Refresh
Return
Attachments
Last edited: