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

Java Development

Reply
Highlighted
New Contributor
Posts: 5
Registered: ‎03-18-2010
My Device: 9000
My Carrier: E-Plus
Accepted Solution

Undocumented Methods in Field

I just stumbled upon net.rim.device.api.ui.Field.setPadding(), .setMargin() etc. , tried to find out and wondered why these methods are there publicly in the JDE API, but undocumented. 

 

Are they somehow unwanted/deprecated or not supported?

Is it safe to use them? If yes - on which JDE versions?

 

thanks and greetings,

grzlbrmft

New Developer
Posts: 66
Registered: ‎11-23-2009
My Device: Not Specified

Re: Undocumented Methods in Field

I also really want to know the answer to this question.

Developer
Posts: 16,986
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Undocumented Methods in Field

many classes have undocumented methods. they can be removed or changed without further notice. you can use them at your own risk. when they work on all current OS releases there may be an upcoming one that does no longer support them - a calculable risk.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
New Contributor
Posts: 5
Registered: ‎03-18-2010
My Device: 9000
My Carrier: E-Plus

Re: Undocumented Methods in Field

Hi Simon,

 

is this an official statement - are you working for RIM?

If so, sorry, this does not really satisfy me.

 

What I thought (and still think) is that if a method of a [widely used] API is public or protected it cannot be removed without being deprecated for a while first. And it simply must be documented. I mean as a developer I need reliable information about an API.

Sure, setPadding/setMargin are somewhat self-explanatory, but I am missing the @since and the parameters' description.

And if it is deprecated or unwanted this must also be documented.

(I know there are drawbacks, too, when doing so. You don't get rid of stuff quickly, if at all...)

 

If you are the wrong addressee to rant at, sorry ;-)

 

 

Developer
Posts: 16,986
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Undocumented Methods in Field

i am knot working for RIM. official statement is: do not use them. my own statement is: do it at your own risk.

i can add some experience if you try and ask nicely, but maybe this won't satisfy you either.

 

this is a user to user forum. if you want support from RIM you can either try your luck on devsupport@rim.com or buy an official RIM support contract. Or become an alliance member and bask in the infinite wisdom and the super-fast answers of the alliance support (from 4 weeks to never).

sometimes Mark answers threads here with official statements, but it is mainly his one-man-show as far as official is concerned, no claim on it.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Undocumented Methods in Field

I agree with Simon's comments.

 

The fact that the methods are not documented means that they are not part of the supported API, so RIM has to say you can't use them.

 

Unofficially I have been told that setPadding works from 4.2 to current and that there are no plans to remove it.  However for me, even that is a bit dodgy.  Try painting the background once you have specified it.  I can only paint the non padded area....

 

I would be careful with this statement:

"if a method of a API is public or protected it cannot be removed"

Remember that in RIM's case, the API is the JavaDoc, not what is in the jar.  So the fact that it is public in the jar does not make it part of the API. 

New Contributor
Posts: 5
Registered: ‎03-18-2010
My Device: 9000
My Carrier: E-Plus

Re: Undocumented Methods in Field

Thanks, Simon,

 

You are quick, I am impressed :-)

Of course if you can tell any experience that will be much appreciated.

On the other hand I might not be able to use those methods because it is not only my own risk and I am not an experienced BlackBerry developer - I just cannot appraise the risk.

What a pity - I bet there are many other useful undocumented methods...

 

 

greetings,

grzlbrmft

-- wondering if your signature works for other planets, too.

New Contributor
Posts: 5
Registered: ‎03-18-2010
My Device: 9000
My Carrier: E-Plus

Re: Undocumented Methods in Field

Thanks Peter,

 

agreed, my statement might have been a little careless. It did never occur to me that there could be this line between public methods of a jar and an publicly supported API.

But yes, I agree, RIM can of course go this way. It is their decision. I'll just won't use those methods and get irritated by them secretly ;-)   (they appear in my IDE after all...)

 

Greetings,

grzlbrmft

Developer
Posts: 178
Registered: ‎07-29-2008
My Device: Not Specified

Re: Undocumented Methods in Field

Peter,  I would drop a little knowedge on you here Smiley Happy

 

paintBackground receives a Graphics Object that is sized to the padded size of the field.  paint receives a a Graphics Object clipped to the Size of non padded field.

 

Also, regarding these apis, RIM has released source code which uses them via KB articles, and provided descriptions of their functionality at DevCon 09, though only in sessions.

 

I will add my voice as another developer using setPadding.

Developer
Posts: 109
Registered: ‎02-09-2009
My Device: Not Specified

Re: Undocumented Methods in Field

Has anyone compiled a list of these? Are you guys really just comparing the jar files with the published APIs?