Flitter Firebase multi language - firebase

I'm developing an application using Flutter and Firebase.
I need to support multiple languages and I was wondering about what is the best solution to do that... Can I keep the strings in Firebase and fetch them without downloading them each time I need?
When the user select a language the first, usually it does not change, but sometimes it could.
Thanks!

I can't understand why you want to use multi-languages feature using Firebase.
In any app at least there are static texts.So at least for that part you don't need the translation stored in the Firebase (performance issue). I suggest to have a look at this package easy_localization : https://pub.dev/packages/easy_localization
Why you should use static translation:
when using non static translation (downloaded from Firebase) :
You have to download the translations : App does work only if connected to network (at least first time or after user clear the cache of the application)
You have to cache the result : using shared_preferences
You have to fetch the translations from cache every time.
If you still insist about using Firebase.You can see a similar question for android (answered by GDE): Firebase Multi-Language support: Is possible?

Related

Firebase Storage and Glide - Signature

When using glide to load images from firebase storage, is there a possibility to check metadata of the file to make sure that the current cached edition is not outdated? In my usecase, i sometimes update files within a static reference. This used to be an easy option for me until caching of glide came into play. It keeps showing the cached version, not knowing that theres new data in storage under that ref.
I know that i can switch off caching. What i would like to achieve is to check metadata first and then load from cache if the data is still current. I have seen the .signature option in glide an was wondering if it is working somehow with firebase but couldnt find anything.
There is no simple configuration for this. You will have to write code that uses the Firebase SDK to get the metadata and check it yourself. Based on the result of that, you will then have to use Glide's API to invalidate the cache as needed. I'm sure it will be a non-trivial amount of code.

Changing firebase data model (while multiple app versions are in production)

What's the best way to change the Firebase data model while you have multiple versions of your iOS app in production?
Since there's no 'application server' layer in the middle any changes in the database model could break older versions of the app.
Performance Related Example of the problem:
In version 1.0 I was naively keeping everything related to a post under '/posts/'. Now in version 2.0 I want to take Firebase's recommendation and add a '/user-post' endpoint to quickly list all posts for a given user.
People using version 1.0 of the iOS app are not writing any data to '/user-posts' since that endpoint didn't used to exist. People using version 2.0 therefore don't see any posts created by people using the old version of the app.
In theory I could create a server somewhere that listens for changes on '/post/' and adds them to '/user-posts' as well. That seems hard to maintain over time though if you have a lot of different versions of your app.
New Feature Example of the problem:
Lets say in version 1.0 of your mobile app you write new blog posts to '/posts/'. Now in version 2.0 of your app you introduce a Teams feature and all posts need to be in '/team/team-id/posts'.
People who haven't upgraded to version 2.0 will still be writing to '/posts'. Those posts won't be visible to people using version 2.0 who are reading from '/team/team-id/posts'.
I realize you could keep both endpoints simultaneously (and index /posts based on team ID) but over time this seems hard to maintain.
Traditional solutions:
If I were using something like Django or Express I'd do a database migration and then update the server-side endpoints for creating blogposts.
That would make changes in the database from the clients. I could in theory add an application-server tier to my architecture with Firebase, but that doesn't seem like it's recommended: https://firebase.googleblog.com/2013/03/where-does-firebase-fit-in-your-app.html
I would suggest you use Firebase Remote Config to show an alert via UIAlertController or different screen if an update is available. You could force the user to update to the current version and you don't have problems later because no posts with the old code can be created.
To answer your question:
I would develop a different app, add it to the same Firebase project and then let this app convert all old data to the new data model. So you would do this one time after releasing the new version and the old user data is converted to the new data model and everything works smoothly. You could also have a property like databaseVersion for every object.
To prevent future problems you could have a general property named app-version in your Firebase Realtime Database. Before every post the app checks if there is a newer version. If not the user can add the post but if there is a newer version you could show an message/alert via UIAlertController

Initialization of local sync store in Azure's offline-sync API

I'm working with Azure's offline-sync API.
(It's REALLY GREAT so far, but since it's still new-ish it doesn't have comprehensive documentation, only tutorials. We need to craft dependable integration tests, and we're finding that tricky because we need to rely on published behavior in official docs for that... or dig into the source, but that is liable to change at any time.)
The samples do this:
var store = new MobileServiceSQLiteStore("localstore.db");
The comments mention "initializes local store".
I assume the local sync database is a "throw-away" asset, as it can be recreated at will.
Is the expected behavior that it will create the local SQLite file if it does not exist, or it will recreate the file each time the mobile app starts and that call is made?
The tutorials are augmented by the HOWTO documentation (available under Mobile > Develop - in the same area as the tutorials) and the GitHub Wiki and the github.io pages for the SDK.
The local store is created if it doesn't exist, and new fields are added to tables if they are needed. It's sometimes good to delete the database - for example, if you reduce the field count in your mobile app (the process only adds fields). If you do this, the database will be re-created when the app is next restarted.

How to handle offline mode for Google visualisation in GWT

I have a GWT application that uses many Google maps and charts. I want to have an offline mode where the user have the application installed on his the computer and without using the Google apps, he can continue using the other features.
For now the maps in the application throught a nullpointer error because they cannot initialize. I thought about checking the internet connection in EntryPoint and change the behaviour accordingly, but I am hoping for a simpler solution. Any thought ?
per https://developers.google.com/chart/interactive/faq#offline
You cannot do that:
Can I use charts offline?
No; your computer must have live access to http://www.google.com/jsapi in order to use charts. This is because the visualization libraries that your page requires are loaded dynamically before you use them. The code for loading the appropriate library is part of the included jsapi script, and is called when you invoke the google.load() method. Our terms of service do not allow you to download the google.load or google.visualization code to use offline.
Can I download and host the chart code locally, or on an intranet?
Sorry; our terms of service do not allow you to download and save or host the google.load or google.visualization code
Update
I thinks the terms and conditions are changed now. As you can save and download JsAPI, ServiceBase to use charts offline.
But you still can't make ajax calls :Ajax
Hope it will be available soon, cheers!

Is there any open source folder/browser/creator for Azure Blob Storage?

We are looking to create a document management area that models a standard folder structure using Azure blob storage in an MVC3 applicaiton.
E.g.
Users can create folders
User can upload documents to folders
Users can list directory contents etc
Users can delete documents
Users can download documents
Now I appreciate Azure Blob storage only has containers and the rest is faked by slashes creating paths. However this sort of functionality seems like the sort of thing someone else must have created?
I did some searching but coultn't find anything. Basically something like CloudXplorer or Azure Storage Explorer but web based
Does anyone know of any azure blob storage implementation with web front end (ideally MVC)?
You can start looking at BlobShare, an MVC application which allows you to upload, download, view, share, ... blobs:
However, for the sorting part you'll need to build something yourself. I would personally consider using the Windows Azure Caching (Preview) to do this; whenever you access a 'directory', cache the blobs in that 'directory' and do the sorting based on the data in teh cache (same applies to paging). And use something like Service Bus Topics / Queues to refresh the cache whenever someone adds/deletes/renames/... a blob (+ timeout for directories not accessed in X minutes).
I also found this sample. http://peterkellner.net/2010/11/12/azure-storage-treeviewer-directory-browser/. It isn't web based but seems to create a basic tree structure and displays it. There is also related discussion here http://social.msdn.microsoft.com/Forums/en-US/windowsazuredata/thread/256cfc0f-bccc-4bf7-b7eb-cb7c7aca0c8a
See my answer over here https://stackoverflow.com/a/65944680/7988162 on how to use the Storage Explorer across all platforms.
Hierarchical blob storage now exists through Data Lake Storage Gen2. Check out documentation here.

Resources