Results 1 to 5 of 5

I am currently working on a Blackberry application that originally was just web-based (inside Blackberry ... Software & Theme Development forum

  1. #1
    ataylor's Avatar
    ataylor no está en línea Stack level 1
    Join Date
    Jan 2007
    Posts
    3

    Blackberry Web Page Auto-Update (with Push) Help

    Advertisement



    I am currently working on a Blackberry application that originally was just web-based (inside Blackberry Browser) and displayed dynamic lists/automatically updated itself at a set polling rate. (Usually once every 2 minutes)

    Even though the pages were small and the application worked, when put across several hundred devices I decided that the amount of data being transferred was unacceptable.

    I have experimented with the native PUSH technology on a Blackberry device through the BES. Although this reduces the amount of traffic being used I couldn't find a way to force a web page to refresh on the user's Blackberry. The best I managed was recognising a change in a list then telling the user that they needed to refresh their page. Unfortunately this relies too heavily on the user and also lacked any intelligence in regards to knowing what page the user was looking at.

    After exhausting these avenues. I have been forced to use Java to write an application for the devices that can deal with the updating of the web browser.

    Initially I tried using BrowserSession to refresh a page on receiving a PUSH. This worked but I could not work out any way to retrieve the page the user was currently working on and apply the refresh intelligently based on that.

    Now I have an Application that seems to do most of what I need it to do. I am very new to Java (3-4 days experience) so I have borrowed heavily from the BrowserContentSampleApplication and HTTPPushDemo that were given in the JDE samples.

    The application creates a listening thread on start up - this thread listens for PUSH messages.

    The Application then creates a BrowserContentManager and pushing it to the screen. There is then a background process that requests the initial page and sends it to the BrowserContentManager.

    These processes both work fine. I can keep track of what page the user is looking at and I can react intelligently to PUSH messages received and update the page in the BrowserContentManager based on the PUSH message and whether it applies to their current page. At the moment I would like to keep this how it is as it is doing what I need it to do.

    Now to my problems:

    When the application loads I have to go and fetch an initial login webpage. Currently this is hardcoded but I would like this to be configurable.

    Is there any way to include a config file with your application and does it affect signing the application when a change is made to it? I have looked into using a Resource file (supposed to be for localisation) as a config file seeing as I just need a string with the web address in. Would this be viable or do changes to a Resource file require a recompile of the application and a new signing to be made?

    If I cannot use a Resource file can I change the command line arguements for when the program is launched. I have read about a ApplicationDescriptor class and .JAD files but I have struggled to find any quality/descriptive documentation on these. If I am thinking along the right lines here I'd appreciate advice on how to implement them/change them at deployment.

    My next problem is that the BrowserContentManager does not render the web pages in the same way as the Blackberry Browser, although I believe it uses the same engine. Is there any rendering options I can set that will force it to render with the same results as Blackberry Browser?

    BrowserContentManager also behaves differently to user input than Blackberry Browser namely context menus and the return key. Having a reduced context menu is actually a blessing here, but I would like to know if I can gain control of this context menu or even prevent it from opening and just doing an automatic 'Get Link' when the user presses the Scroll-Wheel/Track-Ball. The return key in Blackberry Browser does an automatic 'Get Link' but with the BrowserContentManager it only seems to scroll the page down, or Submit a form if you are on a Submit button or text-entry field.

    I have tried to look at available documentation but because of my lack of experience with Java and Blackberry's and also because of a lack of detail/examples in the documentation I have been unable to find answers to these queries. Any help would be appreciated.

  2. #2
    cp6169's Avatar
    cp6169 no está en línea Device Pro
    Join Date
    Mar 2006
    PIN/ID
    3056468b
    Posts
    14,661

  3. #3
    ataylor's Avatar
    ataylor no está en línea Stack level 1
    Join Date
    Jan 2007
    Posts
    3

    Re: Blackberry Web Page Auto-Update (with Push) Help

    Thanks for the bump cp6169.

    Hoping someone has some thoughts on this... I'm getting nowhere fast with it.

  4. #4
    ataylor's Avatar
    ataylor no está en línea Stack level 1
    Join Date
    Jan 2007
    Posts
    3

    Re: Blackberry Web Page Auto-Update (with Push) Help

    Shame no-one could help, but I have come up with a relatively satisfying solution.

    I have created a Resource file in a seperate Project and made my original App import it. In that Resource file are all the options that my application needs to run correctly, users can download the updated Config File anytime they want, althought it requires an reboot of the device - I think it's worth it.

    As for links showing Context Menu, I have replaced them with simple buttons, I have been lucky in that these seem to look ok and function as I had originally wanted the links to function.

    As for the browser not rendering the same way as Blackberry Browser I have changed the markup so that there is much less room for error on the rendering side of things. Some things are still rendered poorly but at least it's looking better.

    Now my only problem is distribution: if anyone knows how to change the Icon / Name displayed on the user's home screen of the Blackberry or can point me to the solution I'd be grateful.

  5. #5
    otint's Avatar
    otint no está en línea Stack level 1
    Join Date
    Aug 2006
    Posts
    1
    @ataylor - am having the same difficulties you describe -- are you able to share some of your solutions?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •