언어 설정

Menu
Sites
Language
Web simulator and Tizen emulator

Hello everybody,

I have a question about the difference between the Tizen Web simulator and the Tizen emulator:

I managed to consume a web service and it works perfectly with the Tizen Web simulator, but unfortunately, nothing happened with the Tizen emulator (I, even, checked the internet connexion into the Tizen emulator when I access to the google page and it works)?

What's wrong? Why two different results with the same code?

Thank you in advance!

Responses

12 댓글
Lakshmi Grandhi

Did you add the service url in "access" tab of config file, web simulator doesn't require this option, where as this option is mandatory for emulator.

karray gargouri

Ok, if I understood what you have said, I manage to do this:

http://img11.hostingpics.net/pics/185915policyTab.png

And when I executed my application, I got some alerts (which I implemented into my code), but no reply from my distant web service...

By the way, I had to pass two parameters into my request to the web service (something like that: "FromCurrency=TND&ToCurrency=EUR"), I didn't figure out how to do it within the config.xml file?

 

Any other recommandations? thank you!

Lakshmi Grandhi

Hi,

 

How are acessing webservice is using REST API?? , there is no option in config file to pass parameters to webservice, you have to do it in your POST or GET methods inside javascript.

karray gargouri

Ok,

Just another thing, I want to be sure that I have put the right sentence into the Network URL field, is that correct? and should I put something into the 3 upper fields? (content-security-policy, content-security-policy-report-only and allow navigation).

Thanks

Lakshmi Grandhi

nothing is needed in config file, network url is sufficient for passing parameters

karray gargouri

well,

The same code of the consumption of the web service which run perfectly into the Tizen web simulator doesn't work with the Tizen emulator, even when I add the Network Url into the policy tab...

I put the following alert :

if (xhr.readyState === 4)
    		        {
			            //alert("result "+xhr.responseText);
						var xmlDoc = xhr.responseXML;
				var d = xmlDoc.getElementsByTagName("double")[0].childNodes[0].nodeValue;
				alert(d);
			        }

but I didn't get any display!

What's wrong?

Marco Buettner

add a config.js which follow content

$(document).bind("mobileinit", function() {
    $.mobile.allowCrossDomainPages(true);
});

And add the config.js between tizen-webui-framework and you own .js source files.

karray gargouri

Hello,

I didn't knew how to put the config.js file between tizen-webui-framework and you own .js source files. I put it that way, and I didn't know if it is correct:

http://img15.hostingpics.net/pics/399799architecture.png

 

Anywya, it's still not workign for me!

Marco Buettner

I mean on the index.html you have to include the config.xml between the tizen-framework and you own javascript sources

it looks little bit like this

<script src="tizen...."></script>

<!-- config file -->
<script src="js/config.js"></script>
<!-- rest of my sources -->
<script src="js/main.js"></script>
karray gargouri

OK, I understand... ;)

I do it that way:

 <link rel="stylesheet" href="tizen-web-ui-fw/latest/themes/tizen-white/tizen-web-ui-fw-theme.css" name="tizen-theme"/>
    <title>Tizen Web IDE - Template - Tizen - Tizen Web UI Framework - Single-Page</title>
    <!--NOTE:
        jquery.js and web-ui-fw.js must be included.
        DO NOT REMOVE below code!
    -->
    <script src="tizen-web-ui-fw/latest/js/jquery.js"></script>
    <script src="tizen-web-ui-fw/latest/js/jquery-1.10.1.min.js"></script>
    <script src="tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.js"></script>
    <script src="tizen-web-ui-fw/latest/js/tizen-web-ui-fw.js"
        data-framework-theme="tizen-white"></script>

    <!--NOTE:
        Additional scripts and css files are to be placed here.
        You can use jQuery namespace($) and all functionalities in jQuery
        in your script.  For example:

            <script src="main.js"></script>
            <link rel="stylesheet" href="my.css">
    -->
    <script type="text/javascript" src="./js/config.js"></script>
    <script type="text/javascript" src="./js/main.js"></script>
    <link rel="stylesheet" type="text/css" href="./css/style.css"/>

I put the config.js fle under my project js folder, but it is still not working :(

The project is working perfectly in the Tizen Web simulator.

Marco Buettner

Since Tizen include jquery-1.10.1.min.js ? As I know... Tizen includes already jQuery 1.8.2 in the tizen-web-ui-fw folder. Do you use jQuery 1.10.1 methods?

Otherwise.. The Simulator isnt comparable with the Emulator, because the Simulator use the Chrome-Browser to show something. So it doesn't need the config.xml for the simulator... Try to use only http://www.webservicex.net/ on the config.xml for network access...

karray gargouri

Thanks a lot, it works now..... I add only the http://www.webservicex.net/