Open shankari opened 9 years ago
Assuming you're referring to this screen, Could we instead simply make this a native using a framework like this(iOS) this(Android)? Beneficial for a number of reasons:
NSUserDefaults
due to its low size.To address the reasons you picked the current solution:
I imagine it would be fairly easy to have the backend simply directly send the data it's using to create that HTML rather than sending the HTML itself. And I don't expect implementing this natively would take much time since we have frameworks doing all the heavy lifting.
- What sort of OTA updates did you have in mind? Seems like the purpose this chart fills is quite core to the app.
I was going to switch your result screen automagically on the server to show you, but I don't know which email address you have used to register with e-mission. If you tell me the address, I can do it tomorrow. But basically, by flipping a single field in your profile on the server, I can switch your result screen from the data view to the game view.
Our results are currently computed on the server side and sent over to the client at the following times:
In both these cases, the phone makes a HTTP POST call to the "/compare" endpoint, which returns a HTML page. The page is then displayed in a webview on the appropriate platform.
This was an early attempt by me to work cross-platform, and to:
This works great, but is very slow, so slow that a lot of times, people just don't wait for it to finish loading. Part of the slowness was due to the time taken to compute the results, so I checked in a fix to pre-compute the results daily on the server side. issue: https://github.com/e-mission/e-mission-server/issues/23 fix: https://github.com/e-mission/e-mission-server/pull/25
However, even after that fix, the result view load is slow. I suspect that this is due to the time required to retrieve the associated .css and .js files. I had hoped that these would be cached on the phone, so the retrieve time would be negligible, but it looks like even the version check required to determine whether a new version is available takes time, specially since there are multiple of these checks (see snippet below).
Pre-fetching the results to the phone should move this delay to the background and result in a more responsive UI for the user.
The idea is that you would add this additional POST call to the existing remote sync mechanism
One thing to watch out for: the returned HTML document currently has relative references to javascript code, i.e.
so you would need to parse the returned HTML, issue the appropriate GET calls as well and store those in the appropriate locations on the local disk as well.