How to handle offline mode for Google visualisation in GWT - google-maps-api-3

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!

Related

Flitter Firebase multi language

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?

Check if the offline map available

I am working on an Android app with Here map sdk, and the MapLoader works fine for me to manage the offline maps, but in case of no network connection, how can I check if a specific map is installed or not ? Because in such case, the app can not retrieve the package lists anymore. Can the app check the device directly instead?
many thanks!
This is currently a limitation of the MapLoader API. It requires a data connection to retrieve the latest catalog. One suggestion is to store / serialize the MapPackageSelection in the application so you can keep the installation state.

Can we customize the onSave handler in Aviary?

I have tried on the Aviary SDK, is a amazing images editor tools for developer. It really save our time to develop all the function for images edit.
But, one concern about the onSave handler, Aviary will send the edited image to their cloud server, and host it for 72 hours. Therefore, am I right to say we have to make sure our apps has connection with the Adobe cloud? This cloud be a problem if abode cloud service down or Adobe stop the service?
So, anyway to customize the 'onSave' handler for Aviary?
Thanks.
Found that if we using the Android SDK, we are able to set the withOutput, which is
withOutput(Uri)
- Sets the output location where the edited image will be saved.
But no idea for web version, for the onSave method.

Real time collaboration with CodeMirror

I started this little project where I would do real time collaboration on code using CodeMirror.
I have a msgs system setup such its easy to pass objects from one user to another. My problem is getting it integrated with CodeMirror. I found out that it have events for onchange and a replaceRange(string, from, to).
I pass the onchange objects to the other users and uses the replaceRange to update the view. Problem is then when using replaceRange, it triggers an new onchange and it sends msgs back and forward. Anyone know if there are some way of updating the local view without it triggering an onchange. Or suggestings for other paths to take. (the msgs system is already set up and its easy to pass javascript objects to other clients).
You Can Use Firepad
FirePad is an open-source (on GitHub) realtime collaborative plug-in to codemirror. You can get it setup with codemirror in 4 extra lines of code and a few minutes. It's uses Firebase for the backend.
To get this to work properly, you'll have to merge changes as well. See http://ot.substance.io/ for a demo of an open-source solution (also using CodeMirror).

Flex Write File

I checked in the API, that writing a file is only in Flex Air.
Despite of that, is there still a way in Flex to write a file on the server or on the client machine ?
More concretely, it's because I have a String and I will decode it by mx.utils.Base64Decoder
to a doc. And I need to open it by Word directly on the client side, or write it on the server and return the link to the client for downloading.
Thanks
I'm doing something similar - I have built a custom grid in Flex that contains an additional button on it that allows the user to open the data up in Excel. I've done this by writing a function in PHP on the server which my Flex speaks to. This creates the CSV file on the server and the function passes the link back to the client, which in turn offers the user the chance to open the data up in Excel.
I'm using the Zend technologies to accomplish this - I recommend you take a look; they're extremely good. I used to use Flex Data Services and Java do do this but just recently switched to PHP because development time is cut down drastically as a result.
Hope this helps.
Jamie.
AIR applications run on the users' desktops. They allow you to write to the users' desktops. Nothing stops Flex/AIR applications from communicating to the server, write some files there (using a suitable backend technology) and return a link back to the user.

Resources