Languages

Menu
Sites
Language
Problems with http on wearable

Hey,

Im having some problems with an app im making for the new gear s 2.

Im using libcurl to download a jsonfile and then i parse it using json-glib. However, when i try to run my code in the wearable simulator i just cant connect to any host. I have tried to find some documentation around it, but im just confused. Is there support for http on the s 2 at all ? If so. how do i configure portforwarding and so on in the correct way. Are there some kind of step-by-step guide available ?

//Cheers 

Responses

4 Replies
Fredrik Glawe

So i managed to solve my own problem.

If someone else have the same problem. You need to establish a connection before calling curl.

Do this by:

static connection_h connection;
    int connectionError;

    connectionError = connection_create(&connection);
    switch(connectionError)
    {
        case CONNECTION_ERROR_PERMISSION_DENIED:
        {
            dlog_print(DLOG_ERROR, MY_LOG_TAG, "CONNECTION_ERROR_PERMISSION_DENIED");
            break;

..................................

Also you need to setup the correct privileges in the manifest.

Palitsyna

Hello,

you need to add http://tizen.org/privilege/network.get privilege is required for connection_create.

Alex Dem

Hi,
I think for using curl will be enought to add:
http://tizen.org/privilege/internet
in your manifest
Alexey.

Fredrik Glawe
It's not.. You need to request a connection and have the network.get priv or you get an host not found error in curl.