- This topic has 19 replies, 3 voices, and was last updated 10 years, 3 months ago by Darshan Patel.
-
AuthorPosts
-
Darshan PatelParticipantstill the differences in the sizes is luring me…
(btw its not a json file, it is a text file)uncompressed db – 5mb
compressed db – 300kbi am skipping the compression thing for now..
but have one last query please if you have anything to share on this,
is there any way through which i can unzip my file at the time of installation or on first run without affecting the performance of app? like the uncompression process running in background or somethingthanks,
Darshan
support-michaelKeymasterwow! 96 percent compression
>is there any way through which i can unzip my file at the time of installation or on first run without affecting the performance of app like the uncompression process running in background or something
Yes, on first launch your app could:
1) make an ajax call (async) to retrieve the bundled compressed data file
2) uncompress the data file to memory or the app’s file system
3) process the uncompress data file from its readable src (memory or file system)I don’t know the javascript decompression libs very well but you should be able to find or adapt something that can stream the compressed data directly to an output stream to the file system.
Alternative Approach
For some reason I assumed the data file was in json format and that you only need this data file on the 1st launch of the app. You could possibly simplify the runtime concern by packaging as a compressed json file. Imagine preprocessing the db’s initial data and the sql loading logic into a single json file. Compress it with gzip and bundle it in your app. Then on 1st launch of your app load the data file, letting the browser’s resource loading logic automatically handle decompression, reading and execution without any special runtime logic other than the ajax request.
Darshan PatelParticipantyes!! know you see why i was so much behind the compression thing!!
but i am currently putting the compression thing on the hold… will do it later
and i have gone thru many libs… some r useful(but not as way you want it) and some are scrap..
btw how to run a specific code on first launch??
is there a predefined method?(i dont know this) or we have to implement a logic.. (i know this)
support-octavioMemberHi,
You can either set a flag and save it in local storage or check for the absence of some application state that will exists after 1st launch.
>or we have to implement a logic.. (i know this)
You should implement your login in the phoneui.documentReadyHandler() function in the <appname>_custom.js file.
Darshan PatelParticipantyes.. thats what i had in my mind… thanks..
-
AuthorPosts