Discussion Forums  >  Uncategorized

Replies: 16    Views: 797

Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
01/09/12 08:46 AM (12 years ago)

David, David, . . . Problem with res>drawable folder

I saw a documentary last night that said if you invoke one of the buzztouch team members name three times they'll immediately come to your assistance. So, David, David, David Problem with adding images to res > drawable folder I'm trying to add image to button menu created with BTv2. Immediately upon adding image .png to folder in Eclipse a red X error appears. Any insights, workaround, any anything?
 
MGoBlue
Apple Fan
Profile
Posts: 980
Reg: Jun 07, 2011
Gold River, CA
10,600
like
01/09/12 08:54 AM (12 years ago)
What are the errors you're getting? Most likely you've got a character in the image name that Eclipse doesn't like. You can't use dashes like 'my-image.png'. I needs to be 'my_image.png'
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
01/09/12 09:00 AM (12 years ago)
all my past apps have had ic- prefix to the images, so that shouldn't be the problem, but I'll give it a try.
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
01/09/12 09:18 AM (12 years ago)
The next number is B-42, Bingo, YES! We have a B I N G O, Congratulations, you are a winner. Worked like a charm, just had to remember to rename the icon name in the Button Item properties after I renamed the image. Thank you Zen Master MGoBlue, Fred Lesson learned: The Palace_Image.png with the - is the malise, the Palace_Image.png is the _ . . .
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
01/09/12 09:23 AM (12 years ago)
Just out of curiosity, do you have upper case letters in your image name like you specified above? This is from the BT Server v2.0 Readme about images in Eclipse : ECLIPSE ONLY ALLOWS LOWER CASE LETTERS IN IMAGE NAMES. This means the image you add to the /res/drawable directory must have lower-case file names. This also means that all the images named in your control panel must also have lower case file names. Mark
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
01/09/12 09:49 AM (12 years ago)
Glad you pointed that out. No, I've only added one image as of this time to my BTv2.1 app, will try one with an uppeer case letter just to experiment. Previouly, I've used both upper & lower case letter, btv1.5 with no problem. I'll let you know the result. VERY glad to have a solution, just wish I didn't have to rename all my images. :-(
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
01/09/12 09:54 AM (12 years ago)
Since the Readme says this is an Eclipse issue, and not a BT issue, seems like the restriction would have been in place for v1.5 as well, but perhaps it's somehow related to coding in BT. In any event, looking forward to the results of your testing! Mark
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
01/09/12 10:02 AM (12 years ago)
Ouch, Mark, I don't know if you're just the bearer of bad tidings, or you're making my task incrementally more difficult as a learning lesson, but Eclipse didn't like my UpperCase.png, guess renaming images will go on all day. Any quick and easy way to replace - with _ and UpperCaseNames with lowercasenames?
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
01/09/12 10:24 AM (12 years ago)
Ha! I prefer to think of it as having saved you tons of time now, instead of later when things blow up! I don't know if an easy way to rename them all. There is probably a Windows or Mac app out there that can do it pretty easily...I'd give Google a shout. It could probably be done with php on a server as well. Sorry to ruin you day! ;-) Mark
 
jaymobi
Android Fan
Profile
Posts: 35
Reg: Nov 09, 2011
location unknow...
350
like
01/09/12 10:44 AM (12 years ago)
@Fred, I've used this converter and renaming tool a few times now and it seems to do a great job for fast resizing and renaming image files. http://www.faststone.org/
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
01/09/12 10:54 AM (12 years ago)
Thanks Jaymobi, unfortunately I just finished the renaming. What amazing about this Forum, is that just by invoking David's name 3x's you get answers to all your questions. I'm going to try his name at the ATM this evening. Fred
 
jaymobi
Android Fan
Profile
Posts: 35
Reg: Nov 09, 2011
location unknow...
350
like
01/09/12 11:03 AM (12 years ago)
That's funny..ha yeah...better yet maybe you could create a magical atm money app and only share sdk with me lo.
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
01/09/12 05:35 PM (12 years ago)
follow up on Image names: Things my momma never told me. When building an Android BTv2.1 app certain png images will create errors (No explaination available) certain gif images will create errors (No explaination available) Never use - always use a _ instead of the - (even if it works in BT1.5) Never use a UpperCaseLetter in your image name (even if it works in BT1.5) because of the fickleness of Eclipse with the images, I've added to images a few at a time, so as to be able to idenify the offending images. (all these images worked in BT1.5 app)
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
01/10/12 12:06 AM (12 years ago)
David, David, David, isn't that a hit song from the 80's? Image names in Eclipse suck! This limitation is not actually related to Eclipse but instead related to how Android parses, tracks, and maintains 'resource information.' Tiny nugget: In case you've been wondering about the the crazy and super mysterious R.java file in your project, this is automagically created by the Android SDK. This file is a subfolder named gen/package name/ The idea is that Android creates a symbol for every single project resource (this is why it's called R.java) and this symbol represents a 'pointer' to the resource. All I can figure is that the Android team must have placed some generic file-naming restrictions on each resource to make it easier to parse all the files when automatically creating this resource list. It doesn't take long to do the parsing but you can notice a few things that Eclipse + Android does during this parsing. Example: Open up any layout.xml file and try to enter an image src in an ImageView (assuming the layout.xml file has an image view) and use a file name for an image that does not exist in your project. It won't take long for Eclipse to show the little red x next to the item in the editor. This is it's way to say 'hey, this resource does not exist.' It's not actually looking at the /resources directory when it does this, it's looking at the R.java file. The R.java file seems to be auto refreshed every now and then to help the code-hints and other fancy stuff in the editor. I do not like this behavior but do understand where it has some merit.
 
theGreek
Aspiring developer
Profile
Posts: 648
Reg: May 25, 2011
Schaumburg, IL
7,830
like
01/10/12 01:42 PM (12 years ago)
I'm not following this at all :( So how does one remove these errors? Description Resource Path Location Type R cannot be resolved to a variable BT_act_controller.java /testme/src/com/testme line 86 Java Problem I get a ton of them (495) The same project runs fine on eclipse on my Windows laptop.... Thanks
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
01/10/12 02:23 PM (12 years ago)
I had to remove the image. Renamed some images, avoiding - , and no UpperCase letters. Don't understand why a few images didn't work.
 
ianJamesPiano
Code is Art
Profile
Posts: 2661
Reg: Feb 13, 2011
Palm Springs, C...
37,010
like
03/30/12 04:55 AM (12 years ago)
Hi guys, are you able to use images placed in the res/drawable folders for list menu icons? I have icons showing from the Assets/BT_Images folder but need the different size icons for different devices...am I making sense? thanks!!
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.