Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sdcard - points not saved #32

Closed
guidohaefliger opened this issue Apr 11, 2016 · 21 comments
Closed

sdcard - points not saved #32

guidohaefliger opened this issue Apr 11, 2016 · 21 comments

Comments

@guidohaefliger
Copy link

If the project and spatiallite db is on sdcard of smartphone, the points disappear after closing and ropening the project. There is no error message that points cannot be saved. The project/database on memory of smartphone is working fine

@m-kuhn
Copy link
Member

m-kuhn commented Apr 11, 2016

The same setup works here. Error reporting in the app certainly could need some love. Something we have experienced problems with in the past was if no autoincrementing primary key was present in the spatialite file.

@guidohaefliger
Copy link
Author

I did add an autoincrement key field to the spatiallitedb-layer. But its is the same behaviour, points are lost after closing/opening the project on sdcard

@m-kuhn
Copy link
Member

m-kuhn commented Apr 12, 2016

Can you attach the project and the database here (or send it to us by mail if it is not public)

@m-kuhn
Copy link
Member

m-kuhn commented Apr 13, 2016

Too bad we do not have an sdcard slot in our test device.

@guidohaefliger
Copy link
Author

OK, its not an urgent problem, we don't need project on sdcard for the moment, I can put project/data to device storage

@m-kuhn
Copy link
Member

m-kuhn commented Apr 19, 2016

Note to self, probably only requires this permission:

http://developer.android.com/reference/android/Manifest.permission.html#WRITE_EXTERNAL_STORAGE

@mbernasocchi
Copy link
Member

building to test

@mbernasocchi
Copy link
Member

as of 0.6.6 from playstore writing to external sd fails silently

@mbernasocchi
Copy link
Member

the same project on internal sd works as expected. My own builds crash when writing anywhere, I guess that is something else

@m-kuhn
Copy link
Member

m-kuhn commented Jul 7, 2016

The WRITE_EXTERNAL_STORAGE permission must only grant write access to the primary external storage on a device. Apps must not be allowed to write to secondary external storage devices, except in their package-specific directories as allowed by synthesized permissions. Restricting writes in this way ensures the system can clean up files when applications are uninstalled.

IIUC, all works needs to be done in /Android/data/ch.opengis.qfield/files

With Android 5 we get this extra intent ACTION_OPEN_DOCUMENT_TREE

@mbernasocchi
Copy link
Member

haha, I was going to post the same comment after noticing how ES file browser does things.

@mbernasocchi
Copy link
Member

Confirmed that putting projects and data on the external SD card in

/Android/data/ch.opengis.qfield/files

Works on my galaxy s7 edge android 6

@mbernasocchi
Copy link
Member

so currently QField supports reading data from any location on an an SD card but writing only works in the /Android/data/ch.opengis.qfield/files folder of the SDCard. No writing is possible yet in other folders (unless possibly if the device is rooted).

@m-kuhn
Copy link
Member

m-kuhn commented Jul 7, 2016

Thanks @mbernasocchi

I think we should (in the following order)

  1. document this
  2. add a warning when this happens
  3. offer to "unlock" the location with ACTION_OPEN_DOCUMENT_TREE in the warning

@ludodo
Copy link

ludodo commented Jul 22, 2016

Thank's for the redirection and the answer.
I moved my "SIG" directories data and project into /[sdcard2]/Android/data/ch.opengis.qfiel/files
No more warning when editing...
Attribut modification are well saved but when editing new geometries, they don't appear, with no log in qfield.

@m-kuhn
Copy link
Member

m-kuhn commented Jul 22, 2016

Does the layer's CRS match the project CRS?

@ludodo
Copy link

ludodo commented Jul 22, 2016

Humm not really, I've got WGS84 mbtiles with Lambert 93 (EPSG:2154) shapefiles. Project is in on the fly SCR. Qfield needs only one projection to work ?

@m-kuhn
Copy link
Member

m-kuhn commented Jul 22, 2016

Yes, I just documented the status in #58
We should fix that but meanwhile just keep your digitizing layers in the project CRS.

@m-kuhn
Copy link
Member

m-kuhn commented Jul 23, 2018

Interesting information https://bugreports.qt.io/browse/QTBUG-50759

@signedav
Copy link
Member

What is the status here @m-kuhn?

@m-kuhn
Copy link
Member

m-kuhn commented Nov 19, 2019

@marioba looked into it and adjusted the project loader dialog to be more explicit about where data is read only and where it's writable.

@signedav signedav removed the checked label Nov 19, 2019
@signedav signedav closed this as completed Dec 4, 2019
suricactus added a commit that referenced this issue Nov 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants