Professional Documents
Culture Documents
Application
bada 1.2.0
Copyright © Copyright
2010 Samsung Electronics
© 2010 Samsung Co., Ltd. All Co.,
Electronics rightsLtd.
reserved. 1
All rights reserved.
Contents (1/2)
• Essential Classes
• Relationships between Classes
• Overview
• bada Applications
– Application Model
– Launching Application
– Terminating Application
• Application State Transition
– Application Life-cycle
– Foreground and Background
• System Events
• Application Framework
• Internationalization
• Launching Applications
Provides a repository to save and load user application‟s state and context. AppRegistry
Provides application launching mechanism to use other application control features. AppControl
• Interfaces
Feature Provided by
OnAppControlCompleted() FindAppControl()
AppRegistry
AppControl
Start()
MyApplication
AppResource
NotificationManager
int OspMain()
Running OnBackground()
Application
Exit
Application life-cycle
Form
AppResource
“Hello”
eng-GB.xml
Menu Back
Language Setting Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 23
Internationalization (2/2)
Retrieving localized strings
1. Prepare the localized strings table with the UI Builder. For more
information, see Using String Tables in the Development Environment
tutorial.
2. Get the localized string from the AppResource class.
AppResource retrieves the chosen language from the display
language settings and returns the localized strings.
OPERATION_SIGNOUT This operation can be used to sign out from the bada Server. This operation
signs out without displaying any dialog. Using this AppControl requires
special privileges.
APPCONTROL_CAMERA OPERATION_CAPTURE This operation can be used to launch the Camera UI to capture images or
record video.
APPCONTROL_MESSAGE OPERATION_EDIT This operation can be used to compose SMS or MMS messages. The
parameters passed to this application control are automatically filled in the
appropriate fields in the displayed message composer.
APPCONTROL_EMAIL OPERATION_EDIT This operation can be used to compose email messages. The parameters
passed to this application control are automatically filled in the appropriate
fields in the displayed message composer.
APPCOTNROL_BT OPERATION_PICK This operation can be used to obtain the details of a Bluetooth profile on the
device.
APPCONTROL_IMAGE OPERATION_VIEW This operation can be used to view image files on the device.
APPCONTROL_VIDEO OPERATION_PLAY This operation can be used to play video files on the device.
APPCONTROL_AUDIO OPERATION_PLAY This operation can be used to play audio files on the device.
APPCONTROL_SETTINGS OPERATION_DEFAULT This operation can be used to view the settings of a specific feature category.
Currently, only the location category is supported.
[AppControl Resolver]
AppControls
Registry #Dial
#Video type=“…”
#SignIn type=“…” Path=“…”
#Browser
type=“…” Path=“…”
type=“…” type=“…”…
Path=“…”… Path=“…”
Path=“…”
…
… …
Caller Media
Application Application Caller Dialer
Application Application
Application Name
Application GetAppName()
Application ID Manifest.xml
GetAppId()
if(r == E_KEY_NOT_FOUND
{
appRegistry.Add("GameStatus", gamestatus);
}
appRegistry.Save();
…
}
Notes:
– If you require event handlers, implement an
IAppControlEventListener.
AppControl* pAc = AppManager::FindAppControlN(APPCONTROL_SIGNIN, OPERATION_SIGNIN);
if(pAc != null)
{
pAc->Start(null, this);
delete pAc;
}
else
AppLog("AppControl Not Found. \n");
Called application:
void CalleeApp::OnUserEventReceivedN (RequestId requestId, Osp::Base::Collection::IList *pArgs)
{
if(requestId == AppLaunchRequestId) // If launch arguments exist
{
if(pArgs)
{
for(int i = 0; i < pArgs->GetCount(); i++)
AppLog("pData[%d]=%S", i, ((String*)(pArgs->GetAt(i)))->GetPointer());
// pArgs[0] represents the launch type (for example, APP_LAUNCH_NORMAL value)
// pArgs[1] represents the operation of the launch (default value is OPERATION_DEFAULT).
// pAgrs[>=2] contains the actual arguments sent from the caller (for example, “yourdata”)
…
}
else // Handling User Events
pNotiMgr->Construct();
String *aArg = new String(L”1234567890”); // ID of the new application whose details you want to view
pArgList->Add(*aArg);