Hello Kenneth, No, we dont develop the games that are shown. We screen games that meet our internal standards and list them only. One of these criterion is offline access of complete game after a single load. (Because we are focusing only on super-casual games, this is not a problem at all).
We presently override shouldInterceptLoadRequest() to get the resource list and maintain it locally. And then we use clearcacheForSingleFile(String url)to clear all resources of a game when the user unfavorites a game. *The challenge is in optimizing the favoriting process. * shouldInterceptLoadRequest() being a callback method cannot be used without creating an instance of XWalkView - and that happens only on the UI thread, causing a lag. We want to be able to call a game-URL, get all resource URLs and cache all the resources from the background thread to optimize user experience. On Thu, Aug 27, 2015 at 5:49 PM, Kenneth Rohde Christiansen < [email protected]> wrote: > Hi there, > > One thing that I don't think is clear. Do you control the games that are > shown - like are they build by you or are these existing web games? I don't > see how you can ensure that a game will work offline in the latter case, as > the game may load resources depending on where you are in the game. > > In the best case you would know the resources per game and actually cache > (and potentially later update) using a Service Worker. Service Workers > already work in a separate thread and can notify you when all resources are > ready. > > What is missing would be an API to purge a game and its Service Worker > fetched resources. > > Kenneth > > On Thu, Aug 27, 2015 at 2:13 PM Yashash Agarwal <[email protected]> wrote: > >> We're building an app where users can play casual games, with or without >> internet. Users can favorite the games they like and we'll keep their >> cached files on the device; and, to keep the size of the app optimum, we >> keep clearing all other cached files. >> >> Now, we want to cache resources in the background thread and not in the >> UI thread. We are being able to initialize the XWalkView asynchronously, >> but we aren't being able to create an instance in the background thread. >> >> Here's the use-case: we show a list of games to users and against each >> game, there is the option of favoriting the game. What that is supposed to >> do is make the game available for offline access. But, to actually do that, >> we need the game to be played at least once so that the resources can be >> cached in the first place. What if the user wants to favorite a game, but >> has never played it on that device before? What we are doing now is we're >> creating an instance of XWalkView and running the game on it (keeping the >> activity hidden all this while) so that all the resources can be fetched >> and cached. This causes a bad lag and we want to be able to do this in the >> doInBackground() method. >> >> Any leads would be appreciated :) >> -- >> Yashash Agarwal >> Co-founder >> Gamezop >> >> Remember meeting shy IIT juniors at 2 States book launch, saying sir we >> run a small e-bookstore. I said what's the name. They said Flipkart. ~ >> Chetan Bhagat >> _______________________________________________ >> Crosswalk-help mailing list >> [email protected] >> https://lists.crosswalk-project.org/mailman/listinfo/crosswalk-help >> > -- Yashash Agarwal Co-founder Gamezop Remember meeting shy IIT juniors at 2 States book launch, saying sir we run a small e-bookstore. I said what's the name. They said Flipkart. ~ Chetan Bhagat
_______________________________________________ Crosswalk-help mailing list [email protected] https://lists.crosswalk-project.org/mailman/listinfo/crosswalk-help
