QField icon indicating copy to clipboard operation
QField copied to clipboard

Support shipping pg_service.conf as project sidecar

Open donbowman opened this issue 8 months ago • 2 comments

What is the bug or the crash? What were your expectations and what actually happened?

Looking through the source code, this is expected in /storage/emulated/0/Android/data/ch.opengis.qfield/files/QField Documents/QField/pg_service.conf

However, a few challenges:

  • this is no longer accessible other than via the qfield app itself due to changes in Android a few years ago
  • the qfield app file exporer does not allow upload the pg_service file
  • this doesn't handle a separate pg_service file per project

it would be nice if i could upload a zip file with the project + service file together, and have teh QField app put it in the right spot.

Am i missing something? It seems this feature can't be used.

Steps to reproduce the issue

  1. tried with Files Manager: directory unaccessible
  2. tried with QField file browser, cannot upload files directly.

Version

3.5.4

Operating system name

Android

Operating system version

14

Reinstall QField

  • [x] I have a fresh install of the latest QField version, but the problem persists.
  • [x] Problem can be reliably reproduced, doesn't happen randomly.
  • [x] Problem happens with all files and projects, not only some files or projects.

Additional context

No response

donbowman avatar Apr 11 '25 18:04 donbowman

i have confirmed that if i upload a zip file of a project + the pg_service.conf, both are unpacked together.in /storage/emulated/0/Android/data/ch.opengis.qfield/files/Imported Projects/foo, but, it looks for this file solely in /storage/emulated/0/Android/data/ch.opengis.qfield/files/QField/pg_service.conf.backup

IMHO the simplest solution would be to make it look in the same dir as project file.

donbowman avatar Apr 11 '25 18:04 donbowman

i understand how to use it, but the only way to put it in place is to enable developer mode and use adb. The reason is, the directory is no longer writeable except by qfield, and, qfield won't write in the directory.

My suggestion is to have it look in the same dir as the project file since qfield already has a method of putting the file there (upload zip containing project + service).

donbowman avatar Apr 12 '25 18:04 donbowman