This section contains common questions about the Tizen native framework.
General | Q: Why does Tizen use two-phase
construction?
A: Tizen does not use the C++ exception mechanism. Due to historical reasons, Tizen includes a smaller footprint and runtime overhead. As a result, any exception occurring in C++ object construction cannot be reported to the application. Furthermore, when a failure occurs in allocating resources during an object's construction, the object is partially constructed and its destructor is not called, possibly causing a resource leak. To resolve these problems, Tizen uses the two-phase construction idiom for many classes where exceptions must be reported to Tizen native applications. For more information, see Two-phase Construction. |
---|
Q: What happens if I do not call a Construct() method?
A: It causes an assertion and your application is terminated. You must make sure that the Construct()method is invoked only once before an instance of a two-phase construction class is used. |
Q: Can I call the Construct()
method more than once?
A: No. All classes with two-phase construction have at least one Construct() method, and many classes have several overloaded Construct() methods to facilitate different scenarios. However, only 1 method can be used, and it can be called only once. A system assertion occurs if the Construct() method is called more than once. |
Q: Which programming languages can I use to develop a Tizen native application?
A: Use C++ to write the code for the Tizen native applications. |
Q: Can I use standard C?
A: Yes, partially. The Tizen SDK provides a subset of standard C functions that are useful and not subject to strong security vulnerabilities. The supported C functions are listed in the standard C library. |
Q: Can I use STL?
A: Yes. Tizen SDK supports STL (Standard Template Library). |
Q: Can I use a unique pointer?
A: Yes. Tizen SDK supports unique_ptr. For more information, see Using the Unique_ptr Class. |
Q: Can I use C++ try-catch exception
handling?
A: Yes, but only for your own application's C++ exceptions. Since the Tizen platform does not throw any C++ exceptions, there are no exceptions to catch using try-catch in the Tizen platform code. |
Q: Why are so many methods
asynchronous?
A: Many methods communicate with the Tizen Server. In order to prevent blocking and possible application freezing or crashing due to network delays, method results are returned asynchronously. |
Q: What happens if there is not enough
memory?
A: If memory is low, the OnLowMemory() event handler is invoked. Deallocate memory that your application is using, otherwise, your application is forcibly shut down. |
Q: What is an E_SERVER exception and how
can I handle it?
A: The E_SERVER exception indicates that an error occurred in the server logic. The application must check the errorCode and errorMsg for details. |
Q: How can I write logs?
A: Tizen defines 3 log categories: Info, Debug, and Exception. It also provides dedicated macros for those categories: AppLog(message), AppLogDebug(message), and AppLogException(message). For example, you can filter out some log categories, and write logs only to a file (but not to the console). For more information, see Log Macros. To print a Tizen::Base::String instance (for example, String str) to a log, use AppLog("%ls", str.GetPointer()). |
Q: How do you check for errors in Tizen?
A: Check the result of a method call or use the GetLastResult() method. For more information, see Exception Handling. |
Q: What does an "N" postfix
signify?
A: An "N" postfix in a method name indicates that you must manually delete the instance that it returns to avoid a memory leak. |
App |
---|
Q: Where do I initialize and free-up application resources?
A: Initialize application resources in the OnAppInitializing() event handler and free non-UI resources in the OnAppTerminating() event handler. UI resources, such as form and its child controls, are freed automatically when the application is closed. You do not need to free them explicitly. |
Q: Do I have to set my package's ID somewhere?
A: No, a package ID (a unique identifier bound to a Tizen package) is automatically created by the Tizen IDE and included in the generated application manifest file. You can also regenerate and set the package ID with the manifest editor in the Tizen IDE. |
Q: How can I kill a running application and process? Is there any API in Tizen which gives me the list of running applications and processes, and is it possible to kill some of them?
A: If you 'long-press' the Home key, you can see the list of running applications and you can terminate them. The Tizen::App::AppManager class provides the GetRunningAppListN() and TerminateApplication() methods for this purpose. |
Q: If the device receives an incoming call (for example) when my application is running, how is the event handled? How it is handled will help me decide the way the application runs, stops, resumes, and terminates.
A: When the application receives an incoming call, the OnBackground() event handler is called, and the decision on what to do is made in there. |
Base |
---|
Q: Can I use Buffer<int>
or Buffer<MyClass>?
A: No. Do not use either of them. Buffer<int> is the same as IntBuffer. It is highly recommended that you use only predefined buffers, such as DoubleBuffer, FloatBuffer, IntBuffer, LongBuffer, LongLongBuffer, WcharBuffer, and ShortBuffer. |
Base::Collection |
---|
Q: Is Collection thread-safe?
A: No. To make a thread-safe collection, you can subclass one of the Tizen collection classes, and override each of its methods in a thread-safe way. You can also use your own collection replacement. |
Q: What is the difference between Tizen::Base::Collection::ArrayList and
Tizen::Base::Collection::LinkedList?
A: ArrayLists store elements in contiguous memory space. This makes accessing ArrayLists by index very fast. However, adding and removing elements is slower than with a LinkedList. LinkedLists store elements in nodes that are connected by pointers. This makes accessing LinkedLists by index slower than accessing ArrayLists by index. However, adding and removing elements is faster than with an ArrayList. |
Base::Runtime |
---|
Q: When should I use an event-driven
thread?
A: Event-driven threads run based on events. They execute in a loop until they receive an event notification to terminate, and allow using asynchronous calls. On the other hand, worker threads run linearly and execute only their main body. Because these worker threads do not have a loop, asynchronous calls cannot be used. |
Q: How can I send a message to a
thread?
A: You can use shared variables between threads with synchronous objects, such as mutex, semaphore, or monitor. The Tizen::Base::Runtime::EventDrivenThread class provides the mechanism for sending and receiving messages between threads with the SendUserEvent() and OnUserEventReceivedN() methods. |
Q: Does Tizen support pthreads?
A: Currently, Tizen does not support pthreads. |
Base::Utility |
---|
Q: Why is -1 or 0 returned when
a WcharBuffer is
filled with data and the GetStringLengthInMb()
method is called?
A: -1 is returned if a null character does not exist between the current position of the WcharBuffer and its limit. 0 is returned if the value of the current position of the WcharBuffer is null. Call the Rewind() and SetPosition() methods on the WcharBuffer before invoking the GetStringLengthInMb() method to correctly set its current position. |
Content |
---|
Q: How can I set a condition for the DateTime column
in the ContentSearch::SearchN() method?
A: Set the time as a string by using the DateTime::ToString() method. |
Q: Where can I find downloaded media files?
A: If you download files using the Tizen::Content::DownloadManager class, you can save the files to the directory path returned by the GetDefaultDownloadPath() method of the Tizen::System::Environment class. |
Q: Is multiple content downloading supported by the DownloadManager::Start() method?
A: Yes. Multiple downloading is provided by DownloadManager. You can call the DownloadManager::Start() method several times. |
Graphics |
---|
Q: How can I draw a JPG or PNG?
A: Use the Tizen::Media::Image class to decode image files to Tizen::Graphics::Bitmap instances. |
Q: Why are my drawings not being
displayed?
A: Make sure that you call the Canvas::Show() method to display the canvas. |
Q: Can I use compressed textures for OpenGL® 1.1 or
2.0?
A: Yes. However, the supported formats differ between devices. Therefore, you must check which format is supported in the device by using the glGetString(GL_EXTENSIONS) function, and then use the supported textures only. |
Q: Is it possible to use OpenGL® ES and Tizen native forms in a single application?
A: Yes, you can have applications with both OpenGL® ES rendering and forms. You can create your application with multiple forms out of which one can be used for OpenGL® ES rendering. Just make sure that you create a GL surface by passing a form pointer to the eglCreateWindowSurface function. For more information, see GlesCube11 Sample Overview. |
Io |
---|
Q: How can I handle text files?
A: Tizen does not differentiate between text files and other file types. This means that Tizen does not run any translation between CR-LF and LF. (This is the same behavior as Unix® and GNU Linux systems.) As a result, you need to understand the following guidelines:
|
Q: When I call the File::Construct() method,
I get an exception. What is wrong?
A: First, check that the file you want to open exists. Second, use a path, such as Tizen::App::App::GetInstance()->GetAppDataPath() + L"sample.txt". |
Q: Does the Tizen::Io::Database class
guarantee mutual exclusivity for multiple I/O access to a database
file?
A: Yes. |
Q: Can I connect to an external
database?
A: No, Tizen does not support connecting to an external database. |
Q: What is the best practice for shipping an existing database with an application and where do I put the database in the IDE? What directory does it end up in on the device file system?
A: You can copy the file into the data directory in the workspace, which can be accessed using Tizen::App::App::GetInstance()->GetAppDataPath() + L"sample.db". For more information on application directories, see I/O Overview. |
Q: How can I communicate with other applications?
A: You can use the Tizen::Io::MessagePortManager, Tizen::Io::LocalMessagePort, and Tizen::Io::RemoteMessagePort classes to send or receive messages between applications. |
Locales |
---|
Q: I cannot find the formatters' Construct()
methods. How can I construct a Tizen::Locales::NumberFormatter
or Tizen::Locales::DateTimeFormatter?
A: The formatter classes follow the factory pattern and provide concrete CreateXxxFomatterN() methods to create an instance. They do not use the Construct() method. Each CreateXxxFormatterN() method provides several specifically formatted patterns to format a Tizen::Base::Number or Tizen::Base::DateTime class. If you want to modify the formatted pattern, use the NumberFormatter::ApplyPattern() or DateTimeFormatter::ApplyPattern() method. |
Q: How can I change the locale? Is there any API for it?
A: Yes. The system preference locale can be changed by the Tizen::System::SettingInfo::SetValue() method. However, due to policy-related issues, privileges are required to use this method. |
Media |
---|
Q: Where do I store media files during development, such
as images to test a media program from the IDE?
A: If media files are private contents of the application, store them in the application's data folder. If the files must be shared with other applications, copy them to the application's share folder. For more information, see the Tizen::Io::File Native API Reference. |
Q: Is multi-sound channel supported by Tizen?
A: Tizen supports Tizen::Media::Player and Tizen::Media::AudioOut instances simultaneously. But the actual number of instances is limited by resources, such as memory. The maximum number of instances can be retrieved with the Tizen::Media::MediaCapability class. |
Q: Does Tizen support simultaneous playing and recording?
A: In Tizen, the Tizen::Media::AudioIn, Tizen::Media::AudioOut, Tizen::Media::Player, Tizen::Media::AudioRecorder, and Tizen::Media::VideoRecorder classes support simultaneous playing and recording. |
Q: How can I use microphone input data in real time?
A: Tizen provides the AudioIn class for recording directly from an audio device, which can be used to measure the sampling rate of the incoming sound. For more information, see the Tizen::Media::AudioIn Native API Reference. |
Q: Can I use the camera function in the Emulator with a webcam? Do I have to add a particular color profile file to the webcam settings?
A: As long as the webcam supports the YUYV/YUY2 format, no particular color profile file need to be added to the webcam settings. |
Q: Why is the audio and video recording not working in the Emulator?
A: Make sure that you have a microphone (for audio and video recording) and webcam (for video recording) connected to your computer. |
Q: In the Emulator, why is the camera not working even though the webcam is connected correctly?
A: Make sure that the webcam driver is up-to-date. Download the up-to-date driver from the manufacturer's Web site. |
Messaging |
---|
Q: Can I receive or handle received messages?
A: Only SMS messages can be received and handled in the Tizen native applications. The Tizen native applications cannot receive MMS and email messages nor handle them in the Inbox. |
Q: How can I use Tizen::App::AppControl to
send different kinds of messages?
A: For more information, see Message AppControl. |
Q: When I try to send a message, an E_STORAGE_FULL
exception occurs. What do I need to do?
A: You must delete the messages in the Sentbox. |
Q: What is the difference between the Sentbox and
Outbox?
A: If a user sends a message successfully, it is saved in the Sentbox. If sending the message fails or gets cancelled, the message is saved in the Outbox. |
Q: Even though I delete some messages in the Sentbox, I still get
the E_STORAGE_FULL
exception when I try to send an email.
A: In case of email messages, the deleted messages go to the Trash folder. You must delete the messages in Trash manually. |
Q: Is it possible to intercept incoming SMS contents automatically?
A: No, it is not supported. |
Net |
---|
Q: Which is better: a default network connection or a
custom network connection?
A: Using the default network connection is recommended because it is simple and easy. Most applications work well with the default network connection. If your application needs to use a specific network account, or needs to directly control a network connection, use a custom network connection. However, note that it works with the Tizen::Net::Sockets and Tizen::Net::Http classes only. |
Net::Bluetooth |
---|
Q: How can I pair Bluetooth devices?
A: You can programmatically pair Bluetooth devices. First, search for the device to be paired with your device. There are 2 ways to pair with one of the found devices: One is to use the BluetoothManager::Pair() method directly with the target device. The other is to use the BluetoothOppClient::PushFile() or BluetoothSppInitiator::Connect() method to pair with the target device indirectly. The pairing process is started internally. |
Q: Can I use all Bluetooth profiles?
A: Tizen only supports the GAP, SPP, OPP, and HDP (sink role only) profiles. |
Net::HTTP |
---|
Q: How can I send a request in chunked
mode?
A: Do the following:
|
Q: How can I set an HTTP proxy?
A: Construct a Tizen::Net::Http::HttpSession instance with the pProxyAddr parameter. |
Q: How can I send a request using a persistent
connection?
A: Normal and pipelining mode support persistent connections. |
Q: How can I send a request using
pipelining?
A: Construct an HttpSession instance with NET_HTTP_SESSION_MODE_PIPELINING. |
Q: How can I use HTTPS?
A: Construct a Tizen::Net::Http::HttpSession instance with the hostAddr parameter set to https://. |
Net::Sockets |
---|
Q: Can I use the loopback socket in
Tizen?
A: Yes, it is supported in the API version 2.0, but it must be within the same package ID. |
Q: What role does the Tizen::Net::Sockets::SocketUtility
class play?
A: It provides network utility tools to perform common tasks, such as determining the status of one or more sockets using the Select() method, and converting host byte order and network byte order using the HtoNL(), HtoNS(), NtoHL(), and NtoHS() methods. |
Q: Which ciphers does the Tizen::Net::Sockets::SecureSocket
class support?
A: The SecureSocket class partially supports ciphers, such as TLS_SSL_RSA_WITH_RC4_128_MD5, TLS_SSL_RSA_WITH_RC4_128_SHA, TLS_SSL_RSA_EXPORT_WITH_DES40_CBC_SHA, TLS_SSL_RSA_WITH_DES_CBC_SHA, TLS_SSL_RSA_WITH_3DES_EDE_CBC_SHA, and TLS_SSL_RSA_WITH_AES_128_CBC_SHA. |
Q: What protocol options can I use?
A: You can set and get the following protocol options:
TCP-level options, such as defining the maximum segment size for TCP (TCP_MAXSEG). IP-level options, such as defining the time-to-live (IP_TTL) and adding membership for multicasting (IP_ADD_MEMBERSHIP). Socket-level options, such as establishing socket connections (SO_ACCEPTCONN), recording debugging information (SO_DEBUG), and getting the socket type (SO_TYPE). |
Security |
---|
Q: Which algorithms are supported?
A: The algorithms supported by Cryptography are Hash and HMAC (SHA-1, SHA-2, MD5), symmetric ciphers (AES, DES, 3DES, RC2, RC4, CAST, and SKIPJACK), asymmetric ciphers (RSA), and digital signatures (RSA). |
Q: Can I validate a revoked
certificate?
A: No, Tizen does not support CRL or OCSP. |
Q: What are API privilege levels?
A: Tizen provides access controls for each application to use security-sensitive APIs by specifying privileges. Privileges are categorized into 3 levels based on their security impact. |
Q: How can I update privileges?
A: Make changes to your privileges using the manifest editor, by double-clicking the manifest.xml file present in the project folder of the application. |
Social |
---|
Q: Why do the recurrence start and end times for a Tizen::Social::CalEvent change
compared to the values I set before?
A: The CalEvent start time and recurrence date must be equal. If they are not equal, the CalEvent start time changes to the recurrence date. |
System |
---|
Q: How can I find out the amount of currently free
memory?
A: Use the Tizen::System::RuntimeInfo class. |
Telephony |
---|
Q: How can I programmatically hang up a call?
A: Use the Call AppControl to make a call. However, it is not possible to hang up a call. It can only be done through a user action in the device's call UI. |
Q: Why does SPN return an empty
string?
A: SPN is not a mandatory field. Some SIM cards that do not have it return an empty string. |
Q: What is ICC-ID?
A: ICC-ID is an acronym for Integrated Circuit Card ID. The ID is an 18- or 19-digit number that uniquely identifies each SIM card internationally. ICC-ID is stored on a SIM card and printed or engraved on it. The ITU-T recommendation E.118 defines the ICC-ID. |
Q: What are MCC and MNC?
A: MCC (Mobile Country Code) is a 3-digit code that identifies
a country. More than one MCC can be assigned to a country. |
Q: Does Tizen have any method for getting the phone number of the device?
A: Use the GetPhoneNumber() method of the Tizen::Telephony::SimInfo class to get the phone number of the current SIM card. |
Text |
---|
Q: When do I use the Tizen::Text::Encoder class or the
Tizen::Text::Decoder class
instead of a Tizen::Text::Encoding class?
A: The Encoder and Decoder classes are useful when the amount of data is large and needs to be divided into smaller blocks. If you want to encode or decode all of the data at once, use an Encoding class. |
Q: How can I obtain the encoding instance for a particular encoding type?
A: Use the Encoding* Encoding::GetEncodingN(const String &encodingType) method. |
UI |
---|
Q: Who is responsible for deleting UI control
instances?
A: You must create all Tizen::Ui::Controls::Forms and controls on the heap. However, once the controls have been added to a Form (or container), and the Form attached to a Tizen::Ui::Controls::Frame, the Tizen platform takes care of all the deleting when the application terminates. If you want to explicitly remove a control, use the RemoveControl() method instead of delete. Otherwise the Tizen platform tries to delete the control a second time when the parent Tizen::Ui::Container is being destroyed. |
Q: What is the difference between a Form and a Tizen::Ui::Controls::Panel?
A: Both are containers. That is, they can contain controls, such as Tizen::Ui::Controls::Buttons and Tizen::Ui::Controls::ListViews. Only a Form can be added to a Frame. A Form can have an indicator bar, header, and footer. A Panel is a general control container, and must be added to another container, such as a Form. |
Q: How can I make a custom form?
A: Create your custom form class by inheriting from the Form class. You need to override the OnDraw() event handler to do custom drawing. Note that the OnDraw() event handler is called automatically whenever the screen needs to be drawn, but you can also call the Invalidate() method, or the Draw() method to trigger the OnDraw() method to be called. The Invalidate() method is used to draw the control asynchronously and the Draw() method is used to draw the control synchronously. |
Q: How can I rotate the screen?
A: You can use the SetOrientation() method from Frame or Form. If your application does not have any forms, use Frame::SetOrientation(); otherwise use Form::SetOrientation(). |
Q: Is it possible to simulate multi-point touch on the Emulator with a mouse?
A: To get the multi-point touch effect, press the CTRL key and mouse-click on different points. |
Q: Is it possible to make a custom list with user-configured items with Tizen API?
A: You can use the Tizen::Ui::Controls::TableView class to display a basic, grouped, or section table of user-configured items. |
Q: Is it possible to create a form from another one but with a different opacity? For example, I have 'Form1' and I create the 'Form2' but 'Form2' has 50% of opacity, so we can still see 'Form1' in the background.
A: It is not possible to show one form on top of another; you cannot stack forms. Your application can have multiple forms but you can see only one form at a time. |
Q: What is the difference between a visual element and a control?
A: A visual element is a light-weight control without any built-in event handling, useful for 2D or 2.5D representation and animation. In the actual framework implementation, a visual element is the building block used to create controls. |
Q: Are animations fully asynchronous?
A: Animations are asynchronous, but all the UI controls run in the same main thread. If there are other activities occurring during the animation in the main thread, there may be a delay in the animation. |
Q: How can I support a UI in a non-main thread?
A: The UI and Graphics namespace APIs are not thread-safe. If you need to offload some tasks, create a worker thread to perform functions, such as downloading data, decoding images, and playing sound, but handle all the UI controls in the main thread. |
Uix |
---|
Q: Why are images and video treated differently in face detection and recognition? Can I
just take a frame from a video, and feed that frame to image-related face
methods?
A: You can, but it consumes more resources. Usually it takes less time to process one frame from a video stream than to process one still image, since methods for the video stream are optimized for streaming data. |
Q: What happens if a person is wearing a hat or
sunglasses?
A: The face-related libraries may not work accurately if faces are partially or entirely blocked by sunglasses or hats. Similarly, they may not work if the image is blurry, or faces in the image or video are too small. |
Q: How can I simulate sensors?
A: Sensors can be simulated using the Event Injector. Launch the Event Injector by selecting Window > Show View > Other > Tizen > Event Injector view. In the Event Injector view, select the Sensors tab and then the corresponding sensor. Data can be provided as single events or a collection of events using the Event Injector view. |
Q: There is a tracking feature in the image recognizer. Is it related to augmented reality (AR)? If not, what is this feature used for?
A: Using the image recognizer and feature manager, you can develop image recognition- and tracking-based AR applications, such as a book or manual. The tracking is very fast and works real-time. The QR code recognizer supports not only recognition but also tracking. |
Q: Why is the Speech-To-Text (STT) feature not working?
A: Check your data connection. The STT feature requires an active data network connection. |
Web |
---|
Q: Why am I unable to load a page into a Tizen::Web::Controls::Web control?
A: Most likely your network configuration is not set properly. To check that the configuration is valid, see the proxy address setting instructions in Settings Menu. |
Q: I would like to use the HTML browser features on Tizen. What browser APIs are available?
A: Tizen supports a Web control for displaying HTML pages. It can be used as one of the controls in a container. For more information, see Tizen::Web namespace and the WebViewer sample application. |