[Bada] Putting a Resource Image in a Form

When a new bada project is created, a Res directory is created underneath the project folder. This folder holds resources, such as XML files defining Form, for the application. Here, an image of a nebula (I originally took this from http://photojournal.jpl.nasa.gov/browse/PIA04216.jpg) is loaded from a file in the Resources directory and displayed on the screen.
Read more of this post

[Bada] Try Catch in Bada

Most of the methods in the bada API indicate if something goes wrong by a returning a “result” or by setting the result that is returned by GetLastResult, instead of using the C++ exceptions. According to bada’s documention, this is because C++ exceptions require larger runtimes. I used to use if statements to check for errors after each of these calls. The problem with this is that it would usually result in my code being cluttered with if statements. Another approach that I have across, is to use the try macros.
Read more of this post

[Bada] Using the Bada Database

The bada platform provides a database tha apps can use to store their data. To work with a database in bada, you will need to use the Database class. The example used in this tutorial looks at setting up and working with a database in bada. The stored data is simply a list of names that are displayed in a list. The source for the demo may be downloaded here.
Read more of this post

[Bada] Creating a LinkedListT or ArrayListT to Hold Your Own Type of Objects

Recently, I had been trying to use make use of the ArrayListT and the LinkedListT and it took me a few attempts to figure out how to use it. Unlike ArrayList and LinkedList, ArrayListT and LinkedListT supports generics, so you that you can add a specific type of object and get back that object as the specific type without having to cast it from Object. If you want to use them your own type of objects, there are few things to know otherwise it will not compile. In my case, I was using the trying to create a list of Entry objects. Originally, it looked something like this:
Read more of this post

[Bada] Creating Custom Lists

The Bada API provides a few different types of lists. The basic list (provided by the List class) provides a fairly basic format and supports up to two columns. The CustomList and Slidable provide greater control over the format of the list’s contents. However, these lists require more work to use it, than the basic List. This tutorial looks at how to create such a list in Bada.
Read more of this post

[Bada] Creating and Using Option and Context Menus in Bada

An option menu is created using the OptionMenu class and context menu uses the ContextMenu class. For the example in this tutorial, I’m using an application that with text on the screen and a left soft key. Clicking on the text brings up a context menu. The options menu is dispalyed when the left soft key or the option menu handle are pressed. When an item is selected in either menu, a dialog pops up to display the corresponding item’s action id.

Read more of this post

[Bada] Creating “Hello World” for Bada

I recently had a look at writing applications for Bada. Bada is a smart phone platform from Samsung. As I was starting out, I was trying to write a “Hello World” application to start off. The documentation provided a starting point for creating a “Hello World” project (bada Developer Guide -> Application Development Process -> Creating Your First Application). The next section, Designing and Creating the Application GUI, was on constructing the user interface using the visual GUI builder. Instead of using that GUI builder, I constructed it programmatcially.

Read more of this post