I've got a Native C project in which I need to parse some Json. According to something I found in Tizen documentation the json-glibc parser is included in the SDK. So I tried using it. Here is a minimal program that creates the parser and nothing more.
#include <json-glib.h>
main(int argc, char *argv[])
{
JsonParser* jsonParser = NULL;
GError *error = NULL;
jsonParser = json_parser_new();
if(jsonParser == NULL) {
fputs("failed to create parser", stderr);
exit(7);
}
return 0;
}
In the Tizen 3.0 emulator this works fine. As soon as I try it in the 2.3.2 emulator or on 2.3.2 hardware it fails. It strikes ms as odd that such a thing would be hardware/firmware dependent. Does anyone know if there is something I should do so that I can create the parser on either version of the hardware?
Update 10月6日2018年
I think this is a bug with the 2.3.x emulator for more recent installs. This is only a hypothesis as the most I can do is try fresh installs on fresh operating systems. My only other hypothesis is that there is some component that the 2.3.x emulator needs to function that is missing and not documented as a requirement.
+-----------------------------------+------+--------+--------------------------+
| OS Version | Tizen|Studio | Result |
+-----------------------------------+------+--------+--------------------------+
| Ubuntu 16 LTS Clean Install | 2.3 | 2.4 | json_parser_new()== NULL |
| Ubuntu 16 LTS Clean Install | 2.3 | 2.5 | json_parser_new()== NULL |
| Ubuntu 18 LTS Clean Install | 2.3 | 2.4 | json_parser_new()== NULL |
| Ubuntu 18 LTS Clean Install | 2.3 | 2.5 | json_parser_new()== NULL |
| Mac OS X High Siera Clean Install | 2.3 | 2.5 | json_parser_new()== NULL |
| Mac OS X Movaje Clean Install | 2.3 | 2.5 | json_parser_new()== NULL |
| Windows 10 Creator's Edition | 2.3 | 2.5 | json_parser_new()== NULL |
| Windows 10 Creator's Edition | 2.3 | 2.4 | json_parser_new()== NULL |
| Ubuntu 16 LTS Clean Install | 3.0 | 2.4 | success |
| Ubuntu 16 LTS Clean Install | 3.0 | 2.5 | success |
| Ubuntu 18 LTS Clean Install | 3.0 | 2.4 | success |
| Ubuntu 18 LTS Clean Install | 3.0 | 2.5 | success |
| Mac OS X High Siera Clean Install | 3.0 | 2.5 | success |
| Mac OS X Movaje Clean Install | 3.0 | 2.5 | success |
| Windows 10 Creator's Edition | 3.0 | 2.5 | success |
| Windows 10 Creator's Edition | 3.0 | 2.4 | success |
+-----------------------------------+---------------+--------------------------+
From these results one would think that Tizen 2.3 isn't supported. But it is and it appears that people that have installed Tizen Studio sometime before now can successfully execute the same code.
enter link description hereI got an answer to my question over the the Tizen developer's forums.
Long story short, the Gear S3+ and the Gear S2 use different versions of GLIB. On the one used on the Gear S2 is glib_init() isn't called first attempts to create objects will fail.
The following needs to be added before using any glib library to avoid this problem.
#if !GLIB_CHECK_VERSION(2, 35, 0)
g_type_init();
#endif