You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 4, 2019. It is now read-only.
I realize that this is not really a big issue, but by factoring out the repetitive SQL insert statements in the Weather stationsList.js files, this file size could be cut down by approximately 50% i believe. For example:
var stationsList = ["insert into StationList (latitude, longitude, xml_url) values (-22.017, 166.217, 'NWWW');",
"insert into StationList (latitude, longitude, xml_url) values (-21.233, -175.15, 'NFTF');",
........
];
By removing the continuously repeated string in the statement, you can then place it once in the following block:
for (var i=0; i<arrLength; i++) {
tx.executeSql('insert into StationList (latitude, longitude, xml_url) values ('+stationsList[i]+');', null, incrementPercent);
}
The result would be a much smaller file size. As I previously mentioned, this may not be of much importance but it does cut down file size which in my opinion is always a good thing!
The text was updated successfully, but these errors were encountered:
Great suggestion! I agree - if you can reduce the size of resources without impacting the quality/function of an app - its a win win for everyone.
I've been wanting to see that sample refactored & improved to better support PlayBook & BB10. Your tip should be considered when that work happens (no ETA).
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I realize that this is not really a big issue, but by factoring out the repetitive SQL insert statements in the Weather stationsList.js files, this file size could be cut down by approximately 50% i believe. For example:
var stationsList = ["insert into StationList (latitude, longitude, xml_url) values (-22.017, 166.217, 'NWWW');",
"insert into StationList (latitude, longitude, xml_url) values (-21.233, -175.15, 'NFTF');",
........
];
By removing the continuously repeated string in the statement, you can then place it once in the following block:
for (var i=0; i<arrLength; i++) {
tx.executeSql('insert into StationList (latitude, longitude, xml_url) values ('+stationsList[i]+');', null, incrementPercent);
}
The result would be a much smaller file size. As I previously mentioned, this may not be of much importance but it does cut down file size which in my opinion is always a good thing!
The text was updated successfully, but these errors were encountered: