Android Merket

devjet

Member
Licensed User
Longtime User
I laetly talked to a Eclipse programer. He is working on one of my project using Eclipse. The project has several data tables. Every time he send me a update I need to deinstall the app and install new version. By removing old app I loose all entered data. He claims that only update via Android market will allow to retain my data.
This seems very strange to me, perhaps someone can shed some light on this and if it is true, is that also the case for B4A applications?

In addition I have to say, that the Database is quite big holds some 100000 records and is downloaded from a virtual server as soon as app is installed.

Thanks for any info on this
 

devjet

Member
Licensed User
Longtime User
Hi Erel
thanks for your reply! So far I have not placed any DB based application on the market. I have just talked to a Eclipse programer and he said, that one can only update a database application if it is updated via Google Market.If that was true then I could not distribute any database application outside of Android Marke.
If you have any other info on this would be highly appreciate.
Thanks and regards!
 

timo

Active Member
Licensed User
Longtime User
I don't know about eclipse, but I have a non market b4a app based on a sqlite db. I've made an update with no problem (keeps old data). The only problem I could see is if you change the db structure within the updtate; that's why I allways add a field (in each table)named 'version'. The program doesn't use it: I only use it when I know that something has to be changed in a particular table: the new updated app will read this field and act consequently.
I'm also interested to know if there are other potential problems (that I don't see/have at the moment).
 

timo

Active Member
Licensed User
Longtime User
an example (here simplified):
B4X:
Sub Verif_Update_Scala
'(for when and if law will change params of this static table)
Dim VersioneEsistente As Int
'verif wich scala is in the DB:
Dim Cursor As Cursor
   Dim NumRows As Int
   
      Cursor = SQL1.ExecQuery("SELECT * FROM scala")
   
   NumRows=Cursor.RowCount
          If NumRows > 0 Then
                  Cursor.Position = 5 '(one of the 40 rec)
               VersioneEsistente=Cursor.GetInt("versione")
                  'Log(VersioneEsistente)         
                           End If
Cursor.Close



If VersioneEsistente < 2014 Then 'or what it will be
   'update(La 1.ma versione è la 2012):

   Dim ver As Int          : ver         = 2015    
   Dim Nuova_2534 As Int    : Nuova_2534    = 426      

   Dim i As Int


   For i = 0 To NumRows-1
      SQL1.ExecNonQuery("UPDATE scala SET versione="& ver &",perc="& Nuova_2534 )
   Next

   'Log("DB updated")
            
End If
   'Log("DB doesn't need to be updated")

End Sub
 
Last edited:
Top