moneymanagerex / android-money-manager-ex

Manage your finances on-the-go, encrypted for security, sync via your own cloud
http://android.moneymanagerex.org/
GNU General Public License v3.0
476 stars 186 forks source link

database file will be needed twice #1521

Closed Flexmaen closed 7 months ago

Flexmaen commented 7 months ago

Describe the bug I either created a new database file in the documents folder or copied it from the PC version there. So the folder of the *.mmb will be //storage/emulated/0/Documents/file.mmb It seems that Money Manager Ex will always copy it to /storage/emulated/0/Android/data/com.money.manager.ex/files/databases/file.mmb afterwards.

So if I sync the file in the documents folder (which I do with MyPhoneExplorer), there won't be any changes since MME is using the data-folder which cannot be accessed by MyPhoneExplorer. If I delete the mms file of the documents-folder since it obviously isn't used, MME will crash on start without any message. Isn't this odd?

To Reproduce Steps to reproduce the behavior:

  1. start with a fresh installed MME
  2. create a new database in your documents folder
  3. chack the database folder and it will be the data folder instead of documents
  4. delete the file of the documents folder => MME will crash on start
  5. or keep the file of the document folder and delete the file of the data folder => MME will ask you to create or open a database

Expected behavior The database file should stay in the folder where you opened or created it.

Device Information:

guanlisheng commented 7 months ago

hi @Flexmaen, please refer to its arch to understand more, and this is to comply Android ecosystem. https://forum.moneymanagerex.org/viewtopic.php?p=24565#p24565

i just updated the label to invalid from bug.

Flexmaen commented 7 months ago

@guanlisheng Please forget the whole sync thing I mentioned, maybe this diverted from the real questions: The point is: Does Money Manager Ex really need the mms-file two times on your local Android phone? Does that make sense? Is it an expected behaviour that the app crashes when you remove the import file?

Isn't this a bug if the app crashes without any comment? And also if the folder of your mms-file changes.

guanlisheng commented 7 months ago

again, the dup impl is to comply with the Android system...

no practical way so far to open a sqlite database in another folder (this is why had to make a copy in the application's folder).

any practical approach is welcome.

jeepcook commented 7 months ago

again, the dup impl is to comply with the Android system...

no practical way so far to open a database in another folder (this is why had to make a copy in the application's folder).

any practical approach is welcome.

Ok in this case how to be sure that both mmb files are the same ? It's not really the case, I don't know how work the replication between these 2 files but it's not working properly and is broken with latest commits.

guanlisheng commented 7 months ago

any details on the broking and what the latest commits mean?

no 100% guarantee the same and there is a period sync to try the best which was listed in the arch as well https://forum.moneymanagerex.org/viewtopic.php?p=24565#p24565

jeepcook commented 7 months ago

any details on the broking and what the latest commits mean?

no 100% guarantee the same and there is a period sync to try the best which was listed in the arch as well https://forum.moneymanagerex.org/viewtopic.php?p=24565#p24565

Synchronization between working database /android.data/com.moneymnager/files/dartabases/comptes.mmb and the chosen directory during installation (example: Internal Storage/moneymanagerex/comptes.mmdb) is ok with 2024.01.10 android version but broken with 2024.01.12 package.

And I had 2 days without synchronisation so back to 2024.01.10 and now it's OK.

guanlisheng commented 7 months ago

I c. after 2024.01.12, we need to enable sync and its interval manually... sorry for the inconvenience.

here you go the guideline https://www.youtube.com/shorts/zxQHkbXhWok

jeepcook commented 7 months ago

I c. after 2024.01.12, we need to enable sync and its interval manually... sorry for the inconvenience.

here you go the guideline https://www.youtube.com/shorts/zxQHkbXhWok

Ok thanks but where do have we to pull the replicated directory, is Internal Storage/moneymanagerex correct? or do we have to user document folder?, I d'don't understand.

edit: remote file is content://com.android.externalstorage.documents/document/primary%3aMoneyManagerEx%2Fcomptes.mmb

guanlisheng commented 7 months ago

pull and push are from app's POV.

hence document folder, download folder, and other cloud storage folders are external and remote.

jeepcook commented 7 months ago

pull and push are from app's POV.

hence document folder, download folder, and other cloud storage folders are external and remote.

It's very confusing because I don't know where to configure external storage because it's not editable and where in that storage is store the mmb.

jeepcook commented 7 months ago

Finally I've decided to reinstall mmex 2014.01.12, and last gdrive version. Configured MMex synchronization with as remote file the mmdb selected via internal explorer and so document provider. Enable load database immediately after modification and sync at start.

I think I have now a working, and more clear for me, solution. I will verify this next hours/days.

jeepcook commented 7 months ago

Originally posted by @jeepcook in https://github.com/moneymanagerex/android-money-manager-ex/issues/1522#issuecomment-1891037059

Flexmaen commented 7 months ago

Bit still: Isn't it a bug that MMex crashes? Or should we file a new issue for this?

guanlisheng commented 7 months ago

thanks, @jeepcook, and @Flexmaen, appreciate it if you could refer more guys to use both desktop and Android mmex.

in terms of crashes, I think a dedicated issue might be better, then me and @wolfsolver would have a look to enhance its robustness to handle database deletion properly.

jeepcook commented 7 months ago

Hello @guanlisheng , Do have I to open another issue for the annoying continuous rotation of rounded arrows when synchronisation is configured? For the rest I think we have now a version which allow to use desktop and android versions indifferently. Thanks for the good work of the new ammex team ;-)

guanlisheng commented 7 months ago

a dedicated one per concrete issue would be great.

thanks for the feedback and confirmations. Do not hesitate to ping us and share with more guys if possible.

jeepcook commented 7 months ago

a dedicated one per concrete issue would be great.

thanks for the feedback and confirmations. Do not hesitate to ping us and share with more guys if possible.

done. issue #1524

Flexmaen commented 7 months ago

Just to make sure that I got this right: The file in the Android/data directory should be synced with the file of the directory you selected? Just one-way or both ways?

Flexmaen commented 7 months ago

Btw, the crash issue seems fixed in 2024.01.12.

So only issue i'd report would be the local file sync, but i'm not sure if a sync is expected there or if it would be a feature request.

jeepcook commented 7 months ago

Just to make sure that I got this right: The file in the Android/data directory should be synced with the file of the directory you selected? Just one-way or both ways?

The sync should have to be from Android/data directory to local selected or cloud configured @https://forum.moneymanagerex.org/viewtopic.php?p=24565&sid=decd23326e1da77a2da9299292d3d684#p24565

jeepcook commented 7 months ago

Why every sync issues are closed. Is now the synchronisation functional? Not with the last builds.

guanlisheng commented 7 months ago

Why every sync issues are closed. Is now the synchronisation functional? Not with the last builds.

hi @jeepcook, I recall some dedicated issues were created to track the remaining outstanding issues. this and the associated one are to help understand the two database files in the Android phone. correct?

jeepcook commented 7 months ago

I recall some dedicated issues were created to track the remaining outstanding issues. this and the associated one are to help understand the two database files in the Android phone. correct?

Ok I understand. Yes these were discussions. But we must keep at least the major synchronization issue because if there are problems with synchronization it will be impossible to use Android and PC versions, the databases will not be the same.

guanlisheng commented 7 months ago

the primary piece is functional, and it benefits many guys.

also, will keep investment in the flaws based on resources. maybe you can also contribute sth seems you are technical.

jeepcook commented 7 months ago

the primary piece is functional, and it benefits many guys.

also, will keep investment in the flaws based on resources. maybe you can also contribute sth seems you are technical.

Yes of course, I can help and it's true I'm technical.

Flexmaen commented 7 months ago

I wonder how I can do an offline sync with the local computer. I cannot find any option for this at all.

Also tried to register at that forum: https://forum.moneymanagerex.org/ ...but registration doesn't seem to work there, my account is inactive.

guanlisheng commented 7 months ago

this might help on the "offline" sync and please help to summarize and/or polish if possible https://forum.moneymanagerex.org/viewtopic.php?t=10942

Flexmaen commented 7 months ago

@guanlisheng That menu looks completely different for me, or I can't find this menu at all. sync_screenshot

guanlisheng commented 7 months ago

the primary piece is functional, and it benefits many guys. also, will keep investment in the flaws based on resources. maybe you can also contribute sth seems you are technical.

Yes of course, I can help and it's true I'm technical.

this is great and maybe we can get started with synchronization, major two means:

  1. via cloud storage service, like oneDrive, it has built-in storage
  2. via sync service, like Synching, it has to reply on Android's storage, e.g. Documents or Downloads

@jeepcook thoughts? output would be any form and great to post is in project related media

jeepcook commented 7 months ago

the primary piece is functional, and it benefits many guys. also, will keep investment in the flaws based on resources. maybe you can also contribute sth seems you are technical.

Yes of course, I can help and it's true I'm technical.

this is great and maybe we can get started with synchronization, major two means:

  1. via cloud storage service, like oneDrive, it has built-in storage
  2. via sync service, like Synching, it has to reply on Android's storage, e.g. Documents or Downloads

@jeepcook thoughts? output would be any form and great to post is in project related media

Do I understand you want me to test solutions? No problem. For cloud I have Dropbox and Google Drive. For the sync from an allow access folder like Documents or Download (and not /android/data), I have Foldersync or tasker.

Flexmaen commented 7 months ago

this is great and maybe we can get started with synchronization, major two means:

  1. via cloud storage service, like oneDrive, it has built-in storage
  2. via sync service, like Synching, it has to reply on Android's storage, e.g. Documents or Downloads
  1. it would be fine to just have the MMS-File in some folder that is accessible on Android 13. For example you just could use things like MyPhoneExplorer to sync that file locally.
jeepcook commented 7 months ago

I already have a sync solution for my pictures, my SMS backup. So I can synchronize what I want.

Flexmaen commented 7 months ago

I already have a sync solution for my pictures, my SMS backup. So I can synchronize what I want.

Which Android-Version do you have?

Prior to Android 13 it was possible to access all directorys for MyPhoneExplorer too, but with Android 13 the restrictions got more.

jeepcook commented 7 months ago

Which Android-Version do you have?

Android 13

Flexmaen commented 7 months ago

Which Android-Version do you have?

Android 13

Well, some Apps might provide Workarounds but in General acess to the data-directory is now limited: https://www.reddit.com/r/Android/comments/wru35i/clearing_up_confusion_about_how_to_access/

So what is your Sync-Solution then?

jeepcook commented 7 months ago

FolderSync https://play.google.com/store/apps/details?id=dk.tacit.android.foldersync.full&pcampaignid=web_share

and for some other Tasker https://play.google.com/store/apps/details?id=net.dinglisch.android.taskerm&pcampaignid=web_share

Flexmaen commented 7 months ago

However per default the Data-Area is not officially accessible from other apps, so it would be great to have current MMS that is accessible without workarounds. You never know if they are not closing that hole in the next Android version...

jeepcook commented 7 months ago

My MMS photos are backed up in Pictures/Messages so not into /Android/Data directory.