Languages

Menu
Sites
Language
I want to make web application to show webpage

I want to make simple web application to show webpage like web browser.

I think that web application do http reqeust to get web page. but i don't know http request function in web application.

what function do i use to get a web page ?  

 

 

Responses

4 Replies
Iqbal Hossain

Hi, 
I think you have two ways, 

One: 

  • Develop a webpage. 
  • Deploy the webpage on an URL.
  • Develop Tizen App which actually shows the content of that webpage. 

 

Two: 

  • Develop a webpage. 
  • Deploy the webpage on an URL.
  • Develop Tizen App which send HTTP Request to the server 
  • After getting the data, render in the Tizen App as per design requirement. 

Which one is your goal ? 

 

Vikram Dattu

A question bit off topic to original:

I would like to highlight 2 lines from your answer:

  • Develop Tizen App which send HTTP Request to the server 
  • After getting the data, render in the Tizen App as per design requirement.

Now question:

How to do http request and get dat (WebPage source) in a character string?

Iqbal Hossain

@Vikram Dattu

To send request you can try like this,

var xml = new XMLHttpRequest();
 xml.open("GET", url, true);

 xml.onreadystatechange = function() {
   if (xml.readyState != 4)  { return; }

   var serverResponse = JSON.parse(xml.responseText);
 };

 xml.send(null);

If you got string as response, you take convert it to JSON/XML etc as per your requirement. 

You can also use Ajax request, 

function getWeather() {
    'use strict';

    console.log( "ready!" );
      $.ajax({
        type: "GET",
        dataType: "jsonp",
        jsonp: "callback", jsonpCallback: "callback",
        url: "http://apidev.accuweather.com/currentconditions/v1/28143.json?language=en&apikey=hoArfRosT1215",
        cache: false,
        success: function (data) {
             // document.getElementById("results").innerHTML=JSON.stringify(data[0].WeatherText);
              temparature = JSON.stringify(data[0].WeatherText);
        	  ctx.font = "30px Comic Sans MS";
        	  ctx.fillStyle = "red";
        	  ctx.textAlign = "center";
        	  
              ctx.fillText(temparature,canvas.width/2, canvas.height/2);
         }
   });
}

 

Vikram Dattu

Ok. Thanks.

But I'm concerned more with native app.

Can similar thing be done in native application? There isn't a single WebKit function which does that. I have asked there in native forum but no useful answer...

https://developer.tizen.org/forums/native-application-development/how-modify-webpage-content

Someone could only reach to the conclusion that you can get Web page source code in string with native app.

Ideally that should not be the case, right? I mean there should be a way to get httpRequest content in String.

Some direction would be useful.

Thanks.