Javascript string length limited in Android Phonegap application
Let's say we have the simple Phonegap Android hybrid application. My code
follows guide by android.com here (creating native Anroid app) and by
Adobe here (putting Phonegap in the native app, making it hybrid).
We put the below code to desmontrate the length of a javascript string
variable. var s = '';
for (var i = 0; i < 300001; i++) {
s+= i + ' ';
}
console.log(s);
throw "ME EXIT";
The source code is the Android SDK/ADT bundle project and run in 2 modes
Run as an Android application via Eclipse Run as command
Run as a pure/non-Phonegap web page via XAMPP local web server
For pure web (case #1), the string got all number 0-300,000 as we expect.
While for hybrid app (case #2), the string stopped at 1033 as below snapshot.
My question is is it true that in a hybrid app, javascript string gets
limited like that?
No comments:
Post a Comment