System Events
Application 类提供了处理如下系统事件的事件处理器
- 电池事件(Battery events)
- 内存事件(Memory events)
- 屏幕事件(Screen events)
电池事件(Battery Events)
当电池电量等级改变时该事件被触发。像相机、MP3播放器这样耗电量大的多媒体应用需要检测电池电量等级。使用 OnBatteryLevelChanged()
事件处理器来处理电池事件。 当电池电量等级改变时该处理器被调用。
根据电量,推荐下面的处理方式:
- EMPTY:关闭应用程序。
- CRITICAL:停止使用多媒体特性,因为在该电量等级下,不能保证他们能够正常使用。
OnBatteryLevelChanged()
事件处理器的使用方法如下:
void MyApplication::OnBatteryLevelChanged(BatteryLevel batteryLevel)
{
// TODO:
}
内存事件(Memory Events)
当设备内存低时该事件被触发。当内存低或不足以运行一个应用时,在OnLowMemory()事件处理器中从堆中释放不用的内存。
OnLowMemory() 事件处理器使用方法如下:
void MyApplication::OnLowMemory(void)
{
// TODO:
}
屏幕事件(Screen Events)
An application can receive screen events in OnScreenOn() and
OnScreenOff()
event handlers if it registers a screen event listener. When the OnScreenOff() event
handler is triggered, the application must reduce power consumption by releasing
the activated resources, such as 3D, media, and sensors, which are no longer
used. The released resources can be acquired again when the OnScreenOn() event
handler is triggered.
You must handle the resources efficiently in the OnForeground(), OnBackground(), OnScreenOn(), and
OnScreenOff()
event handlers. Be careful not to duplicate or delete
resources.
For example:
- When the touch panel auto-lock mode is enabled in the device, the OnBackground() event
handler is called directly after OnScreenOff().
- When the backlight time expires, the OnScreenOff() event
handler is triggered. If the device is in the auto-lock mode, OnBackground() is
called after OnScreenOff() when the
lock UI is displayed.
- When the unlock key is pressed, if the touch lock is enabled, OnScreenOn() is
triggered. The OnForeground() event
handler is called after the lock UI disappears.
- When the lock key is pressed, OnBackground() is
called after the lock UI is displayed. When the backlight turns off, OnScreenOff() is
called.
OnScreenOn() 和
OnScreenOff()事件处理器使用方法如下:
void MyApplication::OnScreenOn (void)
{
//TODO:
}
void MyApplication::OnScreenOff (void)
{
//TODO:
}
For more information on system events, see the API
Reference.
分享到:
相关推荐
此举被业界视为三星手机业务走向独立自主道路的里程碑事件,而bada智能系统在三星手机中的应用比例大幅上升的同时,Android、Windows Mobile及Symbian系统的比例势必面临下降的局面。有市场机构甚至预测:Windows ...
基于bada手机操作系统的网址导航系统,用户操作界面良好,有很好的参考价值
bada系统文件读取工具,支持S5750e,S8500等三星吧嗒系统手机
三星bada系统越狱工具 applist0816版 用于三星bada系统越狱
bada2.0培训_1_1_bada简介
bada_SDK_2.0.1 bada_SDK_2.0.1 bada_SDK_2.0.1 bada_SDK_2.0.1 bada_SDK_2.0.1 bada_SDK_2.0.1 bada_SDK_2.0.1
手刷2.0版BADA必备工具。MultiLoade这个刷机平台任何版本在win7下都可以运行,也就是说不存在兼容性问题,亲测! 具有很好的兼容性,win7兼容更完美!
在bada中开发游戏或者应用程序是或多或少会用到文件甚至数据库相关操作,这里我先只为大家介绍在bada系统中如何进行简单的文件操作,在以后我会和大家分享关于bada数据库的一些知识。
Bada承接三星TouchWIZ的经验,支持Flash界面,对互联网应用、重力感应应用、 SNS应用有着很好的支撑,电子商务与游戏开发也列入Bada的主体规划中,Twitter、CAPCOM、EA和Gameloft等公司为Bada的紧 密合作伙伴
bada 语言中文包 part1,总共 12部分 需全部下载
bada 语言中文包 part9,总共 12部分 需全部下载
bada的初步讲解,以及bada环境的搭建,系统函数的调用
bada的中文开发教程 基础知识 适合初学者
能够帮助大家更好的学习bada,更好的认识bada,确实是一个耗资源
Bada SDK第7部分,共20部分。包含原代码例子。
Bada SDK第20部分,共20部分。包含原代码例子。
bada 各个模块的 介绍文档 2 badaTutorial CSDN 有文件大小限制 故分上下
Bada软件开发
一个简单的bada计算器,可以安装到bada的手机中