03-03-2010 10:37 AM
I'm new to BlackBerry development, and I'm developing an application that has a screen with an embeded browser. I could find out all the information I needed to build the app, but now I'm stuck.
In my application, when the user access a specific URL, I want to fill one form field automatically. Handling the EVENT_URL_REQUESTED I know that the user requested that specific URL, and then, after loading the URL I'm trying to use the BrowserContentManager to get the fields.
The problem is the following:
browserContentManager.getFieldCount() returns 1, and
browserContentManager.getField(0) returns a Field
Through debbuging I found out that it is an instance of HTMLBrowserField (net.rim.device.apps.internal.browser.html.HTMLBro
The problem is that all these classes are not included in the API, and seems to be loaded in runtime or something like that. Is there a way to use those objects somehow? Can I use those classes from package net.rim.device.apps.internal.browser.html.* ? Where are them?
I'm using Eclipse as IDE, with the BlackBerry plugin, that basically uses the net_rim_api.jar in the build path. And just for information, I'm using the JDE 4.6 with the 9000 simulator, but I need my app running in all Blackberry devices (or the most possible number of devices).
Any information/thoughts are appreciated!
Thanks in advance,
03-04-2010 12:50 PM
Guys, please help me!
Anyone has any ideas if I can use classes from package net.rim.device.apps.internal.browser.html.* somehow or how to accomplish what I want to do (accessing/modifying a form field inside the "embeded browser") in some other way?
03-17-2010 11:46 PM
Trying to use undocumented internal APIs probably isnt a great idea, not least since they're liable to be changed at any moment.
And while some of the API's may well be accessible, I doubt there's any documentation.
If you want the function for earlier OS versions I guess you're out of luck (as am I).
But if you're capturing browser events, and you clearly know which URI was selected, why not take responsibility for the get/post yourself and inject values into the url/stream.
03-18-2010 08:14 AM - edited 03-18-2010 08:33 AM
First of all, thank you very much for replying br14.
Regarding injecting values directly on post, I did this, but there is two main downsides with this solution:
- I need to know, as you mentioned, the URI.
- There is no feedback (for the user) regarding what is happening.
To help you understanding my problem (and especially my second point), think as an example in an application that have a password saved which the goal of saving time avoiding the need for the user to type the password in websites.
If the password insertion would be directly in the post, basically the user would have to click the Login button without filling the password field in the form (what is a bit wierd/not user friendly). What I would want than is to have, for example, a menu item "insert my password" that would fill the field for me. But to make that possible I would need to parse/change the page contents... Another possible solution would be to directly submit the form, manipulating the post data, when the user selects this menu option. But the problem is that I would also need to parse the page to find out which is the link to submit that form (or somehow "simulate" the click in the submit button (that I don't know where it is located in the website).
03-22-2010 10:11 AM
If any of you guys knows a solution or a pointer to the solution will be of great help.
07-18-2010 04:22 AM
till the blackberry version 4.7 its not possible to inject the java script in to page after loading, but since BB version 5.0 its been enhanced to support the JS injection with help of the API provided in BrowserField2 class i.e. (executeScript(String script)) its very usefull try it once.