-
Notifications
You must be signed in to change notification settings - Fork 258
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
Can't move database to external storage #1252
Comments
I'm using wallabag on an Android 8.1 device (Likebook Mars, an e-ink Android book reader); it has a limited amount of internal storage (16GB) and a microSD card slot, and I have the same problem. I looked at the code a bit and it looks like the issue is that the storage class gets the path of the "external storage" by asking Android for a list of writable external storage directories, and just using the first non-null one it finds. On many devices (like mine), there is a distinction between "external storage" that is actually an emulated SD card that takes up your internal storage, and your ACTUAL external SD card; Android returns both paths, but usually returns the emulated one first. The app is actually moving the database as it claims, and it is storing the cache where it intends to, but since it's using the emulated SD path it still takes up space on internal storage and not the SD card. If I get some free time in the next few days I'll maybe look into fixing this and make a PR, since my current wallabag articles with the image cache uses up the entirety of my internal storage, and my 64GB SD card goes to waste, which is not great. |
I haven't created a PR for this yet because I'm still testing the changes, but I have this fixed in my fork here; it should be backwards compatible with existing installs. The primary change is that you can select any of the returned paths for external storage, not just the first one, and it shows you the path in the dialog and the settings screen so hopefully the user can pick one that makes sense for them. It might add a little confusion for people who don't understand filesystem paths, not sure of a way around that really because Android doesn't provide any way to know which ones are emulated external storage, real SD cards, etc. This change worked for me on the ebook reader I mentioned in my last note; my used internal storage is now unchanged after syncing 24k articles, and my SD card has plenty of space taken up by the articles and images, which you can see on the card in Android/data/APP_NAME/files/. |
I made a PR for this ( #1268 )but it hasn't been reviewed yet, so I guess for now people who want this fix need to build the app themselves and sideload it. I've been using it for months on my e-ink Android device without issue though. |
well this solved the mystery of why my tablet is constantly out of storage! Can someone please review/merge the fix for this?? |
I don't have a release or anything, but if you download the Android SDK you can get my forked version and build a debug apk and sideload it to your device. That's what I've done until they merge the change, and it's been working fine for months. |
wish I could. Android development isn't my area of knowledge. I can download/install the SDK, but I have no idea how to build an app from source |
I've created a pre-release debug .apk file here. You can sideload this onto your device to use it; it should use your existing app's settings, you'll just want to go into the settings and correctly set the storage location. |
thanks! I figured out how to build it. Turns out everything in my android build toolchain was extremely old/deprecated because that's what Visual Studio installed. Removing it all and installing Android Studio/the Android SDK manually myself did the trick! |
Issue details
Duplicate?
Have you searched the issues of this repository if your issue is already known? yes
Actual behaviour
I recently did a factory reset and reinstalled Wallabag. I wanted to change the database location to external, so I changed the setting without issue.. But no data was moved.
I thought that manually moving the folder solved the issue, but it still shows up in Android as stored on internal. Also, when deleting the external folder, all the articles are still present in the app, even after clearing cache in Android settings. In other words: with both fr.gaulupeau.apps.InThePoche folders empty, the data is still there.
This is confirmed when looking at the system settings. User data is still present, and in fact it increases when I change the database location setting a few times again in the app!! So I suspect there's a 3rd location I'm unaware of, where data is stored..?
Expected behaviour
Folder with database should move to external storage.
Steps to reproduce the issue
Environment details
Logs
Contents of the generated log file (also written to internal location, even though it mentions the external folder):
Show content
--------- beginning of system
04-04 15:11:40.702 7349 7349 D TextClassifierService: No configured system TextClassifierService
04-04 15:11:58.152 7349 7349 D TextClassifierService: No configured system TextClassifierService
04-04 15:12:01.094 7349 7349 D TextClassifierService: No configured system TextClassifierService
--------- beginning of main
04-04 15:35:33.778 7349 7349 D SettingsFragment: onStart() started
04-04 15:35:33.778 7349 7349 D SettingsFragment: resetChanges() started
04-04 15:35:45.975 7349 7349 W InputEventReceiver: Attempted to finish an input event but the input event receiver has already been disposed.
04-04 15:35:47.737 7349 7349 I DecorView: It non-support bigbang
04-04 15:35:47.739 7349 7349 I PhoneWindow: isNeedChangeNaviBarColor taskInfo: [android.app.ActivityManager$RunningTaskInfo@e4432ef] size: 1
04-04 15:35:47.739 7349 7349 I PhoneWindow: isAPPNeedChange pkgName: fr.gaulupeau.apps.InThePoche needKeep: false
04-04 15:35:47.739 7349 7349 I PhoneWindow: isNeedChangeNaviBarColor false
04-04 15:35:47.739 7349 7349 I PhoneWindow: generateLayout mNavigationBarColor: ff000000
04-04 15:35:47.739 7349 7349 I PhoneWindow: generateLayout isLightNavi false, Visibility: 0
04-04 15:36:19.048 7349 7349 D SettingsFragment: onStop() started
04-04 15:36:19.049 7349 7349 D SettingsFragment: applyChanges() started
04-04 15:37:15.969 7349 7349 D SettingsFragment: onStart() started
04-04 15:37:15.969 7349 7349 D SettingsFragment: resetChanges() started
04-04 15:37:17.781 7349 7349 D SettingsFragment: onStop() started
04-04 15:37:17.781 7349 7349 D SettingsFragment: applyChanges() started
04-04 15:37:46.900 7349 7349 D SettingsFragment: onStart() started
04-04 15:37:46.901 7349 7349 D SettingsFragment: resetChanges() started
04-04 15:37:48.659 7349 7349 W InputEventReceiver: Attempted to finish an input event but the input event receiver has already been disposed.
04-04 15:37:50.420 7349 7349 D OperationsHelper: syncAndUpdate() started
04-04 15:37:50.421 7349 7349 D OperationsHelper: updateArticles() started
04-04 15:37:50.444 7349 7349 D MainService: onCreate()
04-04 15:37:50.445 7349 7349 D MainService: onStartCommand()
04-04 15:37:50.446 7349 7349 D MainService: enqueueTask()
04-04 15:37:50.446 7349 7349 V MainService: enqueueTask() enqueueing task
04-04 15:37:50.446 7349 9748 V MainService: run() running a task
04-04 15:37:50.447 7349 9748 D EventProcessor: onUpdateArticlesStartedEvent() started
04-04 15:37:50.453 7349 9748 D ArticleUpdateWorker: updateArticles(FAST) started
04-04 15:37:50.454 7349 9748 D DbConnection: creating new db session
04-04 15:37:50.480 7349 7349 D MainActivity: onUpdateArticlesStartedEvent()
04-04 15:37:50.627 7349 9748 I ArticleUpdater: update() started; clean: false
04-04 15:37:50.627 7349 9748 V ArticleUpdater: update() latestUpdatedItemTimestamp: 1649055286000
04-04 15:37:50.627 7349 9748 D ArticleUpdater: update() updating articles
04-04 15:37:50.627 7349 9748 D ArticleUpdater: performUpdate(full: false, latestUpdatedItemTimestamp: 1649055286000) started
04-04 15:37:50.627 7349 9748 D ArticleUpdater: performUpdate() starting to iterate though pages
04-04 15:37:50.982 7349 7349 D SettingsFragment: onStop() started
04-04 15:37:50.982 7349 7349 D SettingsFragment: applyChanges() started
04-04 15:37:52.481 7349 7349 D CachingPagerAdapter: instantiateItem() position: 0
04-04 15:37:52.488 7349 7349 V ArticleListsFragment: onPageSelected() position: 0
04-04 15:37:52.488 7349 7349 V ArticleListsFragment: setParametersToFragment() started
04-04 15:37:52.494 7349 7349 D MainActivity: onCreateOptionsMenu()
04-04 15:37:52.505 7349 7349 V ArticleListFragment: Fragment 1 onCreateOptionsMenu()
04-04 15:37:52.672 7349 9748 D ArticleUpdater: performUpdate() page: 1/1, total articles: 0
04-04 15:37:52.672 7349 9748 D EventProcessor: onUpdateArticlesProgressEvent() started
04-04 15:37:52.672 7349 9748 D ArticleUpdater: performUpdate() no items; skipping
04-04 15:37:52.672 7349 9748 D ArticleUpdater: update() articles updated
04-04 15:37:52.672 7349 9748 V ArticleUpdater: update() latestUpdatedItemTimestamp: 1649055286000
04-04 15:37:52.673 7349 7349 D MainActivity: onUpdateArticlesProgressEvent()
04-04 15:37:52.673 7349 9748 I ArticleUpdateWorker: updateArticles() update successful, saving timestamps
04-04 15:37:52.673 7349 9748 I ArticleUpdater: update() finished
04-04 15:37:52.673 7349 9748 D ArticleUpdateWorker: updateArticles() finished
04-04 15:37:52.673 7349 9748 D EventProcessor: onUpdateArticlesFinishedEvent() started
04-04 15:37:52.674 7349 9748 D EventProcessor: onActionResultEvent() started
04-04 15:37:52.674 7349 9748 D EventProcessor: onActionResultEvent() action: UPDATE_ARTICLES
04-04 15:37:52.674 7349 9748 D EventProcessor: onActionResultEvent() result is success: true
04-04 15:37:52.674 7349 9748 V MainService: run() finished a task
04-04 15:37:52.674 7349 9748 D MainService: run() no more tasks; notifying that we are ready to stop
04-04 15:37:52.674 7349 9748 D MainService: readyToStop()
04-04 15:37:52.679 7349 7349 D MainActivity: onUpdateArticlesFinishedEvent
04-04 15:37:52.679 7349 7349 D MainActivity: updateLastUpdateTime() updating time
04-04 15:37:52.680 7349 7349 D MainService: onDestroy()
04-04 15:37:52.681 7349 9748 D MainService: run() poll interrupted
04-04 15:37:53.849 7349 7349 D RecyclerVLFragment: loadMore(page: 1, totalItemsCount: 30)
04-04 15:37:56.153 7349 7349 D MainActivity: DrawerListener.updateTime() updating time
04-04 15:37:56.154 7349 7349 D MainActivity: updateLastUpdateTime() updating time
04-04 15:37:58.331 7349 7349 W AboutLibraries: Have you missed to call withFields(R.string.class.getFields())? - autoDetect won't work - https://github.com/mikepenz/AboutLibraries/wiki/HOWTO:-Fragment
04-04 15:37:58.402 7349 7349 D MainActivity: DrawerListener.updateTime() updating time
04-04 15:37:58.402 7349 7349 D MainActivity: updateLastUpdateTime() updating time
04-04 15:37:58.405 7349 7349 W ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@41b28ea
04-04 15:37:58.421 7349 7349 I DecorView: It non-support bigbang
04-04 15:37:58.422 7349 7349 I PhoneWindow: isNeedChangeNaviBarColor taskInfo: [android.app.ActivityManager$RunningTaskInfo@38635af] size: 1
04-04 15:37:58.423 7349 7349 I PhoneWindow: isAPPNeedChange pkgName: fr.gaulupeau.apps.InThePoche needKeep: false
04-04 15:37:58.423 7349 7349 I PhoneWindow: isNeedChangeNaviBarColor false
04-04 15:37:58.423 7349 7349 I PhoneWindow: generateLayout mNavigationBarColor: ff000000
04-04 15:37:58.423 7349 7349 I PhoneWindow: generateLayout isLightNavi false, Visibility: 0
04-04 15:37:58.834 7349 7359 I apps.InThePoch: Background concurrent copying GC freed 28290(1716KB) AllocSpace objects, 50(1484KB) LOS objects, 57% free, 9MB/21MB, paused 195us total 148.137ms
04-04 15:37:59.000 7349 7349 V ArticleListsFragment: onSaveInstanceState()
04-04 15:37:59.001 7349 7349 V RecyclerVLFragment: onSaveInstanceState()
04-04 15:37:59.001 7349 7349 I chatty : uid=10171(fr.gaulupeau.apps.InThePoche) identical 2 lines
04-04 15:37:59.002 7349 7349 V RecyclerVLFragment: onSaveInstanceState()
04-04 15:37:59.003 7349 7349 V MainActivity: onSaveInstanceState()
04-04 15:37:59.466 7349 7359 I apps.InThePoch: Background concurrent copying GC freed 50163(6MB) AllocSpace objects, 290(5MB) LOS objects, 52% free, 11MB/23MB, paused 186us total 135.527ms
04-04 15:38:00.157 7349 7359 I apps.InThePoch: Background concurrent copying GC freed 68746(10MB) AllocSpace objects, 275(5MB) LOS objects, 62% free, 7MB/19MB, paused 339us total 147.027ms
04-04 15:39:03.500 7349 7349 V ArticleListsFragment: onSaveInstanceState()
04-04 15:39:03.500 7349 7349 V RecyclerVLFragment: onSaveInstanceState()
04-04 15:39:03.500 7349 7349 V RecyclerVLFragment: onSaveInstanceState()
04-04 15:39:03.501 7349 7349 V MainActivity: onSaveInstanceState()
04-04 15:50:50.756 7349 7349 D OperationsHelper: syncAndUpdate() started
04-04 15:50:50.757 7349 7349 D OperationsHelper: updateArticles() started
04-04 15:50:50.783 7349 7349 D MainService: onCreate()
04-04 15:50:50.784 7349 7349 D MainService: onStartCommand()
04-04 15:50:50.785 7349 7349 D MainService: enqueueTask()
04-04 15:50:50.785 7349 7349 V MainService: enqueueTask() enqueueing task
04-04 15:50:50.786 7349 10490 V MainService: run() running a task
04-04 15:50:50.787 7349 10490 D EventProcessor: onUpdateArticlesStartedEvent() started
04-04 15:50:50.792 7349 10490 D ArticleUpdateWorker: updateArticles(FAST) started
04-04 15:50:50.794 7349 10490 D DbConnection: using existing db session
04-04 15:50:50.794 7349 10490 I ArticleUpdater: update() started; clean: false
04-04 15:50:50.795 7349 10490 V ArticleUpdater: update() latestUpdatedItemTimestamp: 1649055286000
04-04 15:50:50.795 7349 10490 D ArticleUpdater: update() updating articles
04-04 15:50:50.795 7349 10490 D ArticleUpdater: performUpdate(full: false, latestUpdatedItemTimestamp: 1649055286000) started
04-04 15:50:50.795 7349 10490 D ArticleUpdater: performUpdate() starting to iterate though pages
04-04 15:50:50.826 7349 7349 D MainActivity: onUpdateArticlesStartedEvent()
04-04 15:50:53.303 7349 10490 D ArticleUpdater: performUpdate() page: 1/1, total articles: 0
04-04 15:50:53.304 7349 10490 D EventProcessor: onUpdateArticlesProgressEvent() started
04-04 15:50:53.304 7349 10490 D ArticleUpdater: performUpdate() no items; skipping
04-04 15:50:53.304 7349 10490 D ArticleUpdater: update() articles updated
04-04 15:50:53.304 7349 7349 D MainActivity: onUpdateArticlesProgressEvent()
04-04 15:50:53.304 7349 10490 V ArticleUpdater: update() latestUpdatedItemTimestamp: 1649055286000
04-04 15:50:53.305 7349 10490 I ArticleUpdateWorker: updateArticles() update successful, saving timestamps
04-04 15:50:53.305 7349 10490 I ArticleUpdater: update() finished
04-04 15:50:53.305 7349 10490 D ArticleUpdateWorker: updateArticles() finished
04-04 15:50:53.306 7349 10490 D EventProcessor: onUpdateArticlesFinishedEvent() started
04-04 15:50:53.307 7349 10490 D EventProcessor: onActionResultEvent() started
04-04 15:50:53.307 7349 10490 D EventProcessor: onActionResultEvent() action: UPDATE_ARTICLES
04-04 15:50:53.307 7349 10490 D EventProcessor: onActionResultEvent() result is success: true
04-04 15:50:53.307 7349 10490 V MainService: run() finished a task
04-04 15:50:53.307 7349 10490 D MainService: run() no more tasks; notifying that we are ready to stop
04-04 15:50:53.307 7349 10490 D MainService: readyToStop()
04-04 15:50:53.323 7349 7349 D MainActivity: onUpdateArticlesFinishedEvent
04-04 15:50:53.323 7349 7349 D MainActivity: updateLastUpdateTime() updating time
04-04 15:50:53.324 7349 7349 D MainService: onDestroy()
04-04 15:50:53.326 7349 10490 D MainService: run() poll interrupted
04-04 15:50:54.357 7349 7349 D MainActivity: DrawerListener.updateTime() updating time
04-04 15:50:54.357 7349 7349 D MainActivity: updateLastUpdateTime() updating time
04-04 15:50:56.107 7349 7349 V ArticleListsFragment: onSaveInstanceState()
04-04 15:50:56.107 7349 7349 V RecyclerVLFragment: onSaveInstanceState()
04-04 15:50:56.107 7349 7349 I chatty : uid=10171(fr.gaulupeau.apps.InThePoche) identical 1 line
04-04 15:50:56.107 7349 7349 V RecyclerVLFragment: onSaveInstanceState()
04-04 15:50:56.108 7349 7349 V MainActivity: onSaveInstanceState()
04-04 15:51:16.861 7349 7349 D MainActivity: DrawerListener.updateTime() updating time
04-04 15:51:16.861 7349 7349 D MainActivity: updateLastUpdateTime() updating time
04-04 15:51:16.864 7349 7349 W ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@a34acd4
04-04 15:51:16.884 7349 7349 I DecorView: It non-support bigbang
04-04 15:51:16.885 7349 7349 I PhoneWindow: isNeedChangeNaviBarColor taskInfo: [android.app.ActivityManager$RunningTaskInfo@e0b4ab1] size: 1
04-04 15:51:16.885 7349 7349 I PhoneWindow: isAPPNeedChange pkgName: fr.gaulupeau.apps.InThePoche needKeep: false
04-04 15:51:16.885 7349 7349 I PhoneWindow: isNeedChangeNaviBarColor false
04-04 15:51:16.885 7349 7349 I PhoneWindow: generateLayout mNavigationBarColor: ff000000
04-04 15:51:16.885 7349 7349 I PhoneWindow: generateLayout isLightNavi false, Visibility: 0
04-04 15:51:16.928 7349 7349 D SettingsFragment: onStart() started
04-04 15:51:16.928 7349 7349 D SettingsFragment: resetChanges() started
04-04 15:51:17.471 7349 7349 V ArticleListsFragment: onSaveInstanceState()
04-04 15:51:17.472 7349 7349 V RecyclerVLFragment: onSaveInstanceState()
04-04 15:51:17.472 7349 7349 I chatty : uid=10171(fr.gaulupeau.apps.InThePoche) identical 1 line
04-04 15:51:17.472 7349 7349 V RecyclerVLFragment: onSaveInstanceState()
04-04 15:51:17.473 7349 7349 V MainActivity: onSaveInstanceState()
04-04 15:51:18.001 7349 7349 I DecorView: It non-support bigbang
04-04 15:51:18.003 7349 7349 I PhoneWindow: isNeedChangeNaviBarColor taskInfo: [android.app.ActivityManager$RunningTaskInfo@530ed13] size: 1
04-04 15:51:18.003 7349 7349 I PhoneWindow: isAPPNeedChange pkgName: fr.gaulupeau.apps.InThePoche needKeep: false
04-04 15:51:18.003 7349 7349 I PhoneWindow: isNeedChangeNaviBarColor false
04-04 15:51:18.003 7349 7349 I PhoneWindow: generateLayout mNavigationBarColor: ff000000
04-04 15:51:18.003 7349 7349 I PhoneWindow: generateLayout isLightNavi false, Visibility: 0
Your experience with wallabag Android app
I totally get that! I've been using Wallabag for years now and although it's not perfect, I would never even consider going back to something proprietary. Wallabag is one of the (if not the) most used apps on my phone, and it feels great to be able to carry my favorite articles around in my own, private pouch :) So thanks for all your efforts and I hope Wallabag will be around for a long time to come!
The text was updated successfully, but these errors were encountered: