Friday 15 April 2011

QuickStartGuide - The bada APIs: finding similarities

The bada C++ APIs are divided into 21 (in bada SDK 1.2) top level namespaces, divided neatly according to functionality. So, you’ll find the base namespace which contains numeric types and standard classes such as DateTime and String and the base::collections subnamespace that contains a comprehensive set of classes to implement arrays, linked lists, stacks and queues. Other namespaces include those for locations, multimedia features, handling sensors and the user interface, all organised in a logical way which makes getting to grips with the bada APIs a lot easier.

The bada APIs consist of 21 top level namespaces

While porting code written using the Symbian C++ array classes may take some work, the ArrayList and LinkedLists classes do offer similar functionality, with the ArrayList class used for arrays which are updated less and stored in a contiguous area of memory- much like the Symbian fixed array classes- and the LinkedList is analogous to the segmented array classes. If you've been using Qt, then you’ll find similar bada classes to the Qt Qlist, QlinkedList, QMap and QMultiMap classes, for example.

Of course Symbian’s C++ string implementation is unique and there is no equivalent in any other environment to the 16 or so descriptor classes. bada’s base::String class is very similar to Qt which provides the QString class that encapsulates a unicode string.  You’ll also find methods for manipulating the string, adding and deleting substrings, converting between upper and lower case and string comparison functions. For more advanced string handling, such as parsing lines of text read in from a file, there’s the Base::Utility::StringTokenizer class.

So, while porting from Qt, with it’s more standard set of C++ APIs should be more straightforward, you should still be able to find bada equivalents to a lot of Symbian C++ core features.

No comments:

Post a Comment

Please don't post spam. Its tiresome.

Note: only a member of this blog may post a comment.