Add option to move the application from internal memory to sdcard #826
Replies: 19 comments 1 reply
-
I can try to do that. I'll PR if I succeed :) |
Beta Was this translation helpful? Give feedback.
-
Hey Mateusz I would love the help. Let me rough out approximately what needs to be done for it -
(3) can be challenging, so maybe you want to tackle it last, and deal with the more straightforwards tasks first. And I can make (3) more of a priority for me, and if I haven't gotten it by the time you have the others done, then you can try to do it (if you want to). Also, I would need you to assign the copyright to me. I'll figure out a simple way for you to do that. I am not sure if Apple allows or does not allow AGPL apps and therefore would like to error on the side of releasing it as a proprietary app in iOS's app store. |
Beta Was this translation helpful? Give feedback.
-
I can't compile app out of the box :/
|
Beta Was this translation helpful? Give feedback.
-
I won't be able to provide a fix till tomorrow. Going to bed right now.
If you want to fix it yourself, generate that missing file by looking at
how the CI does it (since the CI, is green). What I can do tomorrow is try
to add a way so that the file doesn't need to be generated.
…On Mon, Apr 13, 2020, 1:51 AM Mateusz Soszyński ***@***.***> wrote:
I can't compile app out of the box :/
Compiler message:
lib/error_reporting.dart:12:8: Error: Error when reading 'lib/.env.dart': No such file or directory
import 'package:gitjournal/.env.dart';
^
lib/screens/purchase_screen.dart:5:8: Error: Error when reading 'lib/.env.dart': No such file or directory
import 'package:gitjournal/.env.dart';
^
lib/iap.dart:5:8: Error: Error when reading 'lib/.env.dart': No such file or directory
import 'package:gitjournal/.env.dart';
^
lib/error_reporting.dart:17:10: Error: Getter not found: 'environment'.
dsn: environment['sentry'],
^^^^^^^^^^^
lib/screens/purchase_screen.dart:27:27: Error: The getter 'environment' isn't defined for the class '_PurchaseScreenState'.
- '_PurchaseScreenState' is from 'package:gitjournal/screens/purchase_screen.dart' ('lib/screens/purchase_screen.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'environment'.
await Purchases.setup(environment['revenueCat']);
^^^^^^^^^^^
lib/iap.dart:16:27: Error: Getter not found: 'environment'.
await Purchases.setup(environment['revenueCat']);
^^^^^^^^^^^
Target kernel_snapshot failed: Exception: Errors during snapshot creation: null
build failed.
FAILURE: Build failed with an exception.
* Where:
Script '/home/mateusz/dev/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 780
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDevDebug'.
> Process 'command '/home/mateusz/dev/flutter/bin/flutter'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 20s
Finished with error: Gradle task assembleDebug failed with exit code 1
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#99 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADIDY6MK5LPQF5BYFESPPTRMJHYZANCNFSM4MEIHHBA>
.
|
Beta Was this translation helpful? Give feedback.
-
Okay, just needed to run |
Beta Was this translation helpful? Give feedback.
-
Okay, after some coding, I have some proposition:
Honestly, your project is more complicated than I expected, and I'm just starting with Flutter. Gonna make PR that adds storage selection option, but I don't think I can do anything more for now - maybe with some more directions. |
Beta Was this translation helpful? Give feedback.
-
This is a great start! GitJournal's code has gotten a bit messy. So don't be too hard on yourself. It's not easy jumping into a project.
I didn't know about the ScopedStorage in Android 11. I'll read up. Thanks for the PR! |
Beta Was this translation helpful? Give feedback.
-
Hey thanks for this change @TheLastGimbus :-) |
Beta Was this translation helpful? Give feedback.
-
That's just about to change with Android 11. Scoped Storage will make it that you can't read/write outside of what user specified through a file picker. And it will provide some "documents" objects - not standard files :( |
Beta Was this translation helpful? Give feedback.
-
@TheLastGimbus it is not possible to use the result of |
Beta Was this translation helpful? Give feedback.
-
I didn't respond to this for long, but I don't really know Although Google said that it listened to community, and offered a "file interfere" between "documents API" - meaning that you can get native |
Beta Was this translation helpful? Give feedback.
-
So, minor update -
|
Beta Was this translation helpful? Give feedback.
-
Can't you use native folder picker? It should allow user to select wherever they want... |
Beta Was this translation helpful? Give feedback.
-
Honestly, I have no idea how to do that with Flutter.
I spent some 20 minutes trying to fix this and I thought I should just
write down my findings, for the next time I decide to investigate it.
I'm sure it's not impossible.
…On Thu, Dec 30, 2021, 17:39 Mateusz Soszyński ***@***.***> wrote:
Can't you use native folder picker? It should allow user to select
wherever they want...
—
Reply to this email directly, view it on GitHub
<#99 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADIDY47D4WT34XB6ZQ7OX3UTSDMRANCNFSM4MEIHHBA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Since Android 10, apps can't request write access to a folder in SD Card. Currently Flutter standard library doesn't provide a way to access SAF. And as far as I know, there are no 3rd party libraries that do either. Here's a snippet of code that someone used to invoke SAF folder picker: They use some kind of channel to pass data to Java/Kotlin part of the app, which has access to SAF. The above issue is on Ignore any of the comments in that issue mentioning |
Beta Was this translation helpful? Give feedback.
-
@itsfarseen : Thank you for all the info. Minor correction - This is from Android 11, not 10, right? GitJournal currently uses libgit2 (c code) to perform git operations and doing this via the SAF would be challenging, and it's not something I'm willing to invest the time I requested the new "manage external storage" permission in Oct, Google denied it, and also kept blocking updates in Gitjournal for 2 months after that for "mysterious" reasons. I'm planning on improving the settings screen in Android, and tell the user what can and cannot be done. Additionally, all future builds via FDroid will have the extra permission which will allow Gitjournal users to store the git repo wherever they want. In parallel, I'm also planning on adding "compatibility with other apps" as a core feature and advertise it everywhere, AND monitor the files for changes. With both these changes, maybe Google will grant me the "MANAGE_EXTERNAL_STORAGE" permission, as monitoring files for changes isn't something technically possible via the SAF. (I could be mistaken). |
Beta Was this translation helpful? Give feedback.
-
Yes. My bad :)
I have no idea whether this would work, but I would try throwing whatever path that SAF returns, to the C code and see if it works. It might work because after all it's a path that SAF returns. If its readable by dart code, it should be readable by the C code as well. Not sure though.
This is a very good option. Just show it somewhere in the Play Store build, something like "Get the app via FDroid to let you store stuff in arbitrary folders". This makes sense, because the reason Google limiting
Yeah I think so too.
I'm not very hopeful about this though. |
Beta Was this translation helpful? Give feedback.
-
Guys, guys Google made a big poo poo, but TL;DR:
There probably already should be some SAF plugin somewhere... yes, you need to access it with Java (plugin), but once you get stuff from the user, you can get normal |
Beta Was this translation helpful? Give feedback.
-
Not sure if I will get anywhere with this, but as a potentially useful fyi, I seem to successfully get persistable permission for a user-selected folder in shared storage (i.e. external sd card, non app-specific folder, not one of the public media folders like "Pictures".) using https://github.com/alexrintt/shared-storage/ .. though it should be noted that they clearly state it is incomplete, in beta, and will get heavy api changes. Link to my very hacky not-yet-cleaned-up fork if you'd like to get inspiration. I'm hoping to fully fix this up and PR, but I've already spent a few days on this and am still stuck at getting a usable filesystem path out of the content-URI. If I don't progress for too long, I might give up and revert to my current setup which is definitely not useful for everyone (I just use the app-specific directory and access it from other apps using root access.) |
Beta Was this translation helpful? Give feedback.
-
Or we have an option for this on the app ?
Another possibility is move the files from git (repository) to sdcard.
Beta Was this translation helpful? Give feedback.
All reactions