Applications for os bad. Samsung Apps for Bada OS - Angry User Experiences

Hello. First of all, I would like to congratulate everyone on the coming New Year and immediately get down to business. This article will focus on creating simple programs for Bada - operating system for mobile devices which are issued Korean Samsung. I want to say in advance that under the cut is a simple recipe for making a simple application without lengthy discussions about the optimality and harmony of the code.
There are already quite detailed articles on Habré that are devoted to Bada, for example, this and this one, but there is no step-by-step description of creating an application for beginners. To whom it is interesting - I ask under kat.


The topic for writing arose by chance - a friend is actively engaged in establishing the boundaries of land using GPS in a geodetic company; the specifics of the work (where did it come from - good question) is that the received geodetic coordinates (let me explain what latitude and longitude are meant) must be converted into rectangular ones right after they are received. The company does not have laptops capable of withstanding an 8-hour working day and is not planning to, but a friend recently bought a smartphone from Samsung actively promoted in Ukraine with operating system Bada, Then the question followed - if you can download games for your phone, is there an application that can solve the described purely engineering problem? Such an application, of course, was not found, and I received a kind offer to write one for a certain fee.

Tools
To develop applications for Bada, the Bada SDK 1.2.0 is used, which can be downloaded by registering on the Bada developer site. There is nothing complicated in this process, but at the stage of choosing files for downloading, I, frankly, “blunted” by downloading only the SDK, and the so-called language pack(language pack) no, hoping that, as written on the site, its download will happen after installing the SDK automatically. However, at the installation stage, something went wrong, the installation continued without downloading the language pack, which subsequently led to the inability to build (build), let alone run the application.
After downloading the SDK and the language pack, they should be put in one place, and when SDK installation or if it is modified, the installer will pick up the language pack and install it on its own.
The actual creation of the application

The development environment is based on Eclipse, the C++ programming language used. Let's start by moving on to creating a new application with the obvious command File -> New -> bada Application Project. In the window that appears, define the name of the project in the Project name field, select the application type in the Project Type list - bada Form Based Application.

Next, the environment will ask you to determine the technical parameters of the device for which the application will be intended (screen resolution, GPS, etc.). These settings are defined in a special manifest file, Manifest.xml, which can be selected from the SDK files, created and downloaded from the Bada Developers site, or you can create your own. Without further ado, I used the manifest file from the Samples folders that are installed with the SDK, since my application did not require any "bells and whistles", but only the screen resolution was important.

Next, the environment will ask you to specify the root directory of the SDK, this should not be a problem. After selection, the name of the device model and its API will appear in the list, which will be used in the future for programming.

The next step is to determine the name of the default form that will appear immediately after the application starts. *.h and *.cpp files will be generated by this name.

Next, you need to determine whether or not to add auto-scaling support and the best screen resolution, if this feature is added. I understand that it is better to do this, since the application will be able to run on different devices with a different resolution and it does not have to be redone.

The next link in a long chain of settings is the definition of an Application ID, to authenticate the application's functions if it needs to read and write to protected folders. I didn't need it, so I omitted this step.

Nearly finished - defining the obvious Name, Vendor, and Description application properties.

And now it’s almost almost the end - this is the definition of the necessary configurations for development: I recommend leaving everything by default, and now the most important configuration is Simulator-Debug - this is the ability to debug code on a device simulator, Target-Release - configuration for compiling the application before uploading it to real device.

The last step is the summary of all the settings in the Summary window, which you can read again and make sure that everything is selected correctly.

After the final settings, the future application appears in the Project Explorer, clicking on which leads to the disclosure of resource files in the Resources window and the appearance of the following window:

After clicking on the form (and in general on any control) on the Properties tab, you can change the obvious properties of the application, such as text in the title, background color, presence and name of soft keys.

I immediately moved the ready-made button, which the environment kindly generated, lower and wrote Calculate on it. Having a GUI Editor, it is easy to get the following interface, which is well suited for my task (I believe that the process of transferring controls to a form and setting their properties does not cause any difficulties); as labels for input fields, the obvious Label is used, as input fields - EditField; Labels are also used to display the result of calculations, since their editing is not provided:

Now the coding itself.

The running application goes through several stages (the Help is very detailed, you can find details there), now we are primarily interested in the application initialization stage, which is responsible for the OnInitializing (void) method of the form class, which can be found in the file<ВАША_ФОРМА>.cpp in the project's src folder.

By default, this method looks like this:

Result Form1::OnInitializing(void) ( result r = E_SUCCESS; // TODO: Add your initialization code here // Get a button via resource ID __pButtonOk = static_cast

Share