App-Inventor-Gallery icon indicating copy to clipboard operation
App-Inventor-Gallery copied to clipboard

Convert apk and source from base64 to binary

Open derrell opened this issue 13 years ago • 1 comments

Currently, images, apk file, and source file are uploaded in base64 encoding. Images remain that way. The apk and source files, however, must be decoded before downloading, and currently that decoding is done when a download request is issued. The decoding process is slow, and it is currently being done for each and every download request.

  • Step 1
    • During the addOrEditApp RPC, when an apk or source file is being saved, base64-decode it, and save the resulting binary in the blob instead of saving the base64-encoded string in the blob
    • Remove the code that base64-decodes apk and source files during a download request (rpc=getdata).

*Step 2 (more easily accomplished after Step 1 than jumping directly to this step)

  • Use an App Engine Push Queue to enqueue requests to decode the files.
  • We will need to discuss the details of this. We'll need a flag (for each of source and apk) that indicates whether the file has been decoded yet. Furthermore, we maintain an array of blob ids, which is a chronologically ordered list of uploaded files. The flag likely needs to also be an array, so that if a new version is uploaded shortly after an old version, each one is separately flagged as to its decode state. The download request (rpc=getdata) will need to look at the flag, and if the decoding has not yet been done, do the decoding as part of the download procedure (as was done before the changes in step 1)

derrell avatar Sep 23 '11 20:09 derrell

#111 should be completed before this issue.

derrell avatar Oct 24 '11 13:10 derrell