Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Highlighted
Regular Contributor
Posts: 60
Registered: ‎03-07-2011
My Device: Not Specified
Accepted Solution

Webworks app freezes on PlayBook UNLESS Web Inspector is running...

Has anyone else experienced this?  My Webworks app will freeze at certain points without fail.  However, when I run the Web Inspector (the app is always compiled with the -d ) I am unable to replicate the problem because the app works perfectly (as it also does in Chrome).  The app itself is not overly complex, so I don't know why it would hang.  As there seemed to be a link to Web Inspector, I tried compiling without the -d switch to see if the app would run, but it still hangs in the same spots.

 

Any help would be appreciated.  Thanks in advance.

Regular Contributor
Posts: 60
Registered: ‎03-07-2011
My Device: Not Specified

Re: Webworks app freezes on PlayBook UNLESS Web Inspector is running...

UPDATE--upon further testing, what I notice is that my app runs fine the first time it is run (whether or not Web Inspector is running), but if I close the app and then open it again, the Javascript seems to stop working. Web Inspector still seems to help, however. Could this be an incomplete Garbage Collection after the first close? The app returns to normal after I force close it the second time (which causes the app to stay grayed out for a few seconds, presumably while things are reset in memory).
Retired
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Webworks app freezes on PlayBook UNLESS Web Inspector is running...

That's very strange.  I assume this is for Smartphone (and not Tablet)? 

 

It sounds like a timeout is occuring within the networking piece of your app.  Does it run allonly local content, or is it downloading and displaying any content from remote locations?

 

if the latter, try excluding this temporarily to confirm it resolves the problem.  If that is the case, I believe the issue may lie in domain whitelisting, or modifying the remote content to confirm (e.g. do you have any embedded Widgets that think they are new windows, or popup windows?)

 

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Regular Contributor
Posts: 60
Registered: ‎03-07-2011
My Device: Not Specified

Re: Webworks app freezes on PlayBook UNLESS Web Inspector is running...

@astanley Hi, and thanks for the reply.

I agree it is very strange. It is actually on the PlayBook and I do not access remote resources. I am using the Alice.js library so I tried removing that to see if that was the problem, but it didn't help. My only thought at this point is that the app may not shut down completely the first time, which for some reason causes the Javascript to hang the second time. Having said that, the app will permit one function call the second time it is run, and then it hangs. Once I shut the app down the second time, the icon stays grayed out for a few seconds, presumably while everything is reset in Webkit and then the app works normally the next time it is run.
Regular Contributor
Posts: 60
Registered: ‎03-07-2011
My Device: Not Specified

Re: Webworks app freezes on PlayBook UNLESS Web Inspector is running...

@astanley As an aside, I have posted in another thread (where you have also responded) dealing with the inability of several of us to view database resources using WebInspector.  You had me do a Hello World with a simple WebDB to see if the issue was still there, which it was.  However, I also noticed that the issue I report in this post (ie. app hanging the second time it is run) is also there even with this very simple "app".  Could these two issues be related in any way?

Regular Contributor
Posts: 60
Registered: ‎03-07-2011
My Device: Not Specified

Re: Webworks app freezes on PlayBook UNLESS Web Inspector is running...

I have continued testing and trying to debug this issue.  The more I test and narrow down where the problem seems to originate, the more I become convinced that this is a database issue (ie. WebDB or HTML5 database).  There is something about shutting down the app after accessing the database, and then restarting the app and trying to access the database again, which causes the app to freeze solid.  Once the app is shut down, everything seems to reset and all is well, at least as long as you don't close the app.  This issue does not seem unique to my app, as I did basic Hello World app that writes a single item (user supplied) to a database and the behaviour is exactly the same.  This behaviour coupled with the issues around not being able to view database resources in WebInspector makes me think something is amiss.

 

Either way, I'm not sure how to release my app until this is resolved as it may cause some frustration for users.

Retired
Posts: 856
Registered: ‎07-15-2008
My Device: Passport
My Carrier: Bell

Re: Webworks app freezes on PlayBook UNLESS Web Inspector is running...

Could you post your sample to the issue tracker or here, so that we can test it? It does sound likely that it's a lower level issue which we'll need to get fixed by development. I'd like to use your sample to be absolutely sure that I don't do something slightly different and miss part of the problem.

Tim Windsor
Open Source Technical Lead
Regular Contributor
Posts: 60
Registered: ‎03-07-2011
My Device: Not Specified

Re: Webworks app freezes on PlayBook UNLESS Web Inspector is running...

Hi Tim,

 

Thanks for your response.  I will post here, if you don't mind.  The code, in order, is html, javascript, config.xml, blackberry-tablet.xml.

 

What is the best way for me to follow any updates on this issue?

 

Thanks again.

 

html

<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<script type="text/javascript" src="helloworld.js"></script>

</head>

<body>
<input type="text" id="testDBInput"/>
<button type="button" onclick="testDB()">go</button>
</body>
</html>

 javascript

 

// JavaScript Document

var taskdb=openDatabase ("helloworldDB", "1.0", "test database", 10*1024*1024);

taskdb.transaction(function(tx)
{
						 
	tx.executeSql("CREATE TABLE IF NOT EXISTS maintable (id integer primary key autoincrement, nametitle TEXT)");
	alert("table done");
});

function testDB()
{
	var testTitle=document.getElementById("testDBInput").value;
		taskdb.transaction(function(tx)
		{
		tx.executeSql("INSERT INTO maintable (nametitle) VALUES (?)", [testTitle], function (tx, results)
				{
					alert("insert");
				});
		});

}

 

config.xml

 

<?xml version="1.0" encoding="utf-8"?>
<widget xmlns=" http://www.w3.org/ns/widgets"
        xmlns:rim="http://www.blackberry.com/ns/widgets"
        version="1.0.0.0">

  <name>tester</name>

  <description>
    TestFile
  </description>
  
  <rim:orientation mode="landscape"/>
  <rim:loadingScreen onFirstLaunch="true" >
  </rim:loadingScreen>
  
  <author>***edited for privacy***</author>



  <icon src="bdicon.png"/>

  <content src="index.html"/>
  <feature id="blackberry.app" required="true" version="1.0.0.0"/>
  <feature id="blackberry.ui.dialog" required="true" version="1.0.0.0"/>

</widget>

 

blackberry-tablet.xml

 

<?xml version="1.0" encoding="utf-8"?>

<qnx>
<icon>
 <image></image> 
</icon>
<author>***edited for privacy***</author>
<authorId>***edited for privacy***</authorId>
<platformVersion>1.0.0.0</platformVersion>

</qnx>

 

 

Retired
Posts: 856
Registered: ‎07-15-2008
My Device: Passport
My Carrier: Bell

Re: Webworks app freezes on PlayBook UNLESS Web Inspector is running...

Okay, what reproduction steps should be following? I've tried on both a 2.0.0.7971 and a 2.0.1 build and on the second or later start, typing in the text box and tapping 'go' still gets me the insert message.

Tim Windsor
Open Source Technical Lead
Regular Contributor
Posts: 60
Registered: ‎03-07-2011
My Device: Not Specified

Re: Webworks app freezes on PlayBook UNLESS Web Inspector is running...

I'm not sure what to tell you.  I'm using 2.0.0.7971 and am running with a debug token.  SDK 2.2.0.5 for tablet OS.

 

In every single case, it always happens that after shutting down the app (after the first run), the app stops working properly the second time.  This is also the case for the app I am trying to distribute.

 

It seems unlikely, but if you aren't able to replicate this at all, then is it possible there is a flaw with my OS that may be solved by reinstalling it (and everything else)?