Hi friends.
I need some tips on how to solve the problem below.
My server generates a text file with 6,000 products already formatted in sql
example:
This file has 4800 lines with size: 735 KB
In android I am using the following code to read the file and saves it in the database.
'Reading File Text
'Post in database
In android I am using the following code to read the file and saves it in the bank.
This procedure is working but I can not put a progressbar to inform the User that the screen freezes.
Could someone give some tips on how to show progress to the user?
If using as a service is correct?
I appreciate any response.
thank you
I need some tips on how to solve the problem below.
My server generates a text file with 6,000 products already formatted in sql
example:
PHP:
insert into [DB_PRODUTOS] values (6685, '000004 ', '7897374400047', 'ALUMINIOS MARANA', 'METALS', 'ROUND pan # 35', 'PC', 14.04000, .00000, .00000,2,'' , 0, 'N', '9 ')
insert into [DB_PRODUTOS] values (6680, '000005 ', '7897374400054', 'ALUMINIOS MARANA', 'METALS', 'pan RECTANGULAR LOW N. 02', 'PC', 8.54000, .00000, .00000,2 '', 0,' N ', '5')
i ......
In android I am using the following code to read the file and saves it in the database.
'Reading File Text
PHP:
Sub ReadTextReader
Dim sdRoot As String
Dim TextReader1 As TextReader
sdRoot = File.DirDefaultExternal & "/"
TextReader1.Initialize(File.OpenInput(sdRoot , "produtos.txt"))
Dim line As String
line = TextReader1.ReadLine
Do While line <> Null
Log(line) 'write the line to LogCat
'Post in database
DB_PRODUTOS_EXECUTE(line)
line = TextReader1.ReadLine
Loop
TextReader1.Close
End Sub
'Post in database
PHP:
Sub DB_PRODUTOS_EXECUTE(str_sql As String)As String
BancodeDados.SQL.BeginTransaction
Try
BancodeDados.SQL.ExecNonQuery(str_sql)
BancodeDados.SQL.TransactionSuccessful
Catch
Msgbox("Error: DB_PRODUTOS_EXECUTE. Erro: "&LastException,"Error")
Log("Error: DB_PRODUTOS_EXECUTE. Error: "&LastException)
End Try
BancodeDados.SQL.EndTransaction
End Sub
In android I am using the following code to read the file and saves it in the bank.
This procedure is working but I can not put a progressbar to inform the User that the screen freezes.
Could someone give some tips on how to show progress to the user?
If using as a service is correct?
I appreciate any response.
thank you