Results 1 to 10 of 10

Thread: Ext.Img not loading in device

  1. #1
    Sencha User
    Join Date
    Jul 2012
    Location
    Bangalore
    Posts
    113
    Vote Rating
    0
      0  

    Default Ext.Img not loading in device

    Hi

    I just testing the Ext.Img for my application, when I load image from internet, it shows both in browser and mobile device. But if I use local image, then it only shows in browser not in mobile device.

    items: [
    {
    xtype: 'image',
    height: 67,
    width: 66,
    src: 'http://www.sencha.com/assets/images/sencha-avatar-64x64.png'
    }
    ]






    items: [
    {
    xtype: 'image',
    height: 67,
    width: 66,
    src: 'asset/icons/icon.png'
    }
    ]

    src: 'http://www.sencha.com/assets/images/sencha-avatar-64x64.png' is working fine.

    src: 'asset/icons/icon.png' not loading in mobile device.

    Please let me know how to fix this.

    Regards
    -Ram

  2. #2
    Sencha Premium User
    Join Date
    Feb 2012
    Location
    Berne, Switzerland
    Posts
    721
    Vote Rating
    46
      0  

    Default

    This is probably because the path to the image is wrong or the resource has not been included by the native packager. The packager, by default, only includes these resources (excerpt from app.json):
    Code:
        /**
         * Extra resources to be copied along when build
         */
        "resources": [
            "resources/images",
            "resources/icons",
            "resources/startup"
        ],
    Either change the location of the resource or edit the app.json to reflect the location of your resource.
    I usually put everything in resources/images. So I'm fine with the Sencha defaults.

  3. #3
    Sencha User
    Join Date
    Jul 2012
    Location
    Bangalore
    Posts
    113
    Vote Rating
    0
      0  

    Default

    Hi.. When I create application from Sencha Architect I dont get app.json file.. I only get packager.json using sencha build command. Is both are same?

  4. #4
    Sencha Premium User
    Join Date
    Feb 2012
    Location
    Berne, Switzerland
    Posts
    721
    Vote Rating
    46
      0  

    Default

    I think you have app.json. Only it is generated / maintained by Architect directly. But when you have a look on file system level you should see it.

    And no, it's absolutely not the same as packager.json.

  5. #5
    Sencha User
    Join Date
    Jul 2012
    Location
    Bangalore
    Posts
    113
    Vote Rating
    0
      0  

    Default

    I am just executing "sencha package run android_config.json" command and generating".apk" file.
    This .apk file I am coping to my android mobile device.
    Once installing there.. I am not able to see the images.
    -Ram

  6. #6
    Sencha Premium User
    Join Date
    Feb 2012
    Location
    Berne, Switzerland
    Posts
    721
    Vote Rating
    46
      0  

    Default

    You are correct - my apologies. I thought that it's handled the 'normal' way.

    I upgraded my Architect to V2.1 (haven't used it for some time now) and did a quick test. Within my project structure I created a folder called images and put an image "image01.png" in there. Then I dropped an image component into a panel and put as source "images/image01.png". The image was shown in both architect and in my browser. Then I published the project and everything was still fine.

  7. #7
    Sencha User
    Join Date
    Jul 2012
    Location
    Bangalore
    Posts
    113
    Vote Rating
    0
      0  

    Default

    Did you tried creating package file (.apk) file.

  8. #8
    Sencha Premium User
    Join Date
    Feb 2012
    Location
    Berne, Switzerland
    Posts
    721
    Vote Rating
    46
      0  

    Default

    yes, and I can see the image in the app on my smartphone.

    Initially I had a few problems. But after reading this http://www.sencha.com/forum/showthre...-Sencha-Cmd-v3 and a few trials I managed to build the apk from my little Architect project.

  9. #9
    Sencha User
    Join Date
    Jul 2012
    Location
    Bangalore
    Posts
    113
    Vote Rating
    0
      0  

    Default

    Did Sencha Architect created app.json file for you?
    If so can you give me the steps how you created .apk files and how app.json got created using Architect.
    -Thanks

  10. #10
    Sencha Premium User
    Join Date
    Feb 2012
    Location
    Berne, Switzerland
    Posts
    721
    Vote Rating
    46
      0  

    Default

    Quote Originally Posted by kramprabhu View Post
    Did Sencha Architect created app.json file for you?
    No, not Architect did that! I used CMD3 to build the skeleton of a new project/app and then let Architect save into that project (project names should match!). After that I did a few modifications in Architect, saved all and then built the APK with CMD3 (no success so far to do that from within Architect).

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
  •