Languages

Menu
Sites
Language
How to show a online image on web application, in Gear S2?

Hello,

I have a online image, and i want to display this image on Gear S2.

For example:

<div id="image-container">

<img src="http://img-developer.samsung.com/images/common/img_error_404.gif"></img>

<div>

You can see a hello world example of HTML5 here:

https://images-jpgpuyo.c9users.io/hello-world.html

Why can't I do this in Gear S2, in a wearable web application?

What is the best way to do this?

Do I need add some special privilege? Do I need to use launch application control? Do I need to do a HTTP request?

Thank you,

Best Regards,

Joaquim

 

View Selected Answer

Responses

4 Replies
AVSukhov

Hello,

You can use following:

<div id="image-container"></div>

<script>

var img = new Image();
img.src = "http://img-developer.samsung.com/images/common/img_error_404.gif"
document.getElementById("image-container").appendChild(img);

</script>

and add internet privilege and access tag in config.xml

Joaquim Puyo Garrido

My problem was the tag access. Now, I am displaying image in HTTP server, but I can't display the same image in HTTPS server.

Do I need any special privilege to display image from https server?

Mark as answer
AVSukhov

Hello,

I verified following code and it`s works for me:

html:

<img src="https://mdn.mozillademos.org/files/5407/gallery_5.jpg">

and config.xml:

    <access origin="*" subdomains="true"/>
    <tizen:privilege name="http://tizen.org/privilege/internet"/>

 

Joaquim Puyo Garrido

Hello,

Thank you, the problem was on the server, not on the client side. I tried with another server and it worked.

Thank you for your help :)

Best Regards,

Joaquim