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
Developer
BB_shi
Posts: 91
Registered: ‎03-15-2011
My Device: Blackberry 9800
My Carrier: developer
Accepted Solution

Sencha application is showing white screen on simulator and device

Hi,

 

I developed a sample sencha application using Sencha Architect(2.2.0) and able to see the screen on ripple emulator. After successful build of application using ripple emulator, when i am trying to install application on blackberry simulator(9900,9860) and device it is showing white screen. 

 

I have applied the changes for viewport given in below link:

http://www.sencha.com/forum/showthread.php?252232-GUIDE-Deploying-Sencha-Touch-2.1-as-a-Blackberry-n...

 

Still showing white screen. 

 

Please help.

Please use plain text.
BlackBerry Development Advisor
naveenan
Posts: 85
Registered: ‎10-11-2011
My Device: BlackBerry 9810
My Carrier: Rogers

Re: Sencha application is showing white screen on simulator and device

Hi There,

 

Let me remind you that 9900 is not in the list of the devices which are officically supported by Sencha Touch, http://www.sencha.com/products/touch/features/.  How ever, I dont see why it would not work on 9900.  

 

Here is a suggestion:

 

Sencha Touch 2.3 is available now and it is better optimized for the BlackBerry platform.  Would you be able to upgrade your application to Sencha Touch 2.3 and test it?  You can find the info about Sencha Touch 2.3 here, http://www.sencha.com/products/touch/download/

 

Thanks

 

Naveen M

Please use plain text.
Developer
BB_shi
Posts: 91
Registered: ‎03-15-2011
My Device: Blackberry 9800
My Carrier: developer

Re: Sencha application is showing white screen on simulator and device

Hi naveenan,

Thanks for reply.
The target is sencha touch 2.2 for us. 

I tested it on 9860 and 9810 too but get white screen.

 

Please find my code below:


index.html

 

 

<!DOCTYPE html>
<html>
<head>

<title>FirstSenchaApp</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" id="viewport" content="height=device-height,width=device-
width,user-scalable=no" />
<script type="text/javascript" src="local:///chrome/webworks.js"></script>
<script src="resources/js/sencha-touch-all.js"></script>

<link rel="stylesheet" href="resources/css/sencha-touch.css">


<script type="text/javascript" src="app.js"></script>
</head>
<body></body>
</html>

 

app.js:

 

Ext.Loader.setConfig({

});

Ext.application({

name: 'MyApp',
requires: [
'App.viewport.Viewport'
],
viewport: {
xclass: 'App.viewport.Viewport'
},
views: [
'Login',
'Introduction'
],
launch: function() {

Ext.create('MyApp.view.Login', {fullscreen: true});
}

});


Login.js:

 

Ext.define('MyApp.view.Login', {
extend: 'Ext.Container',

config: {
ui: 'dark',
scrollable: false,
items: [
{
xtype: 'textfield',
docked: 'top',
margin: '10 0 0 0 ',
label: 'Login Name',
labelWidth: '40%',
ui: ''
},
{
xtype: 'textfield',
margin: '10 0 0 0 ',
label: 'Password',
labelWidth: '40%'
},
{
xtype: 'button',
itemId: 'mybutton',
margin: '10 10 10 10',
padding: '',
ui: 'confirm',
text: 'Login'
}
],
listeners: [
{
fn: 'onMybuttonTap',
event: 'tap',
delegate: '#mybutton'
}
]
},

onMybuttonTap: function(button, e, eOpts) {
this.push(Ext.create("MyApp.view.Introduction",{
title: "Introduction"
}));
}

});


Blackberry.js:

 

Ext.define('App.viewport.Blackberry', {
extend: 'Ext.viewport.Default',
constructor: function (config) {
// Blackberry does not like height: 100%
this.superclass.config.height = this.getWindowHeight() + 'px';
this.callParent([config]);
return this;
},
getWindowHeight: function () {
/* blackberry variable is defined if we are in a webworks project */
var height = window.innerHeight;
if (typeof blackberry !== 'undefined') {
var useragent = navigator.userAgent.toLowerCase();
var moreHeight = 0;
if (useragent.indexOf("9810") != -1) { // Torch 9810
height = 425;
}
else if (useragent.indexOf("9850") != -1) { // Torch 9850
height = 533;
}
else if (useragent.indexOf("9860") != -1) { // Torch 9860
height = 533;
}
else if (useragent.indexOf("berry 99") != -1) { // Bold 9900/9930
height = 267;
}
return height;
}
return height;
}

}, function () {


});

 

Viewport.js:

 

Ext.define('App.viewport.Viewport', {
requires: [
'Ext.viewport.Ios',
'Ext.viewport.Android',
'App.viewport.Blackberry'
],

constructor: function (config) {
var osName = Ext.os.name,
viewportName, viewport;
switch (osName) {
case 'Android':
viewportName = (Ext.browser.name == 'ChromeMobile') ? 'Ext.viewport.Default' : 'Ext.viewport.Android';
break;
case 'BlackBerry':
viewportName = 'App.viewport.Blackberry';
break;
case 'iOS':
viewportName = 'Ext.viewport.Ios';
break;
default:
viewportName = 'Ext.viewport.Default';
}

viewport = Ext.create(viewportName, config);

return viewport;
}
});

 

Please let me know what i am missing.

Please use plain text.
Developer
BB_shi
Posts: 91
Registered: ‎03-15-2011
My Device: Blackberry 9800
My Carrier: developer

Re: Sencha application is showing white screen on simulator and device

I removed the viewport workaround from app.js and it's working fine now.
Please use plain text.
Developer
BB_shi
Posts: 91
Registered: ‎03-15-2011
My Device: Blackberry 9800
My Carrier: developer

Re: Sencha application is showing white screen on simulator and device

I removed Viewport workaround from app.js and it's working fine now.
Please use plain text.
BlackBerry Development Advisor
naveenan
Posts: 85
Registered: ‎10-11-2011
My Device: BlackBerry 9810
My Carrier: Rogers

Re: Sencha application is showing white screen on simulator and device

Hi There,

 

It is great news.  Do you have any plans for porting the application to BB 10 as well?

 

Thanks

 

Naveen M

Please use plain text.
Developer
BB_shi
Posts: 91
Registered: ‎03-15-2011
My Device: Blackberry 9800
My Carrier: developer

Re: Sencha application is showing white screen on simulator and device

Yes. I have plan to port app on BB10 in near future.
Please use plain text.
BlackBerry Development Advisor
naveenan
Posts: 85
Registered: ‎10-11-2011
My Device: BlackBerry 9810
My Carrier: Rogers

Re: Sencha application is showing white screen on simulator and device

That is great news :smileyhappy:

Please use plain text.