Results 1 to 3 of 3

Thread: Ajax url path not working in android apk

  1. #1
    Sencha User deepakgarg89's Avatar
    Join Date
    Nov 2012
    Location
    Gurgaon, India
    Posts
    43
    Answers
    4
    Vote Rating
    0
      0  

    Default Answered: Ajax url path not working in android apk

    I had created an app with below folder structure

    Code:
    Myapp
        app
            view
                campaigndata.js
        app.js
        app.json
        data.php
    In campaigndata.php i am calling data.php through ajax request using below code

    Code:
    Ext.Ajax.request({
        url: '../../data.php',
    Above code working fine as an webapp. now i had make a android build and got Myapp.apk file. When i installed and check the app than all working fine but ajax request failed.

    Please suggest me if i need to do any change in url path or is there any way to debug the error

  2. Now i had resolved the problem by using jsonp. I had put my local files on a live server and than call those file through jsonp. Now everything is working fine.

  3. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3932
    Vote Rating
    1272
      0  

    Default

    When you are in a native app you are not in a web server so you are doing an ajax request to the file system.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  4. #3
    Sencha User deepakgarg89's Avatar
    Join Date
    Nov 2012
    Location
    Gurgaon, India
    Posts
    43
    Answers
    4
    Vote Rating
    0
      0  

    Default Ok

    Now i had resolved the problem by using jsonp. I had put my local files on a live server and than call those file through jsonp. Now everything is working fine.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •