Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Blackberry 5.0 devices only partially work, needs improvement #490

Closed
sbelen opened this issue Nov 17, 2010 · 19 comments
Closed

Blackberry 5.0 devices only partially work, needs improvement #490

sbelen opened this issue Nov 17, 2010 · 19 comments
Assignees

Comments

@sbelen
Copy link

sbelen commented Nov 17, 2010

Hello,

I'm trying to view the JQ Mobile demo: http://jquerymobile.com/demos/1.0a2/ on Blackberry Bold 9000 (BB5) but it only returns a white page with only the title filled in.

@toddparker
Copy link
Contributor

We just tested this on our 9330 Curve and 9550 Storm 2 and both devices loaded that page correctly and I was able to navigate around. Can you re-try?

@sbelen
Copy link
Author

sbelen commented Nov 17, 2010

Hello,

I've tried it again and it fails again.
Actually when i try the 1.0a1 demo it works fine..

Maybe this is because the proxy of my Mobile Provider is between ?

@toddparker
Copy link
Contributor

Could be. Can you try it on wifi?

@DavidDeSloovere
Copy link

I'm seeing the same problem on the Blackberry simulators: https://github.com/jquery/jquery-mobile/issues/issue/478

@ry0ohki
Copy link

ry0ohki commented Dec 23, 2010

Seeing the same issue on the simulator and on an actual BB5 phone (Blank screen with scroll bars on demo page)

@nariman-haghighi
Copy link

There seems to be a workaround for this at least: http://forum.jquery.com/topic/i-can-t-get-jquery-mobile-to-render-on-blackberry-os-5-simulators

@johnbender
Copy link
Contributor

Can you test on the lastest? Thanks!

http://jquerymobile.com/test/

@Inawire
Copy link

Inawire commented Jan 25, 2011

I still had the problem with some apps. Newest build seams to load most times for me now.

Try turning off "JavaScript Timeout" for the BB browser.
(Options - Browser configuration - Terminate slow running scripts)

Application now renders.
Note: Not a solution just an area to start looking for a solution...

I added some more on this in the thread:
http://forum.jquery.com/topic/i-can-t-get-jquery-mobile-to-render-on-blackberry-os-5-simulators

Looks like a time out issue with no warning. I'm assuming that with code optimization this might be avoided but how to handle some sort of warning when it does?

@TZAdvantage
Copy link

There is an issue where mobile providers change the contents of the html and combine css and js files to minimize requests. If you have files that have a UTF-8 signature (first 3 bytes) this will corrupt the the combined files with invalid characters in between. One solution is to combine the files on your side (don't forget to strip the utf8 signature when present) and even better when possible also compress them. In that case the provider will leave those files alone.

in c# you do something like this:
foreach (string FileName in Files) {
byte[] bytes;
if (File.Exists(context.Server.MapPath(FileName))) {
bytes = File.ReadAllBytes(context.Server.MapPath(FileName));
if (bytes[0] == 0xEF && bytes[1] == 0xBB && bytes[2] == 0xBF) {
m = System.Text.ASCIIEncoding.UTF8.GetBytes("/\r\n File: " + FileName + ". Removed UTF-8 Signature.\r\n/\r\n");
Writer.Write(m, 0, m.Length);
Writer.Write(bytes, 3, bytes.Length - 3);
} else {
m = System.Text.ASCIIEncoding.UTF8.GetBytes("/\r\n File: " + FileName + ". Unkown encoding. Writing as if it was UTF-8 without signature.\r\n/\r\n");
Writer.Write(m, 0, m.Length);
Writer.Write(bytes, 0, bytes.Length);
}

                    } else {
                        m = System.Text.ASCIIEncoding.UTF8.GetBytes("/*\r\n  File: " + FileName + ". FILE NOT FOUND!!!.\r\n*/\r\n");
                        Writer.Write(m, 0, m.Length);
                    }
                }

hope this helps to exclude some unexpected results.

@ghost ghost assigned scottjehl Apr 12, 2011
@toddparker
Copy link
Contributor

This is now closed with our fix that excluded BB5 from Ajax navigation, among other tweaks.

@dcherman
Copy link

This is still occurring with JQM Beta 2. I have a simple page that with a single UL, but has 50 items in the list (each containing a link element).

The page does not finish rendering before it hits the BB Browser "slow script" timeout. If I turn off that option, it works fine. If I leave it on, I get a blank page close to 100% of the time.

@ricksuggs
Copy link

I can confirm this as well, I've narrowed down my Blackberry 5.0 problem to the script terminating when processing a listview of 16 items containing links, the script repeatedly terminates after the first 6 listviews in the 'listviewcreate' event handler.

@mbernier85
Copy link

This issue should be open, try using a BlackBerry 9300 on OS 5.0 and the page :

http://jquerymobile.com/demos/1.0b3/docs/lists/lists-performance.html

The problem will occur, the javascript will timeout and show a blank page, which is not a good behaviour, we lost a good amount of time seeking the problem.

@toddparker
Copy link
Contributor

Ah, well that page is designed specifically to push the boundaries of how large a page could be before it hangs. We don't recommend building a page with 400+ list items on any mobile device, let alone a BB5 device. That page is mainly there for testing.

@mbernier85
Copy link

Yeah maybe, but right now we are building a full web application, and some pages contain more than 1000 lines of html, and they hang, just like your example. It hangs at around 1500 lines.

And making the page smaller is not a possibility.

@toddparker
Copy link
Contributor

Regardless of whether you are using jQM or your own homebrew JS, having 1,000 lines of code isn't going to work on some mobile devices, especially those like BB5 that have very limited amounts of RAM and slow processors. IF BB5 is a priority, you need to keep your pages really small and limit the amount of scripting overhead.

@mbernier85
Copy link

If we take off jquery mobile from the page, the page load pretty well, even with 3000 lines of code.

There are no other JS than JQuery mobile in our page right now, and when we pass 1500 lines of html it hangs, which is not normal.

I know that OS5 is a pain, but we still need to support it, and offer a minimum of feature to the user.

@dcherman
Copy link

As a workaround if it fits your use case, you can try to implement infinite scrolling on your page rather than rendering everything at once. As the scrollbar reaches some percentage of the screen, you'd load and initialize the next batch of items rather than loading everything at once.

Might file a separate enhancement for a "partial" refresh function would which enhance this even further, if it's doable.

@scottjehl
Copy link

Hey livinloud,
The problem is BB5 is known to have a very slow processor and JS parser. Our code works on BB5, as in it's functional, but it's quite slow. Even jQuery itself takes quite a while to parse before jQM even starts!

You may decide that it's better for your users to simply not serve BB5 javascript at all. If the site is built using Progressive Enhancement, that may be an easier decision to make.

In our own client work on the new BostonGlobe.com, we did just that: BB5 gets no JavaScript, but the presentation and content is still nice and functional.

We're quite open to pull requests that improve our performance, so definitely submit ideas if you have any. However, I think this is just an issue of a slow JS parser and too many jQM-driven components in your page. If you're using list views, you might try not using the list view plugin and simply serving the UL as it would be after JS manipulation. Maybe that'll ease some of the extra work jQM is doing.

On Sep 27, 2011, at 3:45 PM, livinloud wrote:

If we take off jquery mobile from the page, the page load pretty well, even with 3000 lines of code.

There are no other JS than JQuery mobile in our page right now, and when we pass 1500 lines of html it hangs, which is not normal.

I know that OS5 is a pain, but we still need to support it, and offer a minimum of feature to the user.

Reply to this email directly or view it on GitHub:
#490 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests