appbackr Cocos2d-X Guide for Tizen

barbarousmonthΚινητά – Ασύρματες Τεχνολογίες

10 Δεκ 2013 (πριν από 3 χρόνια και 7 μήνες)

112 εμφανίσεις

appbackr
Cocos2d
-
X Guide

for Tizen

This is a guide to help you set up Cocos2d
-
x game apps using the Tizen IDE


Preparing the App

2

Download the lastest cocos2d
-
x form

2

Create certificate file

2

Add a Back Button

3

Screen Resolution

3

Create an Emulator

3

Creating a Web App

7

Initializing the App

7

Building the App

9

Troubleshooting

14





Preparing the App

Download the la
test cocos2d
-
x form

https://github.com/cocos2d/cocos2d
-
x



If needed, download the Tizen IDE

https://developer.tizen.org/downloads/tizen
-
sdk


Create certificate file

Run {TIZEN_SDK}/tools/certificate
-
generator/certificate
-
generator.bat or .sh


Click 'Window'
-
>'Preference'
-
>'Tizen SDK'
-
>'Secure Profiles'

1.

Click 'Add' button to set the profile.

2.

Set the Certificate path.

3.

Input the password.


Install the Tizen IDE: https://developer.tizen.org/downloads/tizen
-
sdk


Add a Back Button

One requirement of Tizen is that apps use the hardware “back” button, and the minimum function is to
close the app and return to the home screen.

You may implement th
is on your own, but if you just want to use it to close the web app, simply add this
script to your index.html:
http://pastebin.com/rApaGUn9

Apps that do not at least have this minimum function will not pass
the Tizen Review.

Screen Resolution

The Tizen HD screen has a width of 720px and height of 1280px. If your app has hard
-
coded resolutions,
please adjust to the proper resolution for optimal user experience.

Create an Emulator

1.

Select “Emulator Manager” fro
m the top left of the Connection Explorer.



2.

The Emulator Manager Window will appear. Select “Create New VM”.




3.

Name the VM


4.

The VM will now appear in the Emulator Manager.






5.

Click the “Play” button to launch the Emulator





Creating a Web App

Initializing the App

1.

Launch the Tizen IDE and create a “New Project”


2.

Select General > Project




3.

Name the project and then select the directory of your existing Web App project


4.

Once a valid project name and project path is selected, select “Finish”.



The new project will then appear in your Project
Explorer on the left.



Building the App

1.

Setup Manifest File (config.xml)

If this file does not already exist, create this file in the project’s root directory with these contents:
http://pastebin.com/BGNMLYGx



Open config.xml in the Project Explorer and change the values in these fields:




Select the icon for the Project using “Browse…”





Once it’s selected it will appear on the right side, sized
to the right dimensions.




Generate a unique ID for the by selecting the “Tizen” tab...




S
elect “Generate”


You may also change the Project Orientation
under “setting”




2.

Setup Project File (.project)

When you create a new Project, a “
.project” file is created in the Project’s root directory. Within the
Tizen IDE, use File > Open File…




O
pen up “.project” (this is normally
hidden from view)




Make sure the contents of the
project file match this:
http://pastebin.com/1MWSyqvS



R
eplace [ProjectName] with the name of your project




3.

Build the App



Right
-
click on the project in the Project
Explorer and select “Build Project”



If the build is successful, it will a
p
pear in the
Project Explorer






4.

Run the App

Right
-
click on the project in the Project and select “Run As… > Web Application”


This will launch the project in the selected device in the Connection Explorer.


Troubleshooting

These are a list of

possible pitfalls that may cause your build to fail, or may result in the app crashing
while running:



Did you create an author certificate?



Are there files with non
-
unicode characters in the filename?



Are there any alerts?



Are you catching cross
-
origin re
quests?