android images issues

You must Login before you can answer or comment on any questions.

hi too all ,i post this question before but still have no solution...im developing for both android and iphone...my issue is that my image in the main window is not seen in ANDROID but is seen in IOS im using titanium 2.0.2GA and im using google API andorid 2.2. and im testing the app on my device which is a samsung skyrocket...if anything i would like to send my app project so someone can look it over and help me out please i also tried this method

//i placed my image in 
android/images/res-long-land-hdpi
and at window1.js i use
var logo = Titanium.UI.createImageView ({
            image:'images/69.jpg',
            width:253,
            height:96,
            left:0,
            top:0,
        });
but when i deploy the app in a my samsung skyrocket...i also get a error.....i was told to create a folder high,medium,low...but when i create a folder and try to launch it in the app i get a error.. which are the following
//I get this error when i add a image or a folder in images
[ERROR] Error(s) compiling generated Java code
[ERROR] /Users/kingproduction/Documents/Titanium Studio Workspace/barbershop/build/android/gen/com/mambo/R.java:14: <identifier> expected
        public static final int 69_5f35e41f22=0x7f020000;
                               ^
/Users/kingproduction/Documents/Titanium Studio Workspace/barbershop/build/android/gen/com/mambo/R.java:14: <identifier> expected
        public static final int 69_5f35e41f22=0x7f020000;
                                             ^
2 errors

2 Answers

Accepted Answer

Use a leading "/" in your image paths. In fact, use a leading "/" for all paths in Ti Mobile. You don't have to, but not everyone knows when you need them and when you can get away with them. If you always use them, you'll save yourself a lot of pain.

Are you naming one of your image files with a number? That may cause your R.java compile problems.

— answered 9 months ago by Jason Priebe
answer permalink
3 Comments
  • yes im using in my example code 69.jpg...so ima put a name to see if it work... so its /images/myimage,png?

    — commented 9 months ago by Ronny Rodriguez

  • My advice is to never name any resource files starting with a number. In fact, I try to avoid using numbers anywhere in the filename for my resource files. That might be overly cautious, but I like to err on the side of safety.

    If you develop with Titanium long enough, you might develop "superstitions" like I have. :-)

    — commented 9 months ago by Jason Priebe

  • thank you jason!!! it worked!

    — commented 9 months ago by Ronny Rodriguez

The samsung skyrocket has a screen resolution of 800x480 which is considered WVGA resolution.

Your problem may be that you are declaring the device as having the "long" aspect ratio (res-long-land-hdpi) when it may not be.

Try putting your image within the "notlong" folder: android/images/res-notlong-land-hdpi

Or you can remove the long/notlong property from the folder name: android/images/res-land-hdpi

— answered 9 months ago by Joe Corriere
answer permalink
2 Comments
  • hi joe i placed the image in : android/images/res-notlong-land-hdpi and i got this error

    [ERROR] Error(s) compiling generated Java code
    [ERROR] /Users/kingproduction/Documents/Titanium Studio Workspace/barbershop/build/android/gen/com/mambo/R.java:14: <identifier> expected
            public static final int 69_5f35e41f22=0x7f020000;
                                   ^
    /Users/kingproduction/Documents/Titanium Studio Workspace/barbershop/build/android/gen/com/mambo/R.java:14: <identifier> expected
            public static final int 69_5f35e41f22=0x7f020000;
                                                 ^
    2 errors
    i also removed the not long and got the same error i have my run as configuration as WVGA800 google APIs android 2.2..do i need to put android 2.3? or is something else?

    — commented 9 months ago by Ronny Rodriguez

  • Is there a turorial???please

    — commented 9 months ago by Ronny Rodriguez

Your Answer

Think you can help? Login to answer this question!