Genexus 15 SD - Problem when updating database Offline in Android

1

We have an Android application (available on Play Store) which was built by Genexus Evolution 3 (Evo3). We have now migrated that application to Genexus15 (GX15) successfully.

The drawback is that when the application is updated from the version made with Evo 3 to the version made with GX 15 it seems that the base is not rebuilt correctly. The update is done correctly, but when wanting to open the application it "crashes" because you want to query a non-existent table (the typical "No such table" error). NOTE: When you delete data from the application, it works. But we do not want such behavior with our end user.

It should be noted:

  • In the middle of the migration from Evo3 to GX15, new tables were created in both Evo 3 and GX15.
  • We have tried to do Rebuild, Create Offline Database, create new Tables, among others.
  • Another important point to emphasize is that the database does have some tables created, but apparently the tables created between the version of the Play Store (made with Evo3) until the new version (made with GX15) are not created correctly .

Is there any way to force the database to be rebuilt in this new version (in theory you must rebuild all the tables automatically but you do not)? We also verify that if the "OnCreate" of the DatabaseHelper is executed (from the FlexibleClient) but it does not seem to want to create the new tables in the update of the application.

We are waiting for any help available.

    
asked by Peter Arcentales 16.03.2018 в 15:27
source

1 answer

1

The creation of the offline DB on the device occurs when the DB structure of the application changes.

In particular in the Flexible Client it is verified that the hash of the previous DB structure is different from the new one and is the same application.

For what you comment, all this is so in this case. Since there were changes in the BD (between Ev3 and v15) and the application is the same as you are updating in the Play Store.

Either way, one of these things may be happening:

It is likely that one of the 2 applications has not generated the md5 correctly or that it does not recognize them as the same app, the md5 of the previous version is saved in the internal preferences of the app that depend on the name of the main.

If you have the previous version and the current version available. It would be good to compare the MainApplication .java files of each located in:

{main} \ src \ main \ java {package} \ MainApplication.java

These files must have the 2 md5 generator in the setReorMD5Hash () method and must be different. In addition, the identifier of the app must match, that is, the setName () and setAppEntry () methods must receive the same parameter.

If all the above is correct, you can also turn on the Log Level = Debug in the main properties of the app and see what happens when you start when you should do the create database.

Note : You can force the create offline database with the resetOfflineDatabase () method, but it's not the idea. This creation must be done automatically in an update of the app.

I await your comments. Greetings.

    
answered by 16.03.2018 / 22:14
source