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
Trusted Contributor
NGeldenhuys
Posts: 176
Registered: ‎04-12-2012
My Device: Bold 9780 & Curve 8250
My Carrier: vodacom

Changing Code From android To Blackberry

Hi all

 

I have been working with blackberry coding for about two months and I have got a task where I have to take a Android code and make it fit for Blackberry mobile use...

 

If anyone has advice or links please feel free ! 

 

Thank you

Please use plain text.
Contributor
technodhr
Posts: 11
Registered: ‎05-04-2011
My Device: storm
My Carrier: bleah

Re: Changing Code From android To Blackberry

If you are using hashcode, hashmap then use hashtable instead if using for each loop then you need to replace it with normal for loop and you may not be able to use something like new Vector<Integer>(); you need to convert it to just new Vector(); You need to form all the Ui components into main() mentod instead of creating it through XML. and thats it for now :smileyhappy:

Please use plain text.
Trusted Contributor
NGeldenhuys
Posts: 176
Registered: ‎04-12-2012
My Device: Bold 9780 & Curve 8250
My Carrier: vodacom

Re: Changing Code From android To Blackberry

Thank you very much! every piece of Onformation will help! :Clap:

 

If anyone can please give tips on the following :smileysad:Android 'wording')

 

SQL exception

 

 .open & .close a connection

 

arrayList (format)

 

to '.add' and to 'get '

 

Thank you guys :Punk:

 

 

 

 

Please use plain text.
Developer
simon_hain
Posts: 16,017
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Changing Code From android To Blackberry

android is based on desktop java while BB is based on j2me (java 1.3/1.4), so many newer classes are not available, and annotations, autoboxing etc are not there as well.

to open a connection you use open(), to close it close(). see the httpdemo or similar samples.

arraylist is a new collection class not supported on BB, use vector or write your own collection.

what do you mean with add/get? to add a field you use manager.add(field), to get one get(int index).
----------------------------------------------------------
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
Please use plain text.