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!