I want my app to update automatically so I place a text file name "version.txt" on my server with this content:
Here my code to check update:
It works if the file is ANSI but I need it show Unicode characters so I saved version.txt in Unicode => It do not work anymore. How can I fix this? Please help. Thank you so much.
B4X:
8|Updátè new fuctión.
Here my code to check update:
B4X:
Sub Globals
Dim currentversion As Int : currentversion = 7
End Sub
Sub AutoUpdate
Dim request As HttpRequest
request.InitializeGet("http://www.mywebsite.com/version.txt")
request.Timeout = 8000
httpClient.Execute(request, 1)
End Sub
Sub http_ResponseSuccess (Response As HttpResponse, TaskId As Int)
If TaskId = 1 Then
Dim result, news, ver As String
Dim break As Int
result = Response.GetString("UTF8")
break = result.IndexOf("|")
ver = result.SubString2(0, break)
news = result.SubString(break+1)
If ver > currentversion Then
'Sub to update
End If
End If
End Sub
It works if the file is ANSI but I need it show Unicode characters so I saved version.txt in Unicode => It do not work anymore. How can I fix this? Please help. Thank you so much.