I want create a row into my Firebase database: code is:
This is Firebase database:
My rules is:
now calculate count manually.
Is there a way for create automatic index?
Thanks in advance
B4X:
Sub insert_voce
Dim mData As Map
mData.Initialize
Dim s As String
S=EditText1.Text
EditText1.Text=S.Substring2(0,1).ToUppercase & S.SubString(1)
mData.Put("nome", EditText1.Text)
count=count+1
Dim JSONGenerator As JSONGenerator
JSONGenerator.Initialize(mData)
Dim JSONstring As String
JSONstring = JSONGenerator.ToPrettyString(0)
Dim req As OkHttpRequest
req.InitializePut2(Main.strPath3 & "Medici/" & count & ".json" , JSONstring.GetBytes("UTF8"))
req.SetContentType("application/json")
Dim exec As OkHttpClient
exec.Initialize("b")
exec.Execute(req, "1")
End Sub
This is Firebase database:
My rules is:
now calculate count manually.
Is there a way for create automatic index?
Thanks in advance