Environment
locus-api-core / locus-api-android 0.9.72
- Target device: Samsung, Android 13
- 3rd-party add-on attaches images to points via
GeoDataHelperKt.addAttachmentPhoto(point, uri, label) before sending through ActionDisplayPoints.sendPacks(...)
Expected
When the user taps a point on the map, Locus opens a small info popup. If the point has attached photos, the first one should appear as the preview image inside that popup.
What we observed
Depending on the URI string passed to addAttachmentPhoto, the preview never appears correctly — three failure modes:
| URI we pass |
Preview image in popup |
Raw absolute path /storage/emulated/0/Download/myApp/images/foo.jpg |
not recognized as image; shown as generic file in attachment list |
file:///storage/emulated/0/Download/myApp/images/foo.jpg |
"!" warning icon where the image should be |
content://<our FileProvider>/…/foo.jpg with grantUriPermission(...) to the Locus package |
"!" warning icon |
Files are written to public Download/myApp/images/ via MediaStore.Downloads (Android 10+) or FileOutputStream on older devices. App has MANAGE_EXTERNAL_STORAGE declared but not granted.
Question
What URI format is addAttachmentPhoto designed to consume so Locus can render the image in the point info popup?
- Is
file:// still supported on Android 10+ / under scoped storage?
- For
content:// from an add-on's FileProvider, is a per-display grantUriPermission(...) sufficient, or does Locus need the provider exported="true" (because internal image loaders run in a context the grant doesn't cover)?
- Are remote
https:// URLs accepted, or must the add-on localize the image first?
A short contract note near addAttachmentPhoto in GeoDataHelper.kt — or a snippet in the sample — would be very helpful. Happy to contribute a PR once the expected format is clear.
Related
GeoDataHelper.addAttachmentPhoto — locus-api-core/.../GeoDataHelper.kt#L376
Environment
locus-api-core/locus-api-android0.9.72GeoDataHelperKt.addAttachmentPhoto(point, uri, label)before sending throughActionDisplayPoints.sendPacks(...)Expected
When the user taps a point on the map, Locus opens a small info popup. If the point has attached photos, the first one should appear as the preview image inside that popup.
What we observed
Depending on the URI string passed to
addAttachmentPhoto, the preview never appears correctly — three failure modes:/storage/emulated/0/Download/myApp/images/foo.jpgfile:///storage/emulated/0/Download/myApp/images/foo.jpgcontent://<our FileProvider>/…/foo.jpgwithgrantUriPermission(...)to the Locus packageFiles are written to public
Download/myApp/images/viaMediaStore.Downloads(Android 10+) orFileOutputStreamon older devices. App hasMANAGE_EXTERNAL_STORAGEdeclared but not granted.Question
What URI format is
addAttachmentPhotodesigned to consume so Locus can render the image in the point info popup?file://still supported on Android 10+ / under scoped storage?content://from an add-on'sFileProvider, is a per-displaygrantUriPermission(...)sufficient, or does Locus need the providerexported="true"(because internal image loaders run in a context the grant doesn't cover)?https://URLs accepted, or must the add-on localize the image first?A short contract note near
addAttachmentPhotoinGeoDataHelper.kt— or a snippet in the sample — would be very helpful. Happy to contribute a PR once the expected format is clear.Related
GeoDataHelper.addAttachmentPhoto— locus-api-core/.../GeoDataHelper.kt#L376