-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Update targetSdkversion to 29 #3360
Comments
Hello @grzesiek2010, you have been unassigned from this issue because you have not updated this issue or any referenced pull requests for over 15 days. You can reclaim this issue or claim any other issue by commenting Thanks for your contributions, and hope to see you again soon! |
The biggest problem for us is scoped storage and I'm in the 99% of people that hate it. Today starts Android Dev Summit 2019 and probably I'm naive but I hope they will say something like:
If not we will have more info about it at least so I'm putting it on hold and will be back next week. |
Makes sense! We're lucky that @seadowg will be at the Dev Summit getting information first hand. I hope you're right... |
@seadowg, @grzesiek2010 and I discussed scoped storage on a call.
We agreed the next steps are:
Then, when we're ready to target API 29 and fully make the switch, all we should need to do is switch to Context#getExternalFilesDir and move |
I can confirm that I was able to access files using eg.
I had hard time trying to do such a migration and to no avail. I used various devices and every time receiving an exception like: [EDIT] Finally I managed to test moving apps to sd card. Looks as if the problem was caused by the fact I installed the sample app via USB, everything was fine using an apk file. I don't know why but it fixed the problem. |
Hello @grzesiek2010, you have been unassigned from this issue because you have not updated this issue or any referenced pull requests for over 15 days. You can reclaim this issue or claim any other issue by commenting Thanks for your contributions, and hope to see you again soon! |
@grzesiek2010 has done the important exploration and learning tasks that we set out to do for v1.25. We've decided to wait on code changes so I'm removing from milestone. |
Hello @grzesiek2010, you have been unassigned from this issue because you have not updated this issue or any referenced pull requests for over 15 days. You can reclaim this issue or claim any other issue by commenting Thanks for your contributions, and hope to see you again soon! |
There have been some exploration of approaches to getting the scoped storage migration started at #3444, #3460. I want to summarize at a high-level and hopefully figure out a direction.
I read more into app install location and I now think it's not relevant to us. I thought that moving the app would also move its data files but it does not. I think we can ignore this. Some other questions that have come up for me:
The #1 priority is that users can't lose saved and filled forms when they upgrade to the scoped storage version. This is non-negotiable. To achieve this, we need to move everything from "Moving everything" is tricky because it involves both form files and database files that refer to those form files. Currently the references in the database use absolute paths. If those paths were relative, then we could move the whole directory on upgrade and everything should just work. This is where the idea of changing paths in the databases to be relative came from. However, there are two problems:
This leads me to think that for the upgrade path, we need to do the following all in the same new version:
Sadly I no longer see any way to break this up. I also realize that we probably need to design a user experience around this because we will need to block the UI while the file copy happens and there could potentially be large media files involved. @grzesiek2010's exploration has focused around what to do if a user wants to downgrade from the Collect version that requires scoped storage version. Unfortunately, we've realized that because one of the side-effects of using @grzesiek2010 can you please review this analysis carefully and see if I've overlooked anything? |
Luckily, @seadowg was feeling a little more creative than me and has suggested that we start in v1.26 with a change that makes installs that don't yet have an
In discussion with @seadowg, we realized it would be better to let the user drive when the change happens. That is, we'd have some new button or something that describes the change that needs to happen and lets the user trigger a migration of their files. That would let them choose a time when they don't have data on their device or make a backup first. Then at some point in the summer, we'd force the migration on upgrade and block the UI. We could add analytics to track the migration completion rate. One additional thing to note is that even if we time this well, we're not guaranteed that users will upgrade to one of the versions before the the one that requires scoped storage. Folks who go straight from v1.25 to that version, for example, will not get a migration (because again, it will be impossible to do in a scoped storage world). Luckily, in that case, we can tell users how to move the files via |
to be honest that number 20% would be too big we have about 1.2k new installs every day but (fortunately) the number of uninstalls is lower (thanks to that our audience is growing) so in a few month the audience might be much bigger, but still. |
@grzesiek2010 this is a great point. I guess Collect is a little strange in having this behaviour but it will definitely benefit us here! |
Thanks so much for all the continued thought that has gone into this. I hope that together we can get it right for users! I've written separate forum posts about no longer being able to access IMEIs and needing to move off
Yes. What I was saying is that from what I now understand, the path represented by
The big thing that I hadn't considered in @seadowg's concept is letting users manually trigger the migration rather than doing it on install. This is better because it's less likely that users will be disrupted by or interrupt the migration if they trigger it themselves. I've since realized that we'd probably need to provide a manual trigger in case something went wrong like the phone running out of batteries part way through the data migration so it's work we'd need to do anyway. That means Collect needs to be able to handle both storage locations in the same version. If we're going to do that anyway, we might as well give new users the best possible experience by setting them up with the new location right away. Does that reasoning make sense? As we discussed above, we will need to force a migration before August while we still have access to I previously thought that we were going to have to say that other applications could no longer access form definition or submission XML files. However, I think it's too useful and that we need to provide a mechanism for this (e.g. see https://github.com/opendatakit/skunkworks-crow or https://github.com/posm/OpenMapKitAndroid). I think we can do so by reviewing the existing |
@lognaturel that makes sense to me. Thanks for taking the time to get that all down! The addition of the flag for migration started is a nice catch so we can handle recovery from any disaster scenarios. I'm definitely in support of pulling out an interface that's responsible for returning file paths. That sounds like a nice first step that gets us ready withoyut any change in behaviour. |
I agree that keeping file names instead of paths would be better but I'm a bit confused... |
In what I've described in the first bullet list here, what's stored are still paths. For example, for instance files, the instance directory and instance filename will both be included ( As a side note, I spent some time seeing whether we could derive that instance filename with other existing columns. It's in the structure
Do you mean that we could keep the database files exactly as they are, move them, and then translate paths every time we read them from the databases? That is certainly possible but it feels really strange to me. I think that as part of the file moving operation, the databases should be modified to use relative paths. In the second bulleted list above, I suggested doing that as a separate operation from the file copy but it could possibly be simpler to do as files are copied, that will be up to you to discover. The important thing is that the existing database files are not modified. That way, if something goes wrong part way through the migration, everything still works with the original paths. For paths from the database, I'm imagining that they would go through methods like |
Yeah, it will be a path in case of instances but in other cases forms/cache it will be just a file name.
I agree. We could do even more then like remove
I'm in favor of converting existing paths so I'm happy we agree. I just misunderstood you and asked for clarification. Ok no more questions for now. Thanks! |
Hello @grzesiek2010, you have been unassigned from this issue because you have not updated this issue or any referenced pull requests for over 15 days. You can reclaim this issue or claim any other issue by commenting Thanks for your contributions, and hope to see you again soon! |
For anyone who might be following this issue, the scoped storage migration is now implemented and available to beta test: https://forum.opendatakit.org/t/odk-collect-v1-26-beta-1-scoped-storage-migration/25313. There is documentation on the forum: https://forum.opendatakit.org/t/odk-collect-v1-26-storage-migration/25268. The migration is currently opt-in and will be forced in a release right before the requirement to target SDK 29 comes into effect. Additionally, the beta includes a new We will delay targeting SDK 29 until we are required to. |
We've been talking about August 2020 as the time when we need to target 29 but I now think we may have until November. From https://support.google.com/googleplay/android-developer/answer/113469#targetsdk:
Does that sound right? I don't necessarily thing we should delay much beyond August but it'd be good to make sure we have the right "last chance" date in mind. |
Yeah that seems right. Given it looks like we'll have a September release maybe we should target that? |
In v1.29 we will:
Those feel like different PRs to me but that'll be up to the person doing the implementation (likely @grzesiek2010). We should write acceptance criteria for the last point. We don't know how long we will have with the |
There have been further changes to the APIs and some new documentation released since I last checked. I skimmed and don't see anything that changes our plans but here are a few resources: FAQ, migration case study, use cases and best practices. One thing I learned is that the |
We've been testing with I think the first (
So it only works for updates to apps and not fresh installs. If that is all true it means we could continue to run forced migrations when the app targets API 30 (Android 11) on update if we still feel that would be useful. I don't think this changes you todo list but it does give us an extra step we could carry out when moving to API 30. |
🙈🙈🙈 My brain did not notice there were two. Wow indeed. |
Problem description
Working on #3189 we wanted to bump targetSdkversion directly to 29 but it turned out to be not that easy.
this doc seems to be the most relevant https://developer.android.com/about/versions/10/privacy/changes
We would need fixes at least for:
The text was updated successfully, but these errors were encountered: