BlackBerry Forums Support Community

Closed Thread
LinkBack Thread Tools
Old 11-08-2009, 12:10 PM   #1 (permalink)
New Member
Join Date: Oct 2009
Model: 8310
Carrier: AT&T
Posts: 2
Post Thanks: 0
Thanked 0 Times in 0 Posts
Question ApplicationMenuItem: Auto-Start and Run Method Clarification Needed

Please Login to Remove!

Before I ask my questions, I'd like to say I have searched this forum and read the posts that I've found. I've also read the relevant sections in the developer guides (thank you Mark Rejhon for the info). So this question comes after prior research.

From what I've read, I understand that I
  1. Cannot run my app code from an ApplicationMenuItem run(Object context) method because it exists in a separate thread
  2. Need to somehow synchronize on the EventLock, or give my app access to the ApplicationMenuItem's run(Object context) method

What I'm not understanding are the various examples and explanations I've seen as to how to do this. There are a) examples on how to auto-start an app (and I figured out how to do this via NetBeans) and b) examples on how to implement an alternate entry point. What there doesn't seem to be is an explanation of how those components work together, which is what I'm looking for so that I can write my app. If there are, and I've overlooked them, please post the link here and I'll go and read.

Right now, I've developed an ApplicationMenuItem that is added to the Browser. I've extended UIApplication and created a constructor that adds the ApplicationMenuItem to the Browser when the device is started. I've written code to package credentials in a StringBuffer. I've written code to POST authentication to a URI. What I can't seem to do is put them together, which is why I'm looking for the type of docs in the prior paragraph.

I've implemented the ApplicationMenuItem's run(Object context) method and I can pop up a dialog with context.toString() (which is the current page URL), and I can run the packageCreds(StringBuffer creds) method I wrote from the ApplicationMenuItem's run method. What I can't do is run the authenticate(StringBuffer creds) method (which POSTs to the authenticating website) from the ApplicationMenuItem's run method.

Sorry this is so long. I wanted to be clear about what I've already done and what I'm trying to do. Any help is appreciated. If clarification is needed, please post and let me know.


Copyright 2004-2016
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.