Community Questions & Answers
createHTTPClient callback method is not called correctly
Hello guys, my getMovieObjectInJSONTableFormat methode is called but my parameter is undefined why is that so. I thank you in advance ever here is my code ~~~ function APIManagement() { this.currentMoviesURL =...
fail to load xml from webserver on local network
I am trying to load an xml file from the local network. The file is hosted on a windows web server. I can view the file in a browser on the network. Here is the code I am using: ~~~ var url = "192.168.0.199/application/cmn/current-sink.xml"; var...
How to open a window through a tab
Hello everyone, I've created a tab, in wich I've added this code: ~~~ var tab1 = Titanium.UI.createTab({ icon:'KS_nav_views.png', title:'Tab 1', window:win1 }); ~~~ This is the code of win1: ~~~ var win1 = Titanium.UI.createWindow({ ...
createHTTPClient set property
Hello, on my property no data will be stored Thanks in advance here is my code ~~~ function APIManagement() { this.currentMoviesURL = "my url"; this.becomingMoviesURL = "my url"; this.resultJSONData = null; var self =...
Proper way to implement API connection to Webserver...
My app currently opens an "createHTTPClient" connection to my server. In order to try to secure the page from been accessed directly, I have my app send two 64 character strings via form post to the php page on the server. Then, on the server...
REST PUT to AWS S3 -- works on iOS, not Android
What works ---------- We have successfully come up with the code to upload a file using a RESTful PUT to Amazon's S3 simple storage service. We have shared all of our code and required libraries at the links at the bottom of this question. Hopefully...
Problem with consuming a web service
Hello everybody, I am trying to implement how to consume a webservice using the "suds" library: app.js: ~~~ //Titanium.include('suds.js'); Titanium.include(Ti.Filesystem.resourcesDirectory + 'suds.js'); //var window =...
Upload photo from Android camera to PHP script
I've been doing a lot of Googling and forum searching to get a photo uploaded from a Titanium Android app. Here's the code I have at present, bound to a button click: ~~~ var button1 = Titanium.UI.createButton({ color:'#fff', title:'Capture', ...
xhr.send() returns immediately before onload is called
I have a createHTTPClient that calls a URL and after calling the xhr.send(); it immediately returns before the onload/error is called and the response is checked. Is there a way to make the xhr.send() not return until these functions have completed their...
Ti.Network.createHTTPClient error
I get a status 403 permission denied when I try to connect to a remote file to retrieve data. It works fine when I use a local file. Any ideas what would cause this? Here is the file ~~~ var currentWin = Ti.UI.currentWindow; var view02 =...
Network.createHTTPClient onerror, parsing error codes and text
Hi, When I create a Ti.Network.createHTTPClient and with onerror let's say that I catch a timeout, onerror : function(e){ Ti.API.info("ERROR: " + e.error); returns this text: [INFO] ERROR: Error Domain=ASIHTTPRequestErrorDomain Code=2...
createHTTPClient's setRequestHeader problem
Hi. I have searched in google and in this forum, but does not found any answer. I want to set custom request header like this : xhr.setRequestHeader("_drl_key2": "1"); but this does not work, when I log in server _drl_key2, it...
Google Docs upload help
Hello there, I'm creating a writing application and I want to give people the ability to upload to Google Docs. I found the corresponding API information here: [Google...
Mobile - createHTTPClient - Possible to check SSL Certificate?
I'm trying to build a secure application and will be communicating with a HTTPS interface through the create HTTP client. It is possible to tell if the certificate being used is self signed or not?
createHTTPClient gives a "Can't reach host" error
I'm currently trying to develop a mobile web site using Titanium 2.0.1. When I try to run the code below, I get a "Can't reach host" error and the page never loads the data. I've tried both on my local system with Titanium Studio and on a web...
Ti.API info and debugging not working under mobile SDK 1.5.x?
I've been trying to use Ti.API.debug and Ti.API.info to show up while running the Android emulator, and just FINALLY realized that it won't work under mobile SDK 1.5.0 and 1.5.1... once I compiled my code (as well as KitchenSink) under 1.2.0 mobile SDK,...
createHTTPClient onload called multiple times
Hi, I am making requests to Instagram to pass me back the users recent photo's. This is my code: ~~~ function fetchData(pictureView, mainView) { var userid = ''; userid = apiData.url.substring(apiData.url.indexOf('access_token=')); userid =...
Titanium.Network.createHTTPClient not sending cookies
Hi, My request goes through but does not send any cookies. Am I missing something? ~~~ var MyURL = "http://someurl.com/content.php" var MyRequest = Titanium.Network.createHTTPClient(); MyRequest.open('GET', MyURL); var requestCookies =...
httpClient Post won't work!!!
Hi guys, I'm trying to make a simple app send some values through post to a php file I have on my local web server. Then that php script will insert into a mySQL database, but looks like I have something wrong on my application's code cause it gives me a...
HTTPClient does not keep PHP Sessions anymore
Hi, I have a project made in the previous version of Titanium (without the code editor), including a login for a remote database. When I updated to the latest version of Titanium Studio (1.0.2) and compiled my project, the HTTPClient no longer remembers...
Possible to Monkey Punch/Duck Punch Ti.Network.createHTTPClient?
Does anyone know if it's possible or even if there are any examples of monkey patching/duck punching the Ti.Network.createHTTPClient method? I wanna do a simple modification of this method so I can pass a data fixture (object literal) to the onload...
Trying to understand Ti.Network.createHTTPClient()
I'm creating my first app that uses an external datasource. I've already built a remote RESTful service that's working as expected. Now I'm trying to access and use the data in the iPhone app. Here's the basic (truncated) layout for the...
Get return from another scope
Hi guys, I cant get the return from this code: ~~~ exports.isOnline = function(isOnline) { var xhr = Titanium.Network.createHTTPClient(); var jsonObject; xhr.onload = function() { jsonObject = JSON.parse(this.responseText); }; xhr.onerror =...
createHTTPClient - SSL problem on some API call
Hi guys, I remember having this issue back in the days of 1.4 SDK ... was so annoying and without resolution that I had to give up! Basically, I'm trying to make a call to an SSL server (in this example the Google shorten API) but no matter what, is...
Can not call createHTTPClient Is undefined
Hi All, I have found error while calling webservice,createHTTPClient Is undefined, please help me out. Below are the code sample. Thaks var xhr = Ti.Network.createHTTPClient(); xhr.onload = function(e) { Titanium.API.info('xml ' + this.responseXML...
Error Domain=com.google.GDataXML Code=-1
I am developing a new app, have many under my belt with Titanium. However, this is the first which needed/uses createHTTPClient. I am not requesting any data from google, however, studio's console log shows: ~~~ [ERROR] Error Domain=com.google.GDataXML...
createHTTPClient() Why some rss feed returns null and others worked ok (1.8.1)?
Hi just wanted to ask a quick question. Since, I upgraded to 1.8.1 I cant seem to get feed from my blog anymore link url http://www.watchlearnknow.com/feed/. responseText will always return null, this was not the case in 1.7.5. However, funny thing is when...
Just call me a noob, but stil having problems with SOAP request...
I have a SOAP web service, written in C#, that I am trying to call using Titanium. I have tried several of the examples provided by otherin the dev center, but just can't seem to get it to work. Anyone have a simple (start to finish) example of calling a...
Problem display some xml nodes in a third window
Hi everyone, I am stuck to display some informations about a xml file. I think that my array is erased at the end, in my third window, and I don't know how to get it back to display description_item, description_item2, img_3 in my last window. Here is my...
Titanium Mobile SDK 1.7.2 on Android: POST request not sending any data.
Hi everyone, I'm making an app for a client, where I have to sent a post request to the server (Google App Engine) However, the data being sent is always empty. I'm using this code to send the image: ~~~ function sendImage(attrs) { var xhr =...
Problem to display images in a gallery via XML
Hi everyone I am working actually on this Gallery, [www.codeboxed.com](http://www.codeboxed.com/2011/07/titanium-module-for-image-gallery/) I am trying to make it work with a XML file I was thinking that my code was ok, but apparently not, I can't display...
using Appcelerator and foursquare api with xauth / oauth
Hello, I have been using titanium to build an iphone app that has successfully received and saved oauth tokens from foursquare.com. However, the problem I am running into is in not being sure how to pass those tokens along to make API calls that require...
Titanium.Network.createHTTPClient() doesn't work in Android
I have a php script that return data from a remote database. It's working in ios flawlessly. But it doesn't work in Android at all. It always returns empty result. I'm now suspecting the "xhr.send" doesn't send the right data or right format to...
xhr.send only works once with image file?
i have a form and i let people select a photo from camera or gallery and everything works fine if they do this once. if I try to repeat the process and do a 2nd submission it simply will not work. what stupid little thing am i missing here? the 2nd time...
In xhr.onload this.responseText have nothing data
When i run the same code in iphone then this.responseText have data but when i run the same code in Android this.responseText have no data, i am not understand what i should do.. please help..
Set COOKIES using setRequestHeader() = CRASHED ?
Hello, I seem to get problems as soon as I have more than one cookie sending through setRequestHeader("Cookie","?????"); Here's my code ~~~ var cookieString = "cookie1=value1; cookie2=value2;"; xhr =...
XML Data being treated as binary
I'm trying to read an xml data into an iPhone app. I'm getting responseText = undefined and responseData = [object TiBlob]. It makes me think that the app treats the data as binary instead of text, and I guess this is because the encoding of the xml is...
NullPointerException in createHTTPClient
I am attempting to do an upload of the gps info basing the script from the kitchen sink geolocation. I have verified this is not making it to the page to post. I am getting the nullpointerexception at xhr.open. Please help!...
Basic XHR in Titanium Desktop
I've been trying for hours to make simple GET-requests to Google work in Titanium Desktop. Here's one of my many attempts: ~~~ var xhr = Titanium.Network.createHTTPClient(); xhr.onreadystatechange = function() { if (xhr.readyState == 4 &&...
Need to extract a few elements from external XML file and display
I have read through most XML discussions but have not gotten a solution that works for me. I just want to parse through an XML URL and pull values for specific name/value pairs. After I get that basic functionality working I will want to add other...
createHTTPClient: Cannot call method or undefined android - sdk 1.5.1
Hello, I'have tried just this little code: ~~~ var xhr = Titanium.Network.createHTTPClient(); ~~~ and this one too: ~~~ var xhr = Ti.Network.createHTTPClient(); ~~~ but I allways have this error: "Cannot call method or undefined" Somebody...
Problem : createHTTPClient doesn't work with a remote xml
Hi all, I want to get a xml frame from a remote server. Here what I do : ~~~ var urlAmv = "http://XXX.XXX.XXX.XXX:4445/api/....."; webview = Ti.UI.createWebView(); webview.url = urlAmv; var xhr =...
TypeError createHTTPClient
Hi all, I don't know if it's because i just got out of bed, but for some reason i can't create the simplest HTTPClients anymore. All I get is a Runtime Error that tells me "TypeError: Cannot call method "createHTTPClient" of...
createHTTPClient Issues with Android
So I and a colleague are beginning the stages of developing an app for the Iphone and Android and have been going through some of the tutorials online. We did the one that builds a twitter client in JSON for the Iphone and got it to work for the Iphone,...
createHTTPClient setTimeout issues in 1.5
hi, in 1.4 i had to use ~~~ var xhr = Ti.Network.createHTTPClient(); xhr.setTimeout([10000]); ~~~ for setting a timeout. note the array. this crashes my app now in 1.5. ~~~ var xhr = Ti.Network.createHTTPClient(); xhr.setTimeout(10000); ~~~ seems to...
createHTTPClient drives me crazy.
Hello, in my previous question, I had problem using web services from Viadeo. So I decided to switch to Photobucket ~~~ REST Request Format The Photobucket API uses Representational State Transfer (REST) for requests and responses, so that domain-specific...
Return array from createHTTPClient
I am using createHTTPClient to make a call to a php file that authenticates a user. I can return a string of text, but is it possible to return an array?
xhr.open & TAP, TAP, TAP
I've searched the docs ... can't seem to find an answer. My code successfully returns a record from my database ... but subsequent attempts to return a single record fail with TAP, TAP, TAP ... Here's my code ... any clue what I'm doing wrong? Thanks in...
Basic Authentication within createHTTPClient
happy friday! Hey I was wondering if there is a basic authentication method for Titanium.Network.createHTTPClient(); as there is for Titanium.UI.createWebView. I need to connect with a server that has a basic apache auth box that pops up and asks for...
Cannot login to website using createHTTPClient
I know that there are a lot of similar questions so I apologise, but I have not found a solution to my specific problem. Most of the queries I have seen have related to Android, validating with get or header authentication. I am using Titanium mobile to...
Showing 1-50 of 57 1 2