How to install and setup a development environment for Bada

This post is part 1 of 9 in the series Bada from scratch

This post is for those who have troubles installing and configuring a Bada development environment from scratch.

To develop for Bada you need an SDK (Software Development Kit) and an IDE (Integrated Development Environment).
The SDK is the group of tools, libraries, header files and sample codes needed to build apps for Bada, the IDE is the application that you’ll use on your computer to actually write the code, debug and test your Bada apps.
Unfortunatley the IDE+SDK for Bada are only available for Windows, no Linux or Mac version is available at the moment.
To install the whole environment you’ll need a windows machine with some GB of free disk space (4 GB should be enough)
The Bada IDE is based on the eclipse project.
Eclipse is a powerful open source IDE which is also used for Android development and for a lot of other platforms.
It is entirely written in Java and can be extended with a lot of plugins.

Read more »

How to setup a Bada phone to test your Apps

This post is part 2 of 9 in the series Bada from scratch

In this post I’m going to show you how to setup a Bada phone to deploy the BasicApp we created in part 1, on a real device.

In order to do this I have to show you also some more about the Bada IDE.

Configuring the target device

People starting with Bada development (mee too) usually get stuck when they try to deploy their apps on a real device.
On the emulator everything’s fine but on the real device things don’t work, strange errors appears or nothing at all happens and you wonder: “Y U NO WORK???”
Before trying to deploy your App on your Bada phone you have to do two things:

  1. Enable USB debugging on your phone
  2. Install the root certificate for development on your phone

Enable USB debugging: pick up your Bada phone, go to Settings->Connectivity->USB utilities and turn ON “USB debugging

Read more »

Create your first Bada application

This post is part 3 of 9 in the series Bada from scratch

After installing the Bada IDE and SDK and configuring a device to test our apps, we are now ready to create the first Bada app.
Important topics are covered in this post:

  1. Basic structure of a Bada project, where to search for what.
  2. What a manifest file is, and what’s used for.
  3. How a single app package can support devices with different display sizes.

By the end of the post you will be able to create a new Bada project using the “New project” wizard and you will also know how project sources are organized as well as some more about the IDE itself.

Read more »

Understanding C++ for Bada – The basics

This post is part 4 of 9 in the series Bada from scratch

So, welcome to the hard part! In the last parts we prepared an environment to start developing for Bada, that was only a preamble, now it’s time to learn Bada development.
In the previous part we created a very first App for Bada using an automated wizard that built a Bada project for us, it worked, but how?
We still don’t know the majority of what’s inside the project created by the wizard.
Starting from this post we are going to understand what a Bada App is and how it can interact with the rest of the operating system.

Beware that the topics exposed here and in the following posts may not be easy to understand (actually they could be very hard to swallow) especially if you are not very familiar with C++ and OOP (Object Oriented Programming).
As a result you may be a little confused at the end of the article, if this happens, this means you have to read some basic C++ and OOP tutorial somewhere and then try reading this again.
However my goal is to make this post understandable even for the beginners, feel free to comment with questions if you feel you’re missing something.
Ok, scary introduction completed, let’s begin.
Read more »

Understanding C++ for Bada – Interfaces and Event Listeners

This post is part 5 of 9 in the series Bada from scratch

Hi, all and welcome to this new part in the Bada from scratch course.
In this part, we are going to talk more about the sample Application class which was created in the previous part, and we’ll also see how it can be used to represent a real Bada application that interacts with the operating system by introducing the idea of communication interface and event listener interface.
In order to understand what follows I recommend you to make sure you understood what was exposed in the previous part of this tutorial.
Let’s begin with a short recap of what was said in the last part.

One class interface, one class implementation

In the previous part I explained how a C++ class can be splitted down into two distinct components:

  • The class interface: defines how the class interacts with the outside world, that is, the methods and the properties that the code outside the class can access and use.
  • The class implementation: provides the code for the methods defined in the interface and possibly some other code that is private, not exposed to the outside world through the interface.

As a practical example I created a sample class to describe a generic application, this is the class interface:
Read more »

Understanding C++ for Bada – Idioms, Code conventions and Namespaces

This post is part 6 of 9 in the series Bada from scratch

Hi, welcome to this new part of the Bada from scratch programming course.
In this part we are going to understand four different topics: coding idioms used in Bada programming, code conventions used in Bada programming, how Bada APIs are splitter into C++ namespaces and how to identify which namespaces are available in every Bada header file. Each of these topics is really important but also pretty easy to expose, so I decided to make only one post.

Bada C++ coding conventions

Understanding coding conventions can dramatically improve your understanding of existing code, and helps you writing code that others will easily understand. Among this, it’s usually a good practice to adopt the same coding conventions of the platform you are developing on.
Last but not least, understanding code conventions can prevent your code from doing harmful things, you will see an example in a minute.
In the previous part, which was about interfaces and event listeners, you already saw one of the coding conventions adopted in Bada.
Read more »

Bada Applications Life Cycle – Part 1

This post is part 7 of 9 in the series Bada from scratch

Hi all, and welcome to this new part of the Bada from scratch programming course.

Today we are going to understand the life cycle of a bada application. In order to do so, we have to look inside the sample project created back in part 3, and we also need the C++ knowledge exposed in the last 3 parts:

  1. Understanding C++ for Bada – The basics
  2. Understanding C++ for Bada – Interfaces and Event Listeners
  3. Understanding C++ for Bada – Idioms, Code conventions and Namespaces

This post will finally put together the knowledge aquired since now.
The initial version of this article was far too long for a single post, so I decided to split it up into two parts, the first part is focused on the theory while the second part is more about digging in the sample project to study how it’s composed.
Let’s now start with an overview of the life cycle of a Bada application.
Read more »

Bada Applications Life Cycle – Part 2

This post is part 8 of 9 in the series Bada from scratch

When creating a Bada application with the “New application” wizard, like we did, the wizard creates a subclass of the Osp::App:Application class and overrides the basic methods with some default code, so you don’t have to write it from scratch. The Osp::App:Application subclass is named after your project and you can find it’s declaration inside the <your_project_name>.h header file while the class implementation is inside the <your_project_name>.cpp source file.

Another file is created automatically by the wizard, it is named <your_project_name>Entry.cpp. In this case it is FirstProjectEntry.cpp. This file contains a lot of strange C++ code inside a function named OspMain(), this is the entry point of the application. The entry point is the point inside the code where the execution of our application begins. Forget about it, the wizard handles this for us, and it is not easily understandable code at all. We can safely consider the OnAppInitializing() method as the entry point of our application.

Let’s move on and see what’s inside the FirstProject.h header file, double click on it inside the project explorer and you should see it appear inside the editor window.

Read more »

How to use the Bada Event Injector

This post is part 9 of 9 in the series Bada from scratch

This is a very short post, just to show you the event injector tool which is fundamental to test your Bada application in every situation.
The event injector is only available when you run the application on the bada emulator, by using this tool you can simulate every kind of problem which you may not be able to simulate on a real device.
The event injector can also be used to simulate gps locations, sensor data, incoming calls or sms messages and so on.
This is only an introduction, it shows you how to access the event injector and how to simulate low battery and low memory conditions, just to try out the code we wrote in the last part.

Introducing the Event Injector

To access the event injector simply run the application in the Bada emulator, once the app is launched (and not before) right-click on the emulator and select “Event Injector” to launch the tool.
The event injector window has many tabs that allows you to send different kinds of events to the emulator, the one that we need now is the “Device” tab.
In the event injector window select the “Device” tab on the top-right corner:

By using the highlighted controls you can send both fake low memory alerts and fake battery level change notifications to the running emulator, just to see what happens.
Try pressing the “Low Memory” button and take a look at the emulator:

That’s our MessageBox, it works!

If you are intrested in seeing what happens when the battery level changes, just try changing the value of the slider and pressing “Send Battery Level”, the levels are:

  • Value 100 : BATTERY_FULL
  • Value 99 to 40: BATTERY_HIGH
  • Value 39 to 5 : BATTERY_LOW
  • Value 4 to 1 : BATTERY_CRITICAL
  • Value 0 : BATTERY_EMPTY

If you try sending a value of 0, the application will terminate and the emulator will shut down after showing an alert message.

This is it, the tool is very useful and we’ll probably use it again in this series, stay tuned!

Related Posts Plugin for WordPress, Blogger...