The DropDown class in BB is ObjectChoiceField.Inorder to know the field selection change in the list of objectChoiceField, overRide fieldChangeNotify( int Context ) method.
Sample piece of code
context value 2 represents the field changed.
Monday, February 21, 2011
Tuesday, February 15, 2011
setting Connection Timeout in J2ME , LWUIT
Connection Timedout can be achieved by 2 ways as per my knowledge.
1)Setting third param in Connector.open(,,boolean timedout) to true.The genearal default timedout is nearly 2-3 minutes.There is no way to override the default timedout value.If there is , please let me know...
Use 2nd way to overcome this.
2)Use a TimerTask ,Close the connection in TimerTask.
Look at the sample code here.
The problem in this method is the connection closing is taking 1 minute additional time for me.In order to overcome this one i closed connection in a separate thread , did my things parallelly so that this time won't effect my code and connection will be closed successfully.This is one of the reasons for separate thread implementation.
And closing connection in a separate thread is a good practice.
Note:Make sure that connection objects and stream objects are not used while closing.
1)Setting third param in Connector.open(,,boolean timedout) to true.The genearal default timedout is nearly 2-3 minutes.There is no way to override the default timedout value.If there is , please let me know...
Use 2nd way to overcome this.
2)Use a TimerTask ,Close the connection in TimerTask.
Look at the sample code here.
The problem in this method is the connection closing is taking 1 minute additional time for me.In order to overcome this one i closed connection in a separate thread , did my things parallelly so that this time won't effect my code and connection will be closed successfully.This is one of the reasons for separate thread implementation.
And closing connection in a separate thread is a good practice.
Note:Make sure that connection objects and stream objects are not used while closing.
RTL implementation in LWUIT
While doing the RTL implementation in LWUIT,the components should automatically reverse their positions.But for some reason they dont behave normally as we think in some cases.
for ex:
The order of components in LTR is c1,c2,c3.
The order in RTL must be c3,c2,c1.
The order may not be as expected in RTL.
According to some observations,
--Though the components add from right to left,the x position 0 represents the left most part.So if you want override the setx in RTL please go with setx(0) for c3,c2.setx(c3.getwidth) and so on ..
There is no guarantee that this will work.This is for some cases only. i.e for simple components additions.If we go for complex Component additions( component in a component in a component etc..) this behavior differs.
for ex:
The order of components in LTR is c1,c2,c3.
The order in RTL must be c3,c2,c1.
The order may not be as expected in RTL.
According to some observations,
--Though the components add from right to left,the x position 0 represents the left most part.So if you want override the setx in RTL please go with setx(0) for c3,c2.setx(c3.getwidth) and so on ..
There is no guarantee that this will work.This is for some cases only. i.e for simple components additions.If we go for complex Component additions( component in a component in a component etc..) this behavior differs.
Subscribe to:
Posts (Atom)