publicado originalmente en:BungieNetPlatform
[quote]# Downloading the Manifest
for a mobile app i would assume you should download re-usable data to save requests and thus bandwidth.
i would let it compare the version (online/ downloaded) and if it needs to download do this in an asyncTask.
how is this properly achieved? any libraries you would propose for this?[/quote]For checking for a new version you could:
a) on starting the app or at some interval, make a HTTP request to "www.bungie.net/platform/destiny/manifest"
b) compare the version in the response with the version of the manifest you have locally (if one at all)
c) retrieve the manifest file - the one you will probably want/need is Response.mobileWorldContentPaths.en
d) Unzip the file (as it is compressed) and you will have an SQLite database with the content you can then query
I have the equivalent of that in PHP at the moment which you can probably translate to Java. Let me know if anything's not clear.
[url=http://pastebin.com/J2eeWJ7Z]Cola\Bungie\Destiny\Manifest\Version[/url]
[url=http://pastebin.com/d2YQ9AFe]Cola\Bungie\Destiny\Manifest\Manifest[/url]
Note for anyone else using PHP: directly importing these files into your project won't work. You'll need to modify them by hand.
English
-
Update: I've fixed a bug in the Version class and updated it (you'll still need to modify a few things). Use it like this: $newVersion = new Version('44675.15.04.03.2157-5'); $oldVersion = new Version('44675.15.04.03.2157-4'); if($newVersion->CompareTo($oldVersion) > 0){ //new version is newer } echo $newVersion; //44675.15.04.03.2157-5 $newVersion[1] = 16; echo json_encode(array('v' => $newVersion)); //{"v":"44675.16.04.03.2157-5"} ...and so on.