I am trying to create a simple application using the studio Titanium, which will download google.com, but I do not get the proper results.
1) I used WebView to load the url but nothing was displayed except a white screen.
2) I used httpClient, but always got the error that I defined in the onerror function.
Both methods are inserted below. Should I make changes to the resolution of tiApp.xml ie?
Please help me, how can I do it better?
Note. I am using proxy internet. The problem occurs both on the emulator and on the device.
I am downloading the following js file from app.js
var win = Ti.UI.currentWindow; Ti.App.fireEvent('show_indicator'); //display loading spinner until webview gets loaded var fbUrl = "http://www.facebook.com"; var extwebview = Titanium.UI.createWebView({ url:fbUrl, backgroundColor:'#ccc' }); win.add(extwebview); //adding webview in current window extwebview.addEventListener('load', function() { Ti.App.fireEvent('hide_indicator'); //Hide the Loading indicatr });
--------------- Method 2 -----------------
var url ="http://www.google.com.pk"; var xhr = Ti.Network.createHTTPClient({ onload: function() {
Aleem source share