语言

Menu
Sites
Language
Native application in c++

Hi,


I am totaly new in tizen development. From the information I found Tizen native development is based on C (previously it was C/C++) starting in version 2.3.x. But I find also some information that a C++ native development is possible, my question is how to achieve this. Beause the Tizen IDE contains only C based templates and sample projects. I would be verry gratefull for a step by step walkthrough. 

Thanks.

响应

12 回复
Alex Dem

Hi,
I did not face such templates but it is so simply. If you create empty project and  rename "c" file to "cpp" compier will build your project as Cpp automatically.
Of course your code should be written as "cpp" (headers and sources).
Alexey.

Jeongsu Kim

It means that Tizen API is C Api. It doesn't mean that Tizen app should be based on C. C api can be used in C++ too.

Gary V

The original poster quite likely is not trying to find out whether Tizen allows C++ language for development in general, but rather whether Tizen provides any kind of C++ (object-oriented) -based APIs, as opposed to plain C -style (procedural) APIs. I have the same question, specifically when it comes to the area of UI development.

Tizen 2.x provided an elegant and easy to use C++ UI framework (Tizen::Ui::Controls::Frame, Tizen::Ui::Controls::Form, etc.), but Tizen 2.3 seems to insist on the horrific Enlightenment Foundation Libraries (EFL): hard-to-read, error-prone and time-consuming, thus too expensive for a commercial ISV. The excellent C language has its uses for example in Linux kernel, driver and library development, but no-one these days is trying to do modern UI development with C structures, C functions and ::alloc()s. I can't be the only one with such an opinion, since an unofficial port of QT for Tizen has been attempted, but is currently still in alpha and probably (?) already dead (no updates since March 2015).

Are there any official Tizen C++ UI APIs coming in the future? Any news on the previously announced Tizen 2.x Tizen::Ui port to Tizen 2.3/2.4?

Alex Dem

Hi,
Yes looks like latest released version of Qt for Tizen (feb 2014) was compatable with 2.2.1 .
afaik it is possible to use C++ for development (but it uses fully provided c api) and it is not so difficult as it seems. But maybe newest releases should be updated with some cpp templates/ cpp examples for better understanding.
also,fyi,discussion:
https://developer.tizen.org/forums/native-application-development/sdk-2.3.0-rev-1macos-native-project-c-templates
Alexey.

Alex Dem

also fyi:
https://developer.tizen.org/forums/native-application-development/it-possible-use-c-development
Alexey.

Gary V

Alex,

 

Thank you for the information.

 

Yes, we do know that Tizen supports C++ development in general and that EFL C APIs can be consumed from C++, but the problem I raise is that UI development with plain C (procedural) APIs is too tedious, thus takes too much developer time, thus costs too much for a commercial ISV (as opposed to open source development, where developers contribute their time for free). Android does Object-Oriented responsibility-separation with Java, iOS does Model-View-Controller with Objective-C, Windows 10 Mobile does Model-View-View Model with C#/C++ and Tizen does... what... C structures, functions and void pointers?

 

Have a look at Tizen hello-world-calculator sample, you will fall asleep halfway through the second *.c file. The learning curve is probably unbearable for new developers.

 

Carsten Haitzler from the EFL group (?) back in his April 2015 post mentions that C++ EFL "bindings" (whatever that might mean in practice) will be coming. As of today, I do not find any non-beta EFL C++ support, anywhere. And I do not mean a set of simple C++ wrappers, but an efficiently-designed UI framework, such as the now abandoned Tizen::UI.

 

Does anyone have any idea whether Samsung itself - aside from the EFL group - plans to support modern C++ development for Tizen?

 

Gary

Alex Dem

Hi,
I agree with you. prev 2.2.1 was more comfortable fo C++ developers. I hope someone from Samsung could answer this topic.
Alexey.

Carsten Haitzler

you ask if there are plans, then no there are no plans to build a whole c++ framework from scratch.

if a c++ api that allows you to use c++ directly with the api and inherit/override/etc. etc. is not good enough, then i guess ... you aren't actually asking for an api for you to use, but a more philosophical question - you refuse to develop for an api that isn't built using your chosen method from the ground up.

p.s. as for calculator: efl calculator in ~ 300 lines of c - https://git.enlightenment.org/apps/equate.git/tree/src/main.c - excluding yacc/bison parser for the input (more complex than calculator example). i'm not sure magical OO language dust would make that any simpler.

Gary V

Hi,

 

No, I'm not as much concerned with any kind of "philosophical" rivalry between C and C++, nor the question of whether any particular development end-result can be or cannot be achieved with a particular API, but rather with cost effectiveness, thus feasibility, of commercial Tizen application development. (That becomes especially important when it comes to a platform that has so far moved only a million hardware units or so.) My concerns do not really apply to library creation by experts with 10+ years of coding experience, but rather revolve around library (API) consumption by your average developer with 3 years of experience. IMHO, UI development with a plain C API will eventually, in the long run, end up being twice as time-consuming as UI development with a modern, exhaustive, rigid C++/Java framework. But that's just'a'HO.

 

At any rate, appreciate a clear answer.

 

Gary

Leo Liao

I do not want to join in the argue whether c or c++ is better for developer. No matter what language you use, you just use the programming tool to realize your idea, some concepts you used to build your own system. If you familiar with c, you can build it with c. If you familiar with c++, you can build it with c++.

But as a platform, since Tizen support both, Tizen should raise some examples for both.

jian chen

Can't agree more !

Eugene Kurzberg

For those who are still looking for a UI framework for Tizen take a look at DALi.