Android Question MSMariaDB/MSMySQL upload blob (audio in example) to db ?

Magma

Well-Known Member
Licensed User
Longtime User
Hi there...

i want just upload audio / blob to my db... (using MSMariaDB library)

Must convert bytes to string ? and how ?
Or easily can upload blob.. someway ?

example using audio library..

B4X:
Sub Process_Globals
   Dim astream As AudioStreamer
   Dim myaudio As List   
   Dim nowrecord As Boolean
end sub

Sub Button1_Click

If nowrecord=False Then
    Button1.textColor=Colors.red
    nowrecord=True
    Log("recording")
    myaudio.clear
    astream.StartRecording
Else
    astream.StopRecording
'    Log("playing")
'    astream.StartPlaying 'This is for playing :)
'   For Each b() As Byte In myaudio
'      astream.Write(b)
'   Next
'    astream.Write(Null)
'write to db

'HOW ?
....................

    nowrecord=False
    Button1.textColor=Colors.Green
End If   
End Sub
 

KMatle

Expert
Licensed User
Longtime User
Upvote 0

Magma

Well-Known Member
Licensed User
Longtime User
@KMatle when u saying - get bigger... how ?

So then after converting to string just making the statement of INSERT and using it like a simple string...

B4X:
  db.ExecuteASync("INSERT INTO audiofilestable SET audiofile='" & audiostring & "' ;","")

audiofile field will be a LONGTEXT ?
 
Upvote 0
Top