XDK .apk & Local Storage not working.

Get help using Construct 2

Post » Wed Dec 02, 2015 2:41 pm

Ok, so I have my app loaded onto Google Play. I have it in closed beta.

I've exported to Cordova, loaded the project into XDK and pushed the build to the server.
When I run my app from app preview (Server App) on my Android device, local storage works as intended.

So I do a Crosswalk build with XDK on the desktop, download the .zip files and then upload the .apk's to Google Play. I then download it via the play store download link and put it on my Android device... local storage doesn't work... at all.

Any ideas?


Is it maybe because I'm running it with app preview and have it installed as an app?
Do I need to add any of the Cordova plugins to XDK?
I'm attempting a non-Crosswalk build now but it'll be a few hours before Google makes it available. Could Crosswalk an Local Storage be an issue?
Last edited by Fengist on Wed Dec 02, 2015 4:53 pm, edited 1 time in total.
B
15
S
5
Posts: 124
Reputation: 1,687

Post » Wed Dec 02, 2015 3:41 pm

I have no problems with LocalStorage on Crosswalk ...
B
32
S
7
G
4
Posts: 396
Reputation: 4,587

Post » Wed Dec 02, 2015 3:52 pm

I don't either as long as I don't run it as an app installed from Google Play.

Even the XDK emulator is reading the local storage properly.

I did notice one thing though, when I built as an Android app the .apk size was like 2meg. As Crosswalk 20+ meg. Huge difference.
B
15
S
5
Posts: 124
Reputation: 1,687

Post » Wed Dec 02, 2015 4:05 pm

Fengist wrote:I don't either as long as I don't run it as an app installed from Google Play.

Even the XDK emulator is reading the local storage properly.

I did notice one thing though, when I built as an Android app the .apk size was like 2meg. As Crosswalk 20+ meg. Huge difference.


It might be an issue with local storage in combination with the webview..
The Crosswalk export should however have no issues, because of the built in Chromium-browser..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Dec 02, 2015 4:15 pm

LittleStain wrote:It might be an issue with local storage in combination with the webview..
The Crosswalk export should however have no issues, because of the built in Chromium-browser..


Ok, the webview I'm not familiar with.

I do know that when I run the app in the XDK debug I can see the local storage keys and values. They look correct there too.

Anytime the user changes an option, I'm saving it to a key in a dictionary and then immediately saving that dictionary as a .json through local storage. When the app starts up, local storage looks for the key/value for the .json and loads the dictionary from that. This method is obviously working in other settings.

I also have a browser.close to exit the app. Before it closes, I check to see if local storage is processing sets and if it is, I have it wait 1 second and check again. If not, it closes the app.

Could Google Play be somehow blocking the loading/saving of .json files??? None of this really makes sense to me.

And I just got the Android-crosswalk build onto the device and still, no Local Storage

And, though IAP isn't working in the Chrome Web Store so I have it in closed beta, I uploaded a Chrome Web export and, the local storage is working there as intended.
Last edited by Fengist on Wed Dec 02, 2015 4:33 pm, edited 1 time in total.
B
15
S
5
Posts: 124
Reputation: 1,687

Post » Wed Dec 02, 2015 4:28 pm

Fengist wrote:When I built as an Android app the .apk size was like 2meg.


This uses Webview

Fengist wrote:As Crosswalk 20+ meg. Huge difference.


This uses a built in browser and the browser is what makes the file big..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Dec 02, 2015 4:39 pm

LittleStain wrote:This uses a built in browser and the browser is what makes the file big..


Ok, I'll have to do some studying to find out which is best for my needs. It seems the Webview .apk is running a lot faster and smoother (which shouldn't be a surprise now that I now the difference.)

But, speed does me no good if it can't save data.
B
15
S
5
Posts: 124
Reputation: 1,687

Post » Wed Dec 02, 2015 4:52 pm

Ok, it's not Google Play, it must be somewhere in XDK. I just e-mailed the .apk to my Android device, ran it and... no local storage. But it does work when I push the build and run it from App Preview. I'm confused.

Everything seems to run fine util I build the .apk. I haven't added any plugins in XDK. Is there one I should be adding specifically for Local Storage? None of the others seem to apply to anything I need except perhaps File and XDK file.
B
15
S
5
Posts: 124
Reputation: 1,687

Post » Thu Dec 03, 2015 11:42 am

Anyone? I'm at a dead stop here and out of ideas.
B
15
S
5
Posts: 124
Reputation: 1,687

Post » Thu Dec 03, 2015 12:06 pm

Fengist wrote:Anyone? I'm at a dead stop here and out of ideas.


Did you try if exporting to crosswalk works?
(if you want to support devices with android below 4.4 you'll probably need it anyway)

Like I said, maybe the webview of your device doesn't support local storage..
This would mean inside IntelXDK preview it works, because they assume your device supports it..

If all doesn't work, I found this on the interwebs:

On this site:
Local Database IntelXDK
It says:

What if WebView doesn’t support IndexedDB?
Some browser don’t support IndexedDB. So you can include third-party IndexedDB plugin in your app. This plugin adds support for IndexedDB.

That plugin can be found here:
Cordova indexedDB
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Next

Return to How do I....?

Who is online

Users browsing this forum: conker23, Janaina, LaurenceBedford, lucaralho, morgandood and 5 guests