adriano.freitas
Active Member
Helo! I'm starting programming with B4A. When my first app runs, it checks if the database exists. If it doesn't exist, create it. If there is, use it. Everything works, however, when the database does not exist and he has to create a new one, the mobile application generates a message that says:
"This app was created for an older version of Android and may not work properly..."
After creating the file, I can run the app several times that doesn't happen.
Would someone know/could help me?
I put below the code that starts the base and the manifest.
Thank you very much!
P.S.: My original language is Portuguese, but I think I can understand the code.
The code that starts the base:
The Manifest code:
"This app was created for an older version of Android and may not work properly..."
After creating the file, I can run the app several times that doesn't happen.
Would someone know/could help me?
I put below the code that starts the base and the manifest.
Thank you very much!
P.S.: My original language is Portuguese, but I think I can understand the code.
The code that starts the base:
The code that starts the database.:
Sub CriaBaseDeDados()
Private Query As String
If File.Exists(File.DirInternal, "treebase.db") = False Then
SQLTreeBase.Initialize(File.DirInternal, "treebase.db", True) ' I have SQLTreeBase as a Global variable
Query = "CREATE TABLE arvore (Codigo INTEGER PRIMARY KEY AUTOINCREMENT, Status TEXT, Pai INTEGER, Estrutura TEXT, Ordem INTEGER, Titulo TEXT, Conteudo TEXT)"
SQLTreeBase.ExecNonQuery(Query)
'
' Insert some test data
'
Query = "INSERT INTO arvore (Status, Pai, Estrutura, Ordem, Titulo, Conteudo) VALUES (?, ?, ?, ?, ?, ?)"
SQLTreeBase.ExecNonQuery2(Query, Array As Object("F",0,"*0*", 1, "Teste 1", "Texto Exemplo 1"))
SQLTreeBase.ExecNonQuery2(Query, Array As Object("A",0,"*0*", 2, "Teste 2", "Texto Exemplo 2"))
SQLTreeBase.ExecNonQuery2(Query, Array As Object("A",2,"*0*2*", 1, "Teste 2.1", "Texto Exemplo 2.1"))
SQLTreeBase.ExecNonQuery2(Query, Array As Object("F",2,"*0*2*", 2, "Teste 2.2", "Texto Exemplo 2.2"))
SQLTreeBase.ExecNonQuery2(Query, Array As Object("F",0,"*0*", 3, "Teste 3", "Texto Exempo 3"))
SQLTreeBase.ExecNonQuery2(Query, Array As Object("F",3,"*0*2*3*", 1, "Teste 2.1.1", "Texto Exemplo 2.1.1"))
Else
SQLTreeBase.Initialize(File.DirInternal, "treebase.db", True)
End If
End Sub
The Manifest code:
The Manifest Code:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="14" />
<supports-screens android:largeScreens="true"
android:targetSdkVersion="29"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
'End of default text.