Application Migration Guide Tizen 2 1 to 2 2 .pdf



Nom original: Application_Migration_Guide_-_Tizen_2_1_to_2_2.pdfAuteur: 신선미/Service Platform그룹(무선)/S5(책임)/삼성전자

Ce document au format PDF 1.5 a été généré par Microsoft® Word 2010, et a été envoyé sur fichier-pdf.fr le 14/08/2014 à 14:53, depuis l'adresse IP 82.66.x.x. La présente page de téléchargement du fichier a été vue 532 fois.
Taille du document: 874 Ko (22 pages).
Confidentialité: fichier public


Aperçu du document


Application Migration Guide
- Tizen 2.1 to 2.2

Application Migration Guide - Tizen 2.1 to 2.2

Table of Contents
1. Changing the API Version from 2.1 to 2.2 ....................................................... 4
2. UI Migration for Web Application ..................................................................... 5
2.1. Footer with Additional Buttons .................................................................................................. 5


Event binding ..................................................................................................................... 6



Event unbinding ................................................................................................................. 7



Restriction .......................................................................................................................... 7



jQM footer backward compatibility .................................................................................... 7

2.2. Footer with only Menu and Back Buttons ................................................................................. 7
2.3. No Footer .................................................................................................................................. 8

3. UI Migration for Native Application ................................................................ 10
3.1. Handling Physical Menu and Back Keys ................................................................................ 10
3.1.1.

Footer with only Menu and Back Buttons ........................................................................ 12

3.1.2.

Footer with Additional Buttons ......................................................................................... 12

3.1.3.

Applications without Form ............................................................................................... 13

3.2. Header and Footer Style......................................................................................................... 13
3.3. Indicator Style ......................................................................................................................... 15
3.4. Font Update ............................................................................................................................ 16
3.5. Native UI Builder ..................................................................................................................... 16

4. API and Privilege Checker .............................................................................. 18
4.1. Using the API and Privilege Checker ..................................................................................... 18
4.2. Solving Privilege Issues .......................................................................................................... 19
4.3. Solving Compatibility Issues ................................................................................................... 20
4.4. Solving Deprecation Issues .................................................................................................... 21

Except as noted, this content - excluding the Code Examples - is licensed under Creative Commons Attribution 3.0 and all of the Code Examples contained
herein are licensed under BSD-3-Clause.
For details, see the Content License.

2| Page

Application Migration Guide - Tizen 2.1 to 2.2

Overview
This document describes how to migrate to Tizen API version 2.2 those Tizen applications that are developed with
Tizen 2.1.
Note:
The legacy Tizen API version 2.2 is called „Tizen 2.2‟.

Except as noted, this content - excluding the Code Examples - is licensed under Creative Commons Attribution 3.0 and all of the Code Examples contained
herein are licensed under BSD-3-Clause.
For details, see the Content License.

3| Page

Application Migration Guide - Tizen 2.1 to 2.2

1. Changing the API Version from 2.1 to 2.2
To change the Tizen API version from 2.1 to 2.2 in your application:
1. Change the application project information and code:


Main menu icon size
The icon size has changed to 117 x 117. Change the icon in the Basic tab of the manifest editor.



UI migration for Web Application or UI migration for Native Application

2. To build your converted application project, do one of the following:


In the Project Explorer, select your Tizen application project and press the F10 key.



In the Project Explorer, select your Tizen application project and, , go to Project > Build Project.

3. Right-click your application project and select the Properties > C/C++ Build > Tizen Settings > API and
Privilege Checker options.
Build the application and check the API and Privilege Checker results. If the results contain errors, make sure
that the APIs and application privileges have been used properly in the application.
4. Test and repackage the application.
5. Register the upgraded application on the Tizen Store when the Tizen device is released.

Except as noted, this content - excluding the Code Examples - is licensed under Creative Commons Attribution 3.0 and all of the Code Examples contained
herein are licensed under BSD-3-Clause.
For details, see the Content License.

4| Page

Application Migration Guide - Tizen 2.1 to 2.2

2. UI Migration for Web Application
The following sections describe the required UI migration details that can affect your application.
In Tizen 2.1, only the Home key was supported in hardware. In Tizen 2.2, the Menu and Back keys are added to
hardware keys. To handle the Menu and Back key events, a modification is required to associate the software Menu
and Back buttons with the hardware Menu and Back keys. Change your application as described in the following
sections.

2.1. Footer with Additional Buttons
If the footer of your Tizen 2.1 application has other buttons in addition to the Menu and Back buttons, the other
buttons remain in the footer after the migration, and minimal changes are required.
Figure: Migration when the footer has additional buttons

In the Web application, it is required to define normal buttons in footer without back/menu button. Do not declare
data-add-back to page.

<div data-role=”page”> // do not declare data-add-back option

Except as noted, this content - excluding the Code Examples - is licensed under Creative Commons Attribution 3.0 and all of the Code Examples contained
herein are licensed under BSD-3-Clause.
For details, see the Content License.

5| Page

Application Migration Guide - Tizen 2.1 to 2.2
<div data-role=”footer>

// add normal button markups
</div>
</div>

To use hardware Back and Menu key, refer to following steps:
When the hardware Back key or Menu key is pressed, the “tizenhwkey” event is triggered. You can bind event
handlers on the "tizenhwkey" event to be run on the press of the hardware keys.



Event binding
The Tizen Web UI Framework is based on jQuery/jQueryMobile, so in order to bind an event handler on the
Hardware key event, you can use jQuery on() function like below code examples.
Binding an event callback on the back button
// Javascript code
$( window ).on( "tizenhwkey", function ( ev ) {
if ( ev.originalEvent.keyName === "back" ) {
// call browser back if webApp dev. wants back behavior
window.history.back();
// add script if there is a need to add another behavior
// on H/W back key press
}
}

Binding an event callback on the ,menu button
// HTML code
<div data-role="popup" id=”popup1” class="ui-ctxpopup-optionmenu">
<ul data-role="listview">
<li><a href="#">Settings</a></li>
<li><a href="#">Add to contact</a></li>
<li><a href="#">Call log</a></li>
<li><a href="#">Music</a></li>
</ul>
</div>

Except as noted, this content - excluding the Code Examples - is licensed under Creative Commons Attribution 3.0 and all of the Code Examples contained
herein are licensed under BSD-3-Clause.
For details, see the Content License.

6| Page

Application Migration Guide - Tizen 2.1 to 2.2
// Javascript code
$( window ).on( "tizenhwkey", function ( e ) {
if ( e.originalEvent.keyName === "menu" ) {
$("#popup1").popup("open");
}
}



Event unbinding
Just run jQuery off() function to unbind all event on the H/W keys.
// Javascript Code
$( window ).off( "tizenhwkey" );



Restriction
Attach “tizenhwkey” event in „window‟ object in app side. Because web ui framework bind hw key handling to
„document‟ event, we can‟t guarantee basic behavior(active popup close when h/w key pressed) if webApp bind
„tizenhwkey‟ event to „document‟ object.
It may conflict basic behavior if webApp developer binds „tizenhwkey‟ to „document‟ object



jQM footer backward compatibility

If the footer( menu button or back button ) is defined in html file with jQM style, Tizen Web UI Framework support
jQueryMobile back button optionally, and framework draws tizen footer( some cases including menu button or back
button). The hardware key is required to connect manually because framework doesn‟t link jQM‟s software button to
hardware key automatically.

2.2. Footer with only Menu and Back Buttons
If the footer of your Tizen 2.1 application has only the Menu and Back buttons, the footer is removed in Tizen 2.2 and
used as extra client area.
Except as noted, this content - excluding the Code Examples - is licensed under Creative Commons Attribution 3.0 and all of the Code Examples contained
herein are licensed under BSD-3-Clause.
For details, see the Content License.

7| Page

Application Migration Guide - Tizen 2.1 to 2.2
Figure: Migration when the footer only has Menu and Back buttons

In the Web application,

the footer is not defined. So, don‟t declare data-add-back to page.

<div data-role=”page”> // do not declare data-add-back option

// do not declare footer
</div>

To use hardware key, refer to Section Footer with Additional Buttons.

2.3. No Footer
Except as noted, this content - excluding the Code Examples - is licensed under Creative Commons Attribution 3.0 and all of the Code Examples contained
herein are licensed under BSD-3-Clause.
For details, see the Content License.

8| Page

Application Migration Guide - Tizen 2.1 to 2.2
If your Tizen 2.1 application has no footer, you must still handle the hardware Menu and Back keys in Tizen 2.2.
Figure: Migration when no footer is used

In the Web application, no changes are required in the HTML code. To use hardware key, refer to Section Footer
with Additional Buttons.

Except as noted, this content - excluding the Code Examples - is licensed under Creative Commons Attribution 3.0 and all of the Code Examples contained
herein are licensed under BSD-3-Clause.
For details, see the Content License.

9| Page

Application Migration Guide - Tizen 2.1 to 2.2

3. UI Migration for Native Application
The following sections describe the UI changes that have been introduced with Tizen 2.2.
The UX has under-gone minor GUI tweaking to provide better usability. Some of these changes affect the application
i.e. reduction in height of the Header provides more client area real estate for the application to work with, so please
follow the guide in the following sections to make sure your application is looking its best in Tizen 2.2.

3.1. Handling Physical Menu and Back Keys
In Tizen 2.2, the physical Menu and Back keys are now mandatory part of Tizen. Some UX revisions and application
changes are required to support this addition.
In Tizen 2.1, The Footer provided a soft back button and the IFormBackEventListener for handling of the back
button. With the support for physical back keys in Tizen 2.2, the support for the back key in the Footer is removed.
However, the Form‟s IFormBackEventListener is still triggered when the physical back key is pressed, so the
same listener can be used without any code modification.
Similarly, a new event listener IFormMenuEventListener for handling the physical Menu key has been added.
Both physical keys can be handled via the Form‟s listeners, or they can be handled keys using the key event
listeners, as well.
Along with physical Menu key support, the recommended UX for showing the menu has changed from the
ContextMenu to the behavior provided by the OptionMenu class. The application no longer needs to worry about
positioning of the menu, it is now fixed to the bottom of the screen.
The following steps show the complete process to properly support the Menu key.


Modify event handling
Use the IFormMenuEventListener interface (new for Tizen 2.2) and the IFormBackEventListener
interface to handle key presses.
class HWKeyForm
: public Tizen::Ui::Controls::IFormBackEventListener
, public Tizen::Ui::Controls::IFormMenuEventListener
{
public:
// IFormBackEventListener
virtual void OnFormBackRequested(Tizen::Ui::Controls::Form& source);
// IFormMenuEventListener
virtual void OnFormMenuRequested(Tizen::Ui::Controls::Form& source);
};

Except as noted, this content - excluding the Code Examples - is licensed under Creative Commons Attribution 3.0 and all of the Code Examples contained
herein are licensed under BSD-3-Clause.
For details, see the Content License.

10| Page

Application Migration Guide - Tizen 2.1 to 2.2

Modify Footer UI handling



You should not use Footer::SetBackButton() method to enable back buttons on the Footer anymore.
result HWKeyForm::OnInitializing(void)
{
Footer* pFooter = GetFooter();
pFooter->SetStyle(FOOTER_STYLE_BUTTON_TEXT);
pFooter->SetBackButton(); // Not needed anymore
__pMenu = new (std::nothrow) OptionMenu();
__pMenu->Construct();
__pMenu->AddItem(L"item 0", ID_CONTEXT_ITEM+0);
__pMenu->AddActionEventListener(*this);
__pMenu->SetShowState(false);
SetFormBackEventListener(this);
SetFormMenuEventListener(this);
return r;
}


Change the menu control
The ContextMenu class has some style differences with the new menu in Tizen 2.2, so change the
ContextMenu object to an OptionMenu (new in Tizen 2.2) object. From the API point of view, the only
difference between the old ContextMenu and the new OptionMenu is that the ContextMenu requires
anchor position to be specified by the application, while the OptionMenu handles positioning automatically.
In Tizen 2.1:
__pMenu = new (std::nothrow) ContextMenu();
__pMenu->Construct(anchor point, style);
__pMenu->AddItem(L"item 0", ID_CONTEXT_ITEM+0);
__pMenu->AddActionEventListener(*this);
__pMenu->SetShowState(false);
In Tizen 2.2:
__pMenu = new (std::nothrow) OptionMenu();
__pMenu->Construct();
__pMenu->AddItem(L"item 0", ID_CONTEXT_ITEM+0);
__pMenu->AddActionEventListener(*this);
__pMenu->SetShowState(false);

Except as noted, this content - excluding the Code Examples - is licensed under Creative Commons Attribution 3.0 and all of the Code Examples contained
herein are licensed under BSD-3-Clause.
For details, see the Content License.

11| Page

Application Migration Guide - Tizen 2.1 to 2.2

3.1.1.

Footer with only Menu and Back Buttons

If the Footer of your Tizen 2.1 application is only used for the menu and back buttons, the Footer should be removed
since it no longer provides any functionality. The freed area should be used by the application as client area. Physical
menu and back keys do not require a Footer to be handled.

Figure 1 Case when the Footer only has Menu and Back buttons

3.1.2.

Footer with Additional Buttons

If the Footer of your Tizen 2.1 application has other buttons in addition to the menu and back buttons, the other
buttons remain in the Footer after the migration, so there is no change to the client area. In this case, no additional
changes are required.

Except as noted, this content - excluding the Code Examples - is licensed under Creative Commons Attribution 3.0 and all of the Code Examples contained
herein are licensed under BSD-3-Clause.
For details, see the Content License.

12| Page

Application Migration Guide - Tizen 2.1 to 2.2

Figure 2 Case when the Footer has additional buttons

3.1.3.

Applications without Form

In case of applications without a Form, such as full-screen GL game apps, the menu and back keys can be handled
by adding IKeyEventListener or IPropagatedKeyEventListener listeners to the Frame. This is possible
because the menu and back keys are treated just like normal keys - KEY_MENU and KEY_BACK, respectively.

3.2. Header and Footer Style
The height of the Header has been reduced from 111 to 96 when in portrait mode, and the client size has also
changed accordingly. Therefore, applications should check if all layouts of controls work well in the new client area
size.
In addition to the above changes, new Header and Footer styles with taller height were added in Tizen 2.2.
(HEADER_STYLE_TAB_LARGE and FOOTER_STYLE_TAB_LARGE)

Except as noted, this content - excluding the Code Examples - is licensed under Creative Commons Attribution 3.0 and all of the Code Examples contained
herein are licensed under BSD-3-Clause.
For details, see the Content License.

13| Page

Application Migration Guide - Tizen 2.1 to 2.2

Figure 3 The height of Headers in Tizen 2.1

Figure 4 The height of Headers in Tizen 2.2

You can also see that there were some GUI tweaks in color, positioning of the tab items inside the Header, etc. These
changes do not directly affect the API so there should be minimum migration activities due to such changes. However,
since the look and feel of your application can change, please make sure that your application works well with the
renewed GUI of Tizen 2.2.

Except as noted, this content - excluding the Code Examples - is licensed under Creative Commons Attribution 3.0 and all of the Code Examples contained
herein are licensed under BSD-3-Clause.
For details, see the Content License.

14| Page

Application Migration Guide - Tizen 2.1 to 2.2

3.3. Indicator Style
In Tizen 2.2, the thin indicator in landscape mode has been removed and applications should use thenewly added
Form style, FORM_STYLE_LANDSCAPE_INDICATOR_AUTO_HIDE for the indicator to be displayed when in
landscape mode. Even then, the indicator will only be made visible when the user flicks down on the top part of the
screen.

Figure 5 Indicators in Tizen 2.1

Figure 6 Indicators in Tizen 2.2

Previously, the landscape Form followed the same indicator style set for the portrait view. The style have been
separated in Tizen 2.2, so it is now required to set the indicator style separately. Be default, if you only set the styles
for the portrait view, then the landscape view will not show any indicator, even when user does the flick down. For
most cases, it is recommended to use the FORM_STYLE_LANDSCAPE_INDICATOR_AUTO_HIDE style.

Except as noted, this content - excluding the Code Examples - is licensed under Creative Commons Attribution 3.0 and all of the Code Examples contained
herein are licensed under BSD-3-Clause.
For details, see the Content License.

15| Page

Application Migration Guide - Tizen 2.1 to 2.2

3.4. Font Update
Tizen Sans font which was part of Tizen 2.1 has been made slightly larger in Tizen 2.2 for better legibility. It is
possible that the larger size can cause some layout issues where some parts of character are getting clipped, so
please check your layout to make sure there are no such issues.

Figure 7 Revised Tizen Sans font

3.5. Native UI Builder
To support the hardware Menu key, which is added in Tizen 2.2, the Menu button is added to the native UI Builder.
The Web UI Builder has no Menu button, because the Web UI Builder has no support for the context pop-up which
processes the Menu button in the Web UI.
Figure: Menu button in the Native UI Builder

Except as noted, this content - excluding the Code Examples - is licensed under Creative Commons Attribution 3.0 and all of the Code Examples contained
herein are licensed under BSD-3-Clause.
For details, see the Content License.

16| Page

Application Migration Guide - Tizen 2.1 to 2.2

Except as noted, this content - excluding the Code Examples - is licensed under Creative Commons Attribution 3.0 and all of the Code Examples contained
herein are licensed under BSD-3-Clause.
For details, see the Content License.

17| Page

Application Migration Guide - Tizen 2.1 to 2.2

4. API and Privilege Checker
In Tizen 2.2, some features are changed due to the following issues:


Privilege
If there are APIs that have a changed privilege in your application, the manifest.xml file must be updated.
You can check improper privileges in the API and Privilege Checker and solve them through the native API
Reference.



Compatibility
You can check for APIs with compatibility issues while using the API and Privilege Checker. Make sure you
follow the compatibility description of the native API Reference.



Deprecated API
For deprecated APIs, you can check them with the API and Privilege Checker. To ease the application
maintenance, do not use deprecated APIs. For more information on the deprecated APIs, see the native API
Reference.

4.1. Using the API and Privilege Checker
The API and Privilege Checker helps you to check whether you are using the OSP APIs properly. Before building
your application, select C/C++ Build > Tizen Settings > API Privilege Checker in your application project
Properties and select the items that you want the tool to check.
Figure 8: API and Privilege Checker

Except as noted, this content - excluding the Code Examples - is licensed under Creative Commons Attribution 3.0 and all of the Code Examples contained
herein are licensed under BSD-3-Clause.
For details, see the Content License.

18| Page

Application Migration Guide - Tizen 2.1 to 2.2

If the tool detects any issues, they are shown in the Problems view after the build is complete. To solve issues for
each API, see the information in the native API Reference.

4.2. Solving Privilege Issues
The following alarms with the specific API in the Problems view after building your application point to privilege
issues:


Undefined privilege alarm



Unused privilege alarm

Check the manifest.xml file and update it to use the API. In the IDE, you can select and update privileges. The
following figure shows how the privilege information is given in the native API Reference.
Figure 9: Privilege information in the native API reference

Except as noted, this content - excluding the Code Examples - is licensed under Creative Commons Attribution 3.0 and all of the Code Examples contained
herein are licensed under BSD-3-Clause.
For details, see the Content License.

19| Page

Application Migration Guide - Tizen 2.1 to 2.2

4.3. Solving Compatibility Issues
The following alarm with the specific API in the Problems view after building your application points to a compatibility
issue:


Compatibility alarm

Check the compatibility details of the API in the native API Reference, as illustrated in the following figure.

Except as noted, this content - excluding the Code Examples - is licensed under Creative Commons Attribution 3.0 and all of the Code Examples contained
herein are licensed under BSD-3-Clause.
For details, see the Content License.

20| Page

Application Migration Guide - Tizen 2.1 to 2.2
Figure 10: Compatibility information in the native API reference

Note:
The compatibility alarm does not disappear after updating your application code. It just gives you the notification.

4.4. Solving Deprecation Issues
The following alarm with the specific API in the Problems view after building your application points to the use of
deprecated APIs:


Deprecated API alarm

Update your application code based on the information in the native API Reference. The update is not mandatory, but
makes your application maintenance easier in the long run.

Except as noted, this content - excluding the Code Examples - is licensed under Creative Commons Attribution 3.0 and all of the Code Examples contained
herein are licensed under BSD-3-Clause.
For details, see the Content License.

21| Page

Application Migration Guide - Tizen 2.1 to 2.2
Figure 11: Deprecation information in the native API reference

Except as noted, this content - excluding the Code Examples - is licensed under Creative Commons Attribution 3.0 and all of the Code Examples contained
herein are licensed under BSD-3-Clause.
For details, see the Content License.

22| Page


Aperçu du document Application_Migration_Guide_-_Tizen_2_1_to_2_2.pdf - page 1/22
 
Application_Migration_Guide_-_Tizen_2_1_to_2_2.pdf - page 2/22
Application_Migration_Guide_-_Tizen_2_1_to_2_2.pdf - page 3/22
Application_Migration_Guide_-_Tizen_2_1_to_2_2.pdf - page 4/22
Application_Migration_Guide_-_Tizen_2_1_to_2_2.pdf - page 5/22
Application_Migration_Guide_-_Tizen_2_1_to_2_2.pdf - page 6/22
 




Télécharger le fichier (PDF)


Application_Migration_Guide_-_Tizen_2_1_to_2_2.pdf (PDF, 874 Ko)

Télécharger
Formats alternatifs: ZIP



Documents similaires


application migration guide tizen 2 1 to 2 2
manuel realisation digesteur v1n 300dpi
leflamboyantardynizuniaetsaputaindefracturedelajambe
fichier pdf sans nom 1
java for python programmers miller
1964 the barbaric tremissis tomasini

Sur le même sujet..