function init_ldb(fName) {if (fName=="job") theLdbData = localStorage.jobselse if (storageName=="cust") theLdbData = localStorage.customerselse if (storageName=="prod") theLdbData = localStorage.products
else ....
// ...}
function init_ldb(fName) {theLdbData = localStorage.fName// ...}
--
You received this message because you are subscribed to the Google Groups "iPhoneWebDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iphonewebdev...@googlegroups.com.
To post to this group, send email to iphone...@googlegroups.com.
Visit this group at https://groups.google.com/group/iphonewebdev.
For more options, visit https://groups.google.com/d/optout.
If you have dozens of Mb of datas, then LocalStorage is a dead end. It has been designed to be a local cookie (aka not available server-side, so not sent in every http request). So just to store a string or two (username, json string of params, ...), not megabytes of text.IndexedDb is the (only) right way to go. It’s a totally crappy over-engineered noSql beast, but that’s the only option we have nowdays...Longer answer here : https://softwareengineering.stackexchange.com/a/219964
The install prompt is a new spec only available on Google Chrome. It uses a web manifest json file to do it. Then all the rest that makes a “progressive webapp” (PWA) is a set of new html5 features like service workers, push api, ...For Safari (iOS), standalone mode still exists, but you have to implement this “add to homescreen” prompt yourself.
Scramblers? Are you looking for a way to minimize your JS/CSS file size or to really encrypt them?
What about eval() ? It’s pretty unpopular those days but surely doing the job.Or you can just call localStorage as an array.function init_ldb(fname){return (fname!=“”)?localStorage[fname].toString():null;}But then, “fname” must match your localStorage object name (customers, products, jobs,...)
Another question.I use GET or POST in the communication between the app and the server. It happens that the server points out that my URL is too long (I don't remember if it is using GET or POST or both). This happens particularly when I have a report (it may consist of several pages) in my app and want to send it (via the server) to my email box. (As soon as I get the info to the server I have a simplephp script that takes care of the emailing.)
Any suggestions?
I've got Kb:s in my LDB now and no problem so far. - I couple of years ago I stumbled somewhere over a code of a simple local database, but I can't find it anymore.
The install prompt is a new spec only available on Google Chrome. It uses a web manifest json file to do it. Then all the rest that makes a “progressive webapp” (PWA) is a set of new html5 features like service workers, push api, ...For Safari (iOS), standalone mode still exists, but you have to implement this “add to homescreen” prompt yourself.We need to find a better way - really easy for the user.
Scramblers? Are you looking for a way to minimize your JS/CSS file size or to really encrypt them?Encryption. Encyption of especially the code but also the database.
What about eval() ? It’s pretty unpopular those days but surely doing the job.Or you can just call localStorage as an array.function init_ldb(fname){return (fname!=“”)?localStorage[fname].toString():null;}But then, “fname” must match your localStorage object name (customers, products, jobs,...)Hmmmm... interesting...great! I'll try that.I handle the LDBs a strings, and then split them with ("fileEnd" in the communication with the server) "postEnd" and "fieldEnd". Getting them back into one string for each data file is a peace of cake.
Another question.I use GET or POST in the communication between the app and the server. It happens that the server points out that my URL is too long (I don't remember if it is using GET or POST or both). This happens particularly when I have a report (it may consist of several pages) in my app and want to send it (via the server) to my email box. (As soon as I get the info to the server I have a simplephp script that takes care of the emailing.)Any suggestions?
Remi
I've got Kb:s in my LDB now and no problem so far. - I couple of years ago I stumbled somewhere over a code of a simple local database, but I can't find it anymore.Less than a Mb you should be fine.
Mozilla LocalForage ?
The install prompt is a new spec only available on Google Chrome. It uses a web manifest json file to do it. Then all the rest that makes a “progressive webapp” (PWA) is a set of new html5 features like service workers, push api, ...For Safari (iOS), standalone mode still exists, but you have to implement this “add to homescreen” prompt yourself.We need to find a better way - really easy for the user.Chrome’s Web Manifest is the easiest way to go then. You need https for that btw.
Scramblers? Are you looking for a way to minimize your JS/CSS file size or to really encrypt them?Encryption. Encyption of especially the code but also the database.Code & data encryption is two very different things. First should rely to some serverside mechanisms.
Second is something you should code. Basic way is to encrypt & decrypt based on user´s credentials. This means at some point you need a login screen.
Note that both will come with some performance cost.
What about eval() ? It’s pretty unpopular those days but surely doing the job.Or you can just call localStorage as an array.function init_ldb(fname){return (fname!=“”)?localStorage[fname].toString():null;}But then, “fname” must match your localStorage object name (customers, products, jobs,...)Hmmmm... interesting...great! I'll try that.I handle the LDBs a strings, and then split them with ("fileEnd" in the communication with the server) "postEnd" and "fieldEnd". Getting them back into one string for each data file is a peace of cake.Not sure i get it but if this works for you, fine :)
Another question.I use GET or POST in the communication between the app and the server. It happens that the server points out that my URL is too long (I don't remember if it is using GET or POST or both). This happens particularly when I have a report (it may consist of several pages) in my app and want to send it (via the server) to my email box. (As soon as I get the info to the server I have a simplephp script that takes care of the emailing.)Any suggestions?No limitations on POST except server side conf. Mostly 2mb by default btw.You should definitely use POST anytime.A GET request will hit the 2kb limitation, with other issues like special chars encoding, req cache & others...
I've got Kb:s in my LDB now and no problem so far. - I couple of years ago I stumbled somewhere over a code of a simple local database, but I can't find it anymore.Less than a Mb you should be fine.Great! - I had been wondering/worring about what would happen with the LBD growing and when the customer would be reaching the limit. I can check that it won't grow bigger than ex. 1Mb and then start sending the rest to the server to be stored, no problem, but it would be too easy, too dull and wouldn't react to devices that are getting bigger, more intelligent and faster for each year. - What if I would check how long a time it takes to read/write a file in the LDB? It should be possible? Measuring the responce time in 1/1000 secs??
Mozilla LocalForage ?Don't know. I'll look into it... maybe... if I haven't already found the solution.:)
The install prompt is a new spec only available on Google Chrome. It uses a web manifest json file to do it. Then all the rest that makes a “progressive webapp” (PWA) is a set of new html5 features like service workers, push api, ...For Safari (iOS), standalone mode still exists, but you have to implement this “add to homescreen” prompt yourself.We need to find a better way - really easy for the user.Chrome’s Web Manifest is the easiest way to go then. You need https for that btw.GREAT! (Yea, I found out about the neeed of SSL the hard way.)
Scramblers? Are you looking for a way to minimize your JS/CSS file size or to really encrypt them?Encryption. Encyption of especially the code but also the database.Code & data encryption is two very different things. First should rely to some serverside mechanisms.Yes, of course, code and data encryption are different things. - Google used to have http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/aes.js which I used for encrypting the LDB. I think I can find/do something similar and hide it (the key) as well as possible in my code.
What about Google Closure Compiler (https://developers.google.com/closure/compiler/?csw=1). Any experience of that?
Second is something you should code. Basic way is to encrypt & decrypt based on user´s credentials. This means at some point you need a login screen.User's credentials? - Do you mean username and password (and 40 alfanumeric user Id which is for internal use only)?Login screen? - Yes, I use a login screen. And the user's email address is also verified, since he/she with a click is able to send a report to his/her email address.
Note that both will come with some performance cost.Great you mention that. I however use the server very little. Insteda I use almost completely the local device.
I use GET when I'm checking the code and afterwards I use POST.
Thanks a million!Rune
--
You received this message because you are subscribed to the Google Groups "iPhoneWebDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iphonewebdev+unsubscribe@googlegroups.com.
Key should be set by the user on login.Never stored in your code. If you store the decryption key in the code, then don't bother encrypt data.
Note that both will come with some performance cost.Great you mention that. I however use the server very little. Insteda I use almost completely the local device.I was referring to client side (local) performance :) (and at some point, battery usage).
GET comes with url encoding issues you won't have with POST. POST can also integrate file binary (file upload) GET cannot.
This rose a lot of questions, until I checked your link below. (I haven't checked the code as yet.) So you use the password as the key AND you don't store the password locally, at least not locally. - Right?
Note that both will come with some performance cost.Great you mention that. I however use the server very little. Insteda I use almost completely the local device.I was referring to client side (local) performance :) (and at some point, battery usage).Thanks for the specification!GET comes with url encoding issues you won't have with POST. POST can also integrate file binary (file upload) GET cannot.Interesting. Do you mean I can pass ex spaces as such with POST?!? (I started out with GET, and found a work around, and never thought of the matter when I changed to POST)