Mintoris Forum

Author Topic: Overwriting Data Files on Update  (Read 4479 times)

hoyoyo80

  • Full Member
  • ***
  • Posts: 66
Overwriting Data Files on Update
« on: Apr 23, 2016, 09:12 AM »
Thanks

Can i add something? How can i update certain data files and exclude unwanted files. Since my default apk contain default sqlite db and my staff might have their own added data to the database that later on will be replace by updated apk. Can i choose to exclude the db?
Thanks

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Overwriting Data Files on Update
« Reply #1 on: Apr 23, 2016, 10:04 AM »
Once your default.db is installed, never modify it. Instead copy it to a new file and use the copy as your initial database. That way your default.db can change at any time, but the default.db file is only used when you want to create a new database.

hoyoyo80

  • Full Member
  • ***
  • Posts: 66
Overwriting Data Files on Update
« Reply #2 on: Apr 25, 2016, 04:40 AM »
Hrm‥ again chuck?

Let say i have two files in my data files,sqlite.db and entry.html, i compile than export it as zip and then using android studio to create apk.
Let say my staff use my app and started to collect datas and request for change of UI in entry.html, so i altered the entry.html but now how can i update their apps without changing their sqlite.db that already have the data and update only the entry.html.

Thanks Chucks

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Overwriting Data Files on Update
« Reply #3 on: Apr 25, 2016, 04:54 AM »
In your new updated app change the name of the sqlite.db to something like install.db.

Then in your program at the start say:


if isFile("install.db") then
  if not isFile("sqlite.db") then
    copy "install.db", "sqlite.db"
  endif
  delete "install.db"
endif


The file will only be copied if it does not exist.

hoyoyo80

  • Full Member
  • ***
  • Posts: 66
Overwriting Data Files on Update
« Reply #4 on: Apr 26, 2016, 07:27 AM »
Thanks Chuck‥that solved it  ;D

WarnerRut

  • Newbie
  • *
  • Posts: 1
Overwriting Data Files on Update
« Reply #5 on: Dec 24, 2018, 07:26 PM »
Can I use the ANT capability of my Powertap G3 to provide data for the app or TTS4 instead of the turbo?  I have an old Vortex which is not ANT compliant, so want to use my G3 for power data, alongside my Garmin HRM and cadence pick up.
Thanks.

Evelynwed

  • Full Member
  • ***
  • Posts: 26
Overwriting Data Files on Update
« Reply #6 on: Oct 18, 2019, 06:14 AM »
Youd be better off not moving the recordings, as any subsequent recordings files should get a _00n file name suffix when started.

I think that if youre renaming the recordings via the Media player, then youre only changing the recording name in the .meta file not the underlying file name.

VerdaFum

  • Full Member
  • ***
  • Posts: 11
Overwriting Data Files on Update
« Reply #7 on: Oct 18, 2019, 06:55 AM »
And to add to the clarification as it seems to have been lost, the use of short names is a major part of this being a problem. If the standard long names are used it would be really unlikely that 2 recordings would have the same file name.