11-07-2011 05:39 PM
Hi, I'm having a weird issue:
I developed an application using database for storage. When running on OS5 everything was going fine and even on OS 6 it was ok until I tested it using OS 184.108.40.2064.
My code goes like this:
objDB = openDatabase("MyDatabase","1.0","MyDatabase", 5*1024*1024, null);
I tried simulators OS 220.127.116.111, OS 18.104.22.1686, OS 22.214.171.124 and works ok, but it fails on OS 126.96.36.1994. I traced my code and found that it stops before the database line. Simulators goes blank, it kind of freezes itself but then later (10 secs) quits the application. Any ideas?
11-08-2011 09:26 AM
I don't believe in 6.0+ you actually need to have a memorycard present.
Also I've often seen bugs when you pass in null for the creation callback, try passing nothing at all like this
card')) objDB = openDatabase("MyDatabase","1.0","MyDatabase", 5*1024*1024); else alert('No SDCard');
11-08-2011 01:07 PM
Thanks for the advice,
I tried your suggestion but behaviour is the same.
I've compiled using webworks sdk 2.0 and 2.2
Also, I'm including html5ToGears in the project.
I've noticed that on emulators using OS lower than 188.8.131.524 works fine but higher than that doesn't work.
11-08-2011 01:30 PM
You do not need to include html5ToGears, as in the new SDKs it will automatically be injected and used if necessary.
As per logging, there are alot of ways from alerts, to webInspector (on 7.0) to modifying the dom to java logging using thiscommunity API
Have you seen the bug on device or only on simulator?
11-08-2011 01:44 PM
I've seen it on devices too.
I'm including html5ToGears because the same widget will be used on OS5 as well on OS6 devices.
I tried running your Weather app example and behaviour is the same, it shows the loader but never reachs the next screen.
I tried using simulator's clean.bat file but without success. Is there any file logging what is going on with the simulator ? Like a debugger?
I would really appreciate any thoughts on this,
11-08-2011 01:52 PM
...I just realized you said html5ToGears ... you're implementing in gears and NOT html5... May I ask why?
The weather app is currently broken. There are problems with both its DB and the weather service it uses. We are in the midst of making fixes and posting new samples.
I have tested the code you posted in an onLoad event and had no problems on a 9800 running 184.108.40.2064. It must be something you're doing with the database, if you post more code maybe I can help more.
There are several debugging options but I would highly reccomend weinre as it should work 5.0+
11-08-2011 02:02 PM
I'm using gears to be sure it will run on OS 5 devices, as this article suggest:
If I use webworks sdk 2.2 for compiling, can I let html5toGears out and still give support to OS5 devices? That would be a relief ...
11-08-2011 02:19 PM
Actually I'm sorry but you will need to continue adding the file. See we wrote 2 shims HTML5->Gears and Gears->HTML5. We automatically injuect Gears->HTML5 so that HTML5 works from 5.0+.
If you wish to continue developing in GEARs (although I'd highly reccomend switching to HTML5) you will need to keep adding the file.
11-08-2011 02:42 PM
I see, is there any doc about storage using HTML5 and not gears? I will switch as long as I can run the application on OS 5 and OS 6.
Where can I find the other shim from Gears->HTML5 ?
Thanks in advance,
11-08-2011 02:52 PM
HTML5 Databases are documented all over the internet, but we have some reasonable docs too - https://bdsc.webapps.blackberry.com/html5/apis/Dat
As per the shim, so long as you use the newest SDK it will automatically be added for you no need to do anything.