NeoLocalStorage Fail and Default LocalStorage Limited - Forum

Forum Navigation
You need to log in to create posts and topics.

NeoLocalStorage Fail and Default LocalStorage Limited

Hi again everyone

I need a permanent storage for my app (small android game) and default localstorage function works fast and sharp. but it has limits of 5MB data... (i need alot more)

I used plugin NeoLocalStorage (exactly same project) i just changed "localstorage..." functions with "neolocalstorage.." functions...
App failed to work and crash and takes so long to load (read and write data).

It's like NeoLocalStorage need some time (few seconds) to store or read data when default storage function is instant!

You can try a Loop command and write and read lot of data using both functions to see what I mean ,or maybe i can make a sample project?...

A Sample app added to this post, if you check it you will understand what I'm talking about...

@luishp

Uploaded files:
  • You need to login to have access to uploads.

Or use this one with random read. (Attached)

Uploaded files:
  • You need to login to have access to uploads.

@noyzen please use Refresh command to be sure the value is available as soon as possible:

RandomEx 1 10000 [raaa]
neoGetItem "test_item_[raaa]" [data_show_2] ""
Refresh

Or even better add the Refresh command within the Callback subroutine.

Regards

Thanks for reply Luis, but that fail also.

(you can try with my sample app)

Refresh command change nothing and data still fail to load...

Default LocalStorage Function works fast is there any way to increase 5MB limit?

Or maybe someone can make a WebSql plugin?

@noyzen

In my tets it seems to happen the first time you retrieve a value from a big list. Next ones seem to respond quite quickly.
Note that neoLocalStorage plugin is based on LocalForage library:

https://localforage.github.io/localForage/

It uses IndexedDB or WebSQL where available. LocalForage includes a localStorage-backed fallback store for browsers with no IndexedDB or WebSQL support. Asynchronous storage is available in the current versions of all major browsers: Chrome, Firefox, IE, and Safari (including Safari Mobile).

Perhaps you can ask the author.

Regards.

noyzen has reacted to this post.
noyzen

I found this info in the link,

SETDRIVER

// Force localStorage to be the backend driver.
localforage.setDriver(localforage.LOCALSTORAGE);

// Supply a list of drivers, in order of preference.
localforage.setDriver([localforage.WEBSQL, localforage.INDEXEDDB]);

setDriver(driverName)
setDriver([driverName, nextDriverName])

Force usage of a particular driver or drivers, if available.

By default, localForage selects backend drivers for the datastore in this order:

  1. IndexedDB
  2. WebSQL
  3. localStorage

If you would like to force usage of a particular driver you can use setDriver() with one or more of the following arguments:

  • localforage.INDEXEDDB
  • localforage.WEBSQL
  • localforage.LOCALSTORAGE

And:

CONFIG

// This will rename the database from "localforage"
// to "Hipster PDA App".
localforage.config({
name: 'Hipster PDA App'
});

// This will force localStorage as the storage
// driver even if another is available. You can
// use this instead of `setDriver()`.
localforage.config({
driver: localforage.LOCALSTORAGE,
name: 'I-heart-localStorage'
});

// This will use a different driver order.
localforage.config({
driver: [localforage.WEBSQL,
localforage.INDEXEDDB,
localforage.LOCALSTORAGE],
name: 'WebSQL-Rox'
});

Where i can find config file, and how i can use javascript commands to change and force websql or IndexedDB or other options?

Can you help me on that?

With this JavaScript code i changed the default driver from IndexedDB to WebSql

BeginJS
       localforage.setDriver([localforage.WEBSQL, localforage.INDEXEDDB]);
EndJS

But sadly websql is even more slow than indexedDB and still Limited LocalStorage is faster.

Also I found some interesting info! > when I set neoLocalStorage driver to "localstorage" driver, its still slower than default VisualNeo LocalStorage function!

Seems like LocalForage or neoLocalStorage plugin inserting some delay into read and write command...

a Sample App attached to this post, again.

Uploaded files:
  • You need to login to have access to uploads.