alex_lip
alex_lip8. Juni 2018 08:43

Пути для file Provider

В документации указаны варианты

<paths xmlns:android="http://schemas.android.com/apk/res/android">
    <files-path name="my_images" path="images/"/>
    ...
</paths>

The <paths> element must contain one or more of the following child elements:

<files-path name="name" path="path" />
Represents files in the files/ subdirectory of your app's internal storage area. This subdirectory is the same as the value returned by Context.getFilesDir() .
<cache-path name="name" path="path" />

Represents files in the cache subdirectory of your app's internal storage area. The root path of this subdirectory is the same as the value returned by getCacheDir() .
<external-path name="name" path="path" />
Represents files in the root of the external storage area. The root path of this subdirectory is the same as the value returned by Environment.getExternalStorageDirectory() .
<external-files-path name="name" path="path" />
Represents files in the root of your app's external storage area. The root path of this subdirectory is the same as the value returned by Context#getExternalFilesDir(String) Context.getExternalFilesDir(null) .
<external-cache-path name="name" path="path" />
Represents files in the root of your app's external cache area. The root path of this subdirectory is the same as the value returned by Context.getExternalCacheDir() .
<external-media-path name="name" path="path" />
Represents files in the root of your app's external media area. The root path of this subdirectory is the same as the value returned by the first result of Context.getExternalMediaDirs() .

Note: this directory is only available on API 21+ devices.


QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)  -  Это какой из них ?
Или нужен другой стандартный Qt путь?


Рекомендуємо хостинг TIMEWEB
Рекомендуємо хостинг TIMEWEB
Stabiles Hosting des sozialen Netzwerks EVILEG. Wir empfehlen VDS-Hosting für Django-Projekte.

Magst du es? In sozialen Netzwerken teilen!

3
Evgenii Legotckoi
  • 12. Juni 2018 02:52

Я так думаю, что лучше использовать из QStandardPaths::DataLocation или QStandardPaths::HomeLocation,

Обычно эти пути и использовал и нормально всё записывалось.
    alex_lip
    • 13. Juni 2018 03:14
    • (bearbeitet)
    • Die Antwort wurde als Lösung markiert.
    Вы правы -

    QStandardPaths::DataLocation

    дает

    QUrl("file:///data/user/0/org.adm.esd/files") + добавить свою папку

    а
     

    Context.getFilesDir()  -    /data/user/0/org.adm.esd/files + добавить свою папку

    Таким образом в fileprovider указываем

    external-files-path !!!

     

    <external-files-path name="name" path="path" />
      alex_lip
      • 13. Juni 2018 05:01
      не получилось - а написал
      <files-path name="my_files" path="temp_esd/" />

      - получилось. Вот и читай после этого документацию (((

        Kommentare

        Nur autorisierte Benutzer können Kommentare posten.
        Bitte Anmelden oder Registrieren
        Letzte Kommentare
        A
        ALO1ZE19. Oktober 2024 18:19
        Fb3-Dateileser auf Qt Creator Подскажите как это запустить? Я не шарю в программировании и кодинге. Скачал и установаил Qt, но куча ошибок выдается и не запустить. А очень надо fb3 переконвертировать в html
        ИМ
        Игорь Максимов5. Oktober 2024 17:51
        Django – Lektion 064. So schreiben Sie eine Python-Markdown-Erweiterung Приветствую Евгений! У меня вопрос. Можно ли вставлять свои классы в разметку редактора markdown? Допустим имея стандартную разметку: <ul> <li></li> <li></l…
        d
        dblas55. Juli 2024 21:02
        QML - Lektion 016. SQLite-Datenbank und das Arbeiten damit in QML Qt Здравствуйте, возникает такая проблема (я новичок): ApplicationWindow неизвестный элемент. (М300) для TextField и Button аналогично. Могу предположить, что из-за более новой верси…
        k
        kmssr9. Februar 2024 05:43
        Qt Linux - Lektion 001. Autorun Qt-Anwendung unter Linux как сделать автозапуск для флэтпака, который не даёт создавать файлы в ~/.config - вот это вопрос ))
        Qt WinAPI - Lektion 007. Arbeiten mit ICMP-Ping in Qt Без строки #include <QRegularExpressionValidator> в заголовочном файле не работает валидатор.
        Jetzt im Forum diskutieren
        J
        JacobFib17. Oktober 2024 13:27
        добавить qlineseries в функции Пользователь может получить любые разъяснения по интересующим вопросам, касающимся обработки его персональных данных, обратившись к Оператору с помощью электронной почты https://topdecorpro.ru…
        JW
        Jhon Wick2. Oktober 2024 01:52
        Indian Food Restaurant In Columbus OH| Layla’s Kitchen Indian Restaurant If you're looking for a truly authentic https://www.laylaskitchenrestaurantohio.com/ , Layla’s Kitchen Indian Restaurant is your go-to destination. Located at 6152 Cleveland Ave, Colu…
        КГ
        Кирилл Гусарев27. September 2024 19:09
        Не запускается программа на Qt: точка входа в процедуру не найдена в библиотеке DLL Написал программу на C++ Qt в Qt Creator, сбилдил Release с помощью MinGW 64-bit, бинарнику напихал dll-ки с помощью windeployqt.exe. При попытке запуска моей сбилженной программы выдаёт три оши…
        F
        Fynjy22. Juli 2024 14:15
        при создании qml проекта Kits есть но недоступны для выбора Поставил Qt Creator 11.0.2. Qt 6.4.3 При создании проекта Qml не могу выбрать Kits, они все недоступны, хотя настроены и при создании обычного Qt Widget приложения их можно выбрать. В чем может …

        Folgen Sie uns in sozialen Netzwerken