To what Android app tutorial are you referring?
I'm going to assume that you're so new at this that you have a thousand questions no matter where you turn. The trick for me, at that stage, was to just get something, anything, working. After that, I'd just keep building, carefully, inside of that first success (well, a copy of it, actually... I was that paranoid).
So... I'm offering here to quickly take you through the steps in creating an app in your Android/Eclipse environment. If things start breaking down then perhaps your setup isn't right. But if your setup is good then you should have a running app in about ten minutes.
From that, you'll see that you don't have to worry about a lot of the details in the answers given for your Stackoverflow [this] post (at least, not until you gain more experience).
(note that this stuff, in greater detail, is found here but I'm going to give you a seriously "let's just get this going already" version)
In the Eclipse menus...
File -> New -> Android Application Project
a "New Android Application" dialog window will come up
Type "MyTestApp" in the Application Name field and simply accept everything else.
Click Next.
You'll be getting four more dialog windows after that first one. Accept all of the defaults on each of them and simply keep clicking Next until you get to the last dialog. There, just click Finish.
At this point, the project is being created. Depending on your computer, this might take a few seconds. You can see progress with the messaging displayed in the bottom right corner of the Eclipse window. See nothing there... it's created.
If your Android/Eclipse setup is good then you should soon see a "MyTestApp" project in the Package Explorer. The project will be open (you'll see a bunch of folders in a hierarchy). "activity_main.xml" will be highlighted under the "layout" folder, all of this under the MyTestApp project folder.
Click the MyTestApp project folder, to select it. Then, in the Eclipse menus...
Project -> Build Project
Again, watch the status messaging at the bottom right of the Eclipse window. If your computer is quick then you may not look in time to catch them. See nothing there... your project is built.
In the Eclipse menus...
Run -> Run
Select Android Application in the dialog and click OK.
At this point, you may or may not get a device dialog. If you do, choose to Launch a new Android Virtual Device (an emulator). You may need to go to the Manager (there's a button for this), to set up a device. I use AVD_for_Nexus_One_by_Google. I know that one works.
Be forewarned that the emulator will seem to take forever to start up. Be patient. Be VERY patient. You should see the app running shortly.
So, assuming you see a running application in the emulator... let's see what you ended up not having to worry about...
If you examine the auto-generated MainActivity.java file, in the project that you just created, you'll see that the code that you were concerned about...
getMenuInflater().inflate(R.menu.main, menu);
... seems fine. No error indications.
You'll also notice that there is no "R-type" import at the top of the source code.
Notice, if you dig down to the bottom of the "gen" folder, under your "MyTestApp" project folder, in the Package Explorer, that there's an R.java file. This is automatically generated when the project is built and is the file to which your getMenuInflater refers.
The point to all of this is that you'll have (if your Android/Eclipse setup is good) something working, giving you a launch point to play with other things.
Good luck. I've sure been having a blast.
main.xml
define inres/menu
folder ? – Alexis C.res/menu
from following the 2013 big nerd ranch guide from the beginning. It asks me to create effectively amain.xml
but it's inres/layout
. What should thisres/menu/main.xml
file contain? – user27886