I'm an iOS developer, and I'm expanding my skill set by working through the recommended Udacity tutorials for Android development.
In the "Add a Menu" tutorial in "Developing Android Apps", in order to create a new XML file for menus, it states:
"right click the res directory, select 'Android Resource Directory'". This is followed by a number of other points to correctly set up a menu xml file.
On my system, when I right click on the res directory, I have no option for "Android Resource Directory". I've uploaded a screen grab of what I get:
compared to the tutorial:
I've tried just creating a standard directory, and then right clicking and making a new xml file within it, but it doesn't seem to be working, as the XML file won't even open when I double click on it. I'm guessing it also won't be setup correctly, and I'm not sure how to do that manually.
I also tried the "Resource Bundle" option, but it didn't seem to give similar options as to what the tutorial says is to be expected.
I've had a look in the Udacity forums, and didn't see anything there on this. They also didn't seem to be frequented much, so I thought asking here was a better idea.
I'm also guessing Gradle sync error is not causing this, I haven't looked into the cause of that yet, I think perhaps because of my Core2 processor...
My guess is it's to do with my newer version of Android Studio, but I've been unable to find any info on this.
Thanks for any pointers :)
Seems like your gradle project files are not synced properly. As it is in screenshot you shared. You need to make sure gradle syncs successful so android studio will provide those context menu options properly for specific directory
Here - Resource directory
Click on Build->Clean Project and then file-> sync project with gradle file
Try the menu New/Folder/Font folder
Related
I'm sorry for the title of my question but that's the best title i could come up with....
It seems like my android studio project just got butchered from one day to the next. When i open some of my java file, i see nothing related to my code same thing with most of my xml files, but when i navigate to those files in my file explorer and open them same files with notepad i then see the correct content.A screen shot of one of my java files
And one of my xml files
This is a common problem in Android studio
Please follow this answer
https://stackoverflow.com/a/63027190/7793652
I was working on my android project, which is stored on Google Drive, and I started getting a bunch of errors. When I looked, it looked like every folder in my project had a desktop.ini file added to it. I figured that I would just go into Google Drive and delete them all but if I search for desktop.ini it returns no results in Windows Explorer. I've tried deleting them through Eclipse but it seems like when I delete one, three more take it's place. I'm not sure what's going on or how to fix this, any help would be greatly appreciated.
if you click on the package or class and then click on the top bar "Project", an option page should open. navigate to:Resource - Recourse filters. click on add filters. Filter type: exclude all. Applies to files (all children). type desktop.ini in the box and click ok.
I was looking for a way to add some such folder in my Android Project that do no get compiled up to my apk file.
Why I need it :-
We need to maintain proper documentation for project (that actually
everybody needs to ;) nothing new),
but I find it very irritating to look out for that documentation
folder again and again.
.
I am open for any way i can make dcocumentain folder easily one
click accessible (I am already doing it thru taskbar sortcut. ) But
I want it to get the ease of version control thru Eclipse likewise we
do it for our project
IDE :- Eclipse
I got a way myself :-
I had an idea that if I create a folder in my application project with
some anonymous name that actually android has not listed in its
directories ("I am talking about the default one like "res", "src",
"anim"......)
Then either it should "raise an error" or should "ignore" it while compiling to form apk file
luckily it ignores any such folder. now i can put all the documentation in my project.
NOTE:-
My answer empirically driven
I had tested it by creating a "Docs" folder and then copied 1 GB of
random data (includes almost all type of files we came across from
multimedia to zipped ones).
Then I build the apk and the size of the apk was in-effective of all
this..
but when i copied the same data to assets it was showing a huge change
in size of my apk file..
Consider using Javadoc in addition or, if possible, instead of any other documentation.
I'm trying to change the background of my first app to a png I have. I put the png in a newly created folder called "drawable." When I go to browse my "drawable" I can't see it's "children" or files. The only error of sorts that it gives me is "You must... rce item" anyone run into this? Android API 7 by the way.
Put the png in /res/drawable and then do a clean on your project in eclipse to force the .R class for your app to be recreated. You might also need to do an f5/refresh in eclipse on the project to get it to see that you have added a file in filesystem to /res/drawable.
I am developing android applications using Eclipse IDE.
Now, I have given someone else's code to modify.
I need to check where a particular drawable/image in the res/drawable folder is used in the code or in the xml (res/layout). Also I need to find where I a particular xml (res/layout file) is used in the code.
Is there any short-cut to find out these things or I need to go through each & every line of code to find out these things ?
Please help.
#Ankit
For First Thing for checking a particular drawable/image in the res/drawable folder if you want to find that whether image resource is used in project or not for that you have to search like this in Eclipse For Example Your image name is bg.png so you can search like this using Ctrl+h in your Project Explorer than when search window Open you will find one File Search tab than write this in search box #drawable/bg than you will get Match Result.
For Second Thing Now use Same Ctrl+h than write this R.layout.yourlayoutname in search box than if this layout is used in your android project than you will get result for that.