Author Topic: Is it possible to tell Aquamail where to save the majority of its data?  (Read 22609 times)

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12740
Re: Is it possible to tell Aquamail where to save the majority of its data?
« Reply #15 on: December 03, 2014, 08:40:04 pm »
Not sure what the SAF has to do with it... Can you elaborate?
Creating debug logs for diagnostics: https://www.aqua-mail.com/troubleshooting/

The official FAQ: https://www.aqua-mail.com/faq/

Лог-файлы для диагностики: https://www.aqua-mail.com/ru/troubleshooting/

Вопросы и ответы: https://www.aqua-mail.com/ru/faq/

pyler

  • Sr. Member
  • ****
  • Posts: 412
Re: Is it possible to tell Aquamail where to save the majority of its data?
« Reply #16 on: December 03, 2014, 09:12:16 pm »
To write outside app dir on external sd card. (ACTION_CREATE_DOCUMENT)
Do you want to use the latest AquaMail version?
Try AquaMail Updater!

Dmitry_N

  • Newbie
  • *
  • Posts: 24
Re: Is it possible to tell Aquamail where to save the majority of its data?
« Reply #17 on: December 03, 2014, 10:21:01 pm »
You can save attachment in any folder on ext sd card using SAF, no? This works on kitkat too
I can.
But this question is not about saving them manually. This is about the automatic "caching" stuff.

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12740
Re: Is it possible to tell Aquamail where to save the majority of its data?
« Reply #18 on: December 03, 2014, 10:36:04 pm »
>> ACTION_CREATE_DOCUMENT
>>
>> Activity Action: Allow the user to create a new document. When invoked, the system will display the various DocumentsProvider instances installed on the device, letting the user navigate through them.

I'm lost. It's just an abstraction (for making Google Drive, Gallery, Dropbox, etc look the same).

How does it help with saving attachments specifically on the "real" external memory card?

To be more specific. Existing code:

FileOutputStream ostream = new FileOutputStream(new File("/mnt/ext_sd/AquaMail Downloads", "foo.png"));

^^^ throws IOException (or SecurityException, I forget)

Let's say I replace it with SAF calls, prompting the user to create a new document and then saving there...

How would this document, picked through SAF, end up on the "real" external memory card?

Creating debug logs for diagnostics: https://www.aqua-mail.com/troubleshooting/

The official FAQ: https://www.aqua-mail.com/faq/

Лог-файлы для диагностики: https://www.aqua-mail.com/ru/troubleshooting/

Вопросы и ответы: https://www.aqua-mail.com/ru/faq/

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12740
Re: Is it possible to tell Aquamail where to save the majority of its data?
« Reply #19 on: December 03, 2014, 10:40:19 pm »
>> But this question is not about saving them manually. This is about the automatic "caching" stuff.

Димон, здаров! Сразу и не признал.

В общем так: программа хранит на устройстве некоторое "бОльшее" количество сообщений (по ум. 250), а "смотрит" на меньшее (по ум. 25). Так что если на сервере удаляется что-то в "хвосте" (за пределами этих 25), то программа не увидит этих удалений.

А вот по мере прихода новых сообщений, страые будут выходить за пределы "хранить сообщений" (по ум. 250) -- и при этом удаляться с устройства. На следующие сутки после этого, их вложения будут удалены.

Немного как сказка про Кащея, просто получается некоторая задержка.

Что можно еще сделать. Длинное нажатие на учетной записи -- доп. настройки и папки -- доп. настройки -- уменьшить "хранить сообщений" скажем до 100, и после этого в главном окне вызвать Меню / Сжать хранилище сообщений (этот процесс как раз происходит автоматом раз в сутки).
Creating debug logs for diagnostics: https://www.aqua-mail.com/troubleshooting/

The official FAQ: https://www.aqua-mail.com/faq/

Лог-файлы для диагностики: https://www.aqua-mail.com/ru/troubleshooting/

Вопросы и ответы: https://www.aqua-mail.com/ru/faq/

pyler

  • Sr. Member
  • ****
  • Posts: 412
Re: Is it possible to tell Aquamail where to save the majority of its data?
« Reply #20 on: December 03, 2014, 10:42:00 pm »
User decides where to save it.

After user "creates" file, you get uri to this file I think and you can write to it.
Do you want to use the latest AquaMail version?
Try AquaMail Updater!

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12740
Re: Is it possible to tell Aquamail where to save the majority of its data?
« Reply #21 on: December 03, 2014, 10:47:23 pm »
>> User decides where to save it.

The user can already decide where Aqua "saves" attachments.

>> After user "creates" file, you get uri to this file I think and you can write to it.

Is there any reason you think that the user will be able to choose / create a file on the "external" SD card and it'll work?

I just tried creating a file on "ext_sd" in Solid Explorer, it failed with "error, limitation of Android 4.4, install an app to fix your system permissions, you need to be rooted...". But we already knew that.

On a rooted device with a custom ROM, creating files on "external" SD works in Solid Explorer, and it also works in AquaMail.

Creating debug logs for diagnostics: https://www.aqua-mail.com/troubleshooting/

The official FAQ: https://www.aqua-mail.com/faq/

Лог-файлы для диагностики: https://www.aqua-mail.com/ru/troubleshooting/

Вопросы и ответы: https://www.aqua-mail.com/ru/faq/

pyler

  • Sr. Member
  • ****
  • Posts: 412
Re: Is it possible to tell Aquamail where to save the majority of its data?
« Reply #22 on: December 03, 2014, 11:28:29 pm »
SAF is system component, there are no limitations unlike 3rd party file managers.
Do you want to use the latest AquaMail version?
Try AquaMail Updater!

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12740
Re: Is it possible to tell Aquamail where to save the majority of its data?
« Reply #23 on: December 04, 2014, 02:22:00 pm »
SAF is a framework that provides a unified abstraction of actual storage back-ends.

It does not store data itself.

There is no built-in back-end that provides a view of the raw file system -- maybe because Android has been steadily moving away from "file system" view of the world to "document collections".

Other SAF back-ends are still third party apps, and would not be signed by system keys.

If I'm missing something and you can point me to something specific (e.g. "Kostya, you dumbass, just call this function and everything will magically work") -- it would be great.
Creating debug logs for diagnostics: https://www.aqua-mail.com/troubleshooting/

The official FAQ: https://www.aqua-mail.com/faq/

Лог-файлы для диагностики: https://www.aqua-mail.com/ru/troubleshooting/

Вопросы и ответы: https://www.aqua-mail.com/ru/faq/

pyler

  • Sr. Member
  • ****
  • Posts: 412
Re: Is it possible to tell Aquamail where to save the majority of its data?
« Reply #24 on: December 04, 2014, 05:28:04 pm »
On Lollipop user just pick "sd card" in SAF once and AquaMail can access all files on sd card (real one)
Do you want to use the latest AquaMail version?
Try AquaMail Updater!

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12740
Re: Is it possible to tell Aquamail where to save the majority of its data?
« Reply #25 on: December 04, 2014, 06:50:18 pm »
Pick when and where exactly? Access how, read or write?

Also:

5.0 has so far been released for: Nexus 4, 5, 6, 7, 9.

None of those devices has a "real" sd card.

I must be missing something, or just too dumb to understand.
Creating debug logs for diagnostics: https://www.aqua-mail.com/troubleshooting/

The official FAQ: https://www.aqua-mail.com/faq/

Лог-файлы для диагностики: https://www.aqua-mail.com/ru/troubleshooting/

Вопросы и ответы: https://www.aqua-mail.com/ru/faq/

pyler

  • Sr. Member
  • ****
  • Posts: 412
Re: Is it possible to tell Aquamail where to save the majority of its data?
« Reply #26 on: December 04, 2014, 07:13:34 pm »
If user chooses X directory via SAF, app grants access to this dir. Read and write.

G3 and S5 are getting Lollipop, so you can test it maybe.
Do you want to use the latest AquaMail version?
Try AquaMail Updater!

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12740
Re: Is it possible to tell Aquamail where to save the majority of its data?
« Reply #27 on: December 04, 2014, 09:32:18 pm »
>> user chooses X directory via SAF

I don't see a directory chooser in SAF if I go to add a new attachment (when composing a message) in Aqua.

And SAF's Unified Document Picker is what comes up then, since 4.4

>> G3 and S5 are getting Lollipop, so you can test it maybe

I have a G3, no 5.0 yet.
Creating debug logs for diagnostics: https://www.aqua-mail.com/troubleshooting/

The official FAQ: https://www.aqua-mail.com/faq/

Лог-файлы для диагностики: https://www.aqua-mail.com/ru/troubleshooting/

Вопросы и ответы: https://www.aqua-mail.com/ru/faq/

pyler

  • Sr. Member
  • ****
  • Posts: 412
Re: Is it possible to tell Aquamail where to save the majority of its data?
« Reply #28 on: December 04, 2014, 09:48:46 pm »
There is special intent to pick directory I think.
Do you want to use the latest AquaMail version?
Try AquaMail Updater!

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12740
Re: Is it possible to tell Aquamail where to save the majority of its data?
« Reply #29 on: December 04, 2014, 09:50:26 pm »
>> There is special intent to pick directory I think

Ah!

Ok, thanks, now I know what to try -- once my G3 actually gets 5.0.
Creating debug logs for diagnostics: https://www.aqua-mail.com/troubleshooting/

The official FAQ: https://www.aqua-mail.com/faq/

Лог-файлы для диагностики: https://www.aqua-mail.com/ru/troubleshooting/

Вопросы и ответы: https://www.aqua-mail.com/ru/faq/