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
Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Device memory is Low issue for an WebWork app

Hi konradz,

 

When panning in the Google Maps API, it uses more memory than what is set aside in the BlackBerry Webkit engine for web applications.  There's no getting around this. Google Maps API caches a lot of images which exceeds the amount of physical memory available.  It is a hard cap on the BBOS for memory consumption in a web application.

 

There are two possible alternatives.  

 

1) Google static maps embeded in your page

 

2) Launch BlackBerry maps with a KML document to plot your map data

 

I personally can't see any way of getting interactive Google Maps APIs to work in your web application because it simply uses too much memory for the allowed environment.

 

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Contributor
Posts: 13
Registered: ‎02-09-2012
My Device: Blackberry 9700 Bold
My Carrier: Orange

Re: Device memory is Low issue for an WebWork app

[ Edited ]

tneil: We are using openlayers. Openlayers download static images from the server. It's not more than 20 pics, 50 kb each. So 1 MB completly crash app and whats more after that icon app change on stanard icon. And user can't find our app on bb.

 

 

We invest first MD's 1 year ago in yours technology and still get the same message :smileyhappy: In BB10 maybe everything will be super :smileyvery-happy:. I can't promise my sponsors that after 3 months we'll make good app and after that plus 3 months (and still the same)

 

 

 

Software is completly unstable (Web Works) and RIM should release official note in this issue.

Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Device memory is Low issue for an WebWork app

Hi konradz,

 

We have thousands of successful WebWorks applications built for the BB smartphone operating system spanning both consumer and enterprise.  Thousands more created with WebWorks for PlayBook.

 

The hardware on BB5/BB6/BB7 simply cannot handle the Google Maps API.  There simply isn't enough physical memory available on the device set aside for web applications to handle a JS toolkit that operates like the Google Maps API caching large amounts of data in memory.

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Contributor
Posts: 13
Registered: ‎02-09-2012
My Device: Blackberry 9700 Bold
My Carrier: Orange

Re: Device memory is Low issue for an WebWork app

[ Edited ]

But we don't use Google Maps :smileyhappy: We serve some images, maybe the issue is that they have got set cookies?

Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Device memory is Low issue for an WebWork app


konradz wrote:

tneil: We are using openlayers. Openlayers download static images from the server. It's not more than 20 pics, 50 kb each. So 1 MB completly crash app and whats more after that icon app change on stanard icon. And user can't find our app on bb.

 


I don't know what tell you.. I myself have loaded in more images than that into an application without issue.. 

 

I just ran a test right now loading in a "Classic View" (not mobile view) of Google Images search into my WebWorks app on a Torch 9810 running BB7 and started scrolling down the page loading in multiple pages of images (12 pages worth).  No crash.

 

I don't want to give the clasic "works on my machine" response, but there may be something that you are doing with the images you are loading that is staying in scope and causing a creeping effect to your memory usage.

 

 

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Contributor
Posts: 11
Registered: ‎08-05-2011
My Device: Developer
My Carrier: Developer

Re: Device memory is Low issue for an WebWork app

Tim: Do you know if BB is unable to play nice with just Google Maps or all the other map solutions as well (apart from BlackBerry maps API)?

Do you have an example of a WebKit app
A) that uses an alternate map solution that doesn't crash?
B) that uses BlackBerry maps and doesnt crash? Trying to find more info on what BB maps supports, (markers? Info windows?)
C) Would JQuery mobile work with your BBui approach?

I am currently trying your BBui approach, alongside Zepto, and trying to implement Leaflet (from the guys at Cloudmade) as the map API. Will post example if I get it working.

I really hope by saying you personally don't think google maps would work in a web app, you meant for the BB platform? I would be very scared (and sad) if you didn't think finding a fix to support Google Maps wasn't critical right now to the BB plaform's success.

A few good quality apps are better than thousands of fart apps that are coded to get free Playbooks. Every developer here that has complained is because we are still passionate about building a grea app on the platform, as we do on iOS and Android. There are thousands who probably didn't bother complaining and quit.

I am hoping you will find the time to help us out. Arguments aside, I think the goal, equally shared, is to find a solution to these issues. And that's in the interest of both RIMM as well as developers like myself.

Anything that you can do to escalate this to engineers who can look into it, would be benefit everyone.

Thanks.
Contributor
Posts: 13
Registered: ‎02-09-2012
My Device: Blackberry 9700 Bold
My Carrier: Orange

Re: Device memory is Low issue for an WebWork app

tneil: I've got app written in phonegap technology. No problems on Android (poor devices), no problems on iPhone. BB = problems. The issue is described here:

 

http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Memory-leak-using-focused-based-...

 

pseudo code (jQuery):

for( 20 times)

append('<img src='/pic/1'/>')

 

Very easy example without any response.

Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Device memory is Low issue for an WebWork app

Hi raj786,

 

I don't think there will be any solution to making Google Dynamtic Maps API work in a WebWorks app on the BBOS.  The physical memory set aside for the webkit instance that runs WebWorks applications on our smartphones simply will run out before the google maps api starts to clean up after itself.  Google Maps dynamic API threshold is just too high for the phone.

 

We've also been able to get Android phones and iOS phones to reach their limit with Google maps API and crash.  It simply takes longer.. the web view is destroyed and recreated on iOS when it exceeds its limit, and Android simply crashes the App.  We ran these tests with PhoneGap applciations for BB, Android, iOS.

 

BlackBerry maps is mainly a one-way implementation.. you send it information to display when it launches the app. You're not able to grab information back from it once it has launched.

 

I haven't heard of others trying different maps JavaScript toolkits other than Google Maps.. so unfortunately I don't have a list of mobile memory friendly embedded map APIs for you.

 

PlayBook and BB10 are an entirely different story.. their architecture is different and do not impose the physical memory limitations on a Web Application like the BB smartphone OS.

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Contributor
Posts: 11
Registered: ‎08-05-2011
My Device: Developer
My Carrier: Developer

Re: Device memory is Low issue for an WebWork app

Tim: I am sorry but that's like saying: "yea we know our car has brake pad issues and can only run for 5 minutes before the car shuts down, but heck we drove em BMWs and Toyotas as well, and sure enough the brake pads do eventually, after a while, run out as well! So nah we are not going to bother trying to fix our problem or even help you with coming up with a reasonable alternative."

 

iOS and Android both have thousands of apps that run Google Maps and do the job well enough that the apps are successful and used by millions of people. I mean if the above is really the excuse and that's the story you are going to sticking to, then I guess I don't have much else to say.

 

I wish I would have known about this earlier, and perhaps I should have continued building this in Java as oppposed to the WebKit, but then again my app wouldn't have worked on the BB10 phones. 

 

For the rest of the developers, will update as soon as I find a workable alternative.

 

konradz: I don't know if this helps in your particular case, but have you tried Leaftlet and/or maybe not using JQuery Mobile?

 

 

Contributor
Posts: 13
Registered: ‎02-09-2012
My Device: Blackberry 9700 Bold
My Carrier: Orange

Re: Device memory is Low issue for an WebWork app

No I've jquery mobile + openlayers + phonegap. Openlayers works fine. I test it few minutes ago. And on 9700 I can change position 10 times without any crash. Whats more you have got plenty options and can use google map layer.

 

 

We used in leaflet in some project half year ago. When I will have time I checked it and post some code.

 

In my case the killer is appendTo('<img src='red.jpg'/>')