-
-
Notifications
You must be signed in to change notification settings - Fork 449
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
[WIP] Fixes #2069: Allow to scan products offline #2102
Conversation
@prashantkh19 How long does it take now ? |
Apart from downloading time, approximately 4 minutes. |
@teolemon That would keep people waiting for around 8 to 10 minutes before starting the app if we consider all delays. Do you want to go ahead with this ? |
The pr is to try to find a solution ( I asked for feedback from a senior Android developer) |
That sounds like a reasonable solution, since the download is not an issue. On first install, we could display a progress report on the home. The refresh option would be in the settings. |
app/src/main/java/openfoodfacts/github/scrachx/openfood/views/splash/SplashActivity.java
Outdated
Show resolved
Hide resolved
app/src/main/java/openfoodfacts/github/scrachx/openfood/views/splash/SplashActivity.java
Outdated
Show resolved
Hide resolved
I was thinking to make a new tab in the nav menu - Offline Products. Navigating to that will let the user to initiate download for the offline package of products and storing to database as well. (both will be done in the background, with progress in the notification bar) |
That sounds good to me. |
da6172e
to
cb9ddb7
Compare
@teolemon please review the latest commit. |
I've built the branch and started the download, and now it's extracting data. There should probably be a visual feedback in the navbar (by updating the color of the icon and or the content of the text) |
|
@prashantkh19 perhaps a missing GreenDAO migration ? |
I cleaned the cache, and got to "No remaining download", so it seems to work. |
yeah, a simple reinstall should work. |
I would see some way to handle this exception so that app won't crash if this happens. |
Just for the information, aren't you getting these type of notifications during the process? |
I didn't spot any. I'm on Android Pie, where notification behaviour might have changed. Going to check again. |
I just checked again. I see progress in LogCat, but nothing in notifications. |
Okay then I will modify notifications for android pie. |
Apart from this, do you have any other suggestion? |
Probably already in your plans
Longer term:
|
@teolemon review please.. |
|
app/src/main/java/openfoodfacts/github/scrachx/openfood/fragments/ProductsDownloadFragment.java
Outdated
Show resolved
Hide resolved
We're releasing the next version next week. Any chance the feature could make it ? |
I am sorry, I have my exams starting next week. I would be able to work on it after March 16 only. |
good luck 🤞 |
In terms of chronology, we should try to load from the local db first, then if the network query is successful, replace the offline result by the online result |
Here's what we're doing on iOS to let the user know about the Offline mode |
I'd like to work on this if it's okay with everyone. My understanding is that the PR currently deals with downloading the data and storing it locally. My goal will be to:
|
@elouataoui sound good to me. |
Hello @prashantkh19, https://stackoverflow.com/questions/27396892/what-are-advantages-of-setting-largeheap-to-true |
|
@prashantkh19 @deniger I just rebased. I hope I didn't break anything. 🤞 |
/Users/pierre/Desktop/openfoodfacts-androidapp-2069/app/src/main/res/layout/offline_list_item.xml:10: AAPT: error: resource color/green_700 (aka openfoodfacts.github.scrachx.openfood:color/green_700) not found. |
|
Some of it seems to be related to the move to AndroidX
|
For some reason, I managed to build it and it doesn't crash. The Product view has beed ****, and it seems to be the old one. |
|
New conflicts. The SplashActivity one is tricky for me. |
Description
A prompt to download the CSV file at the start and saving it in
batches
of 15k products to the local database, in order to allow offline scanning.Related issues and discussion
#fixes #2069