1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    5
    Vote Rating
    0
    briantes is on a distinguished road

      0  

    Default Unanswered: Ext.util.jsonp request does not work on device android 2.3 / iphone 5.1

    Unanswered: Ext.util.jsonp request does not work on device android 2.3 / iphone 5.1


    Hello. I have a simple application that requets data to a server using ext.util.jsonp.
    My server is made with Embarcadero Delphi 2010, and runs on local network over port 81.
    If I use google chrome to run the application, it works good and ext.util.jsonp request gets information from server. I use for the url: "http://192.168.0.10:81"

    But if I try it with iphone or android device on the same network, it does not work. For iphone I have put the files on a public server, but with android I have made an apk with eclipse and phonegap, and install it on the device.

    I use jsonp to avoid cross-domain problem, as said in documentation.

    No error is reported, but ext.util.jsonp does not connect neither run the callback function.

    Any suggestion?
    Thanks.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,649
    Answers
    3454
    Vote Rating
    817
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    You should use a remote debugger to see if there are any errors. Also would look at server logs to see if the server was hit and with what params.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Feb 2012
    Posts
    5
    Vote Rating
    0
    briantes is on a distinguished road

      0  

    Default


    Yes, the first thing I did was activate debug on safari (on iphone), but no errors reported in my phone. It doesn't call "callback" function. I put index.html the code here:

    Code:
    <!DOCTYPE HTML>
    <html>
      <head>	
    	<title>Test jsonp</title>		
    	<link rel="stylesheet" href="sencha-touch.css" type="text/css" >
    	<script type="text/javascript" charset="utf-8" src="sencha-touch.js"></script>
    	<script >
    Ext.regApplication({
    	name: 'testJsonp',   
    	launch: function() {
                    var temporizador = setInterval(function(){    	
                    	alert('requesting...');
                		Ext.util.JSONP.request({
                			url: 'http://192.168.0.10:81',
                			callbackKey: 'callback',
                			callback: function(result) {
                				alert('receive');
                			}
                		});
                    },3000);	
                    }
                });
    		</script>			
      </head>
      <body >
      </body>
    </html>
    If I test It with Google Chrome, all message are shown and works good.
    With my iphone 4G (ios 5.1), and with my arnova 7b G2 (android 2.3), only alert message "requesting..." is shown. No errors in safari debug on iphone.
    As you can see, a local ip is used. The PC in this computer runs a http server that works good because with google chrome (on the same pc but with network ip) works good.
    Thanks for your help.

  4. #4
    Sencha User
    Join Date
    Aug 2012
    Posts
    8
    Vote Rating
    0
    Jaya123 is on a distinguished road

      0  

    Default Jsonp does not work on Android emulator

    Jsonp does not work on Android emulator


    Is there a solution for this problem? Even I have run into the same issue. Infact twitter app also does not work when you bundle it as an apk and deploy on Android emulator.

Thread Participants: 2