How to add XML drawable in Eclipse

Problems with Canvas, OpenGL, etc...

How to add XML drawable in Eclipse

Postby djandreski » Tue Oct 19, 2010 8:11 am

Ok guys I'm little stacked here. According to official documentation Google says that "Once you've defined your Drawable in XML, save the file in the res/drawable/ directory of your project." is the way to add a XML drawable to the project.
But when I created the project ADT created 3 different drawable folders for mdpi, hdpi, and ldpi. So when I wanted to create my XML drawable, I right click on my drawable-hdpi folder and select "Add new Android XML file", and there I have to select what kind of XML file I want to create, but there isn't "drawable" to select.
If I create new text file and save it as button_drawable.xml Eclipse says that there is an Error in the file and that It can't build my project.
So, please tell me how do you add xml drawables in Eclipse ADT?
djandreski
Freshman
Freshman
 
Posts: 3
Joined: Thu Oct 14, 2010 9:05 am

Top

Re: How to add XML drawable in Eclipse

Postby JuniorDeveloper » Wed Oct 20, 2010 8:01 am

What error did you get?
JuniorDeveloper
Freshman
Freshman
 
Posts: 4
Joined: Wed Oct 20, 2010 7:55 am

Re: How to add XML drawable in Eclipse

Postby inmyth » Mon Nov 15, 2010 6:25 pm

There is no error. But there is no option in new Android XML menu for the type xml drawables. I wanted to create one for shape. Anyone please advise
inmyth
Freshman
Freshman
 
Posts: 7
Joined: Sat Oct 30, 2010 6:44 am

Re: How to add XML drawable in Eclipse

Postby inmyth » Mon Nov 15, 2010 9:00 pm

Kinda figured this out. To create xml files outside the preset type of Android create new XML menu (such as what usually put in res/drawable), you will have to do it the old way, by creating a new Java XML file. It works but it won't have any fancy ctrl-space auto-suggest.
inmyth
Freshman
Freshman
 
Posts: 7
Joined: Sat Oct 30, 2010 6:44 am

Re: How to add XML drawable in Eclipse

Postby Faraz » Wed Nov 24, 2010 4:56 pm

i think the XML file is created in layout directory and drawable directory is used for images in android.
Faraz
Once Poster
Once Poster
 
Posts: 1
Joined: Wed Nov 24, 2010 4:38 pm

Re: How to add XML drawable in Eclipse

Postby Schermvlieger » Thu Nov 25, 2010 9:37 am

Hi Inmyth,

Yes as you figured out yourself, xml drawables are an oversight in the Eclipse android extensions, unfortunately. Has been so from the beginning; I hope they will fix it sometimes, but I guess few people are using xml drawables in the first place haha :)
Schermvlieger
Senior Developer
Senior Developer
 
Posts: 159
Joined: Fri Feb 26, 2010 1:37 pm

Top

Return to Android 2D/3D Graphics - OpenGL Problems

Who is online

Users browsing this forum: No registered users and 8 guests