in addition to all answers if u don't use xml files for apps this is a brief explanation what for serves VIEW ID :
(btw in my opinion using xml sucks - my only xml file is manifest :D generated by gradle)
@IdRes - annotation for resource id
/** define resource id for view */
@IdRes
int TEXT_VIEW_ID = "111111";
/** create edit tex in code */
EditText myTextView = new EditText(Context);
/** set view id */
myTextView.setID(TEXT_VIEW_ID);
/** set layout params etc then attach or inflate as u wish to view hierarchy */
/** use view id to find view */
EditText etFound = (EditText) View.findViewById(TEXT_VIEW_ID);
ps. ID is mandatory to preserve state of hierarchy view when Activity.onSaveInstanceState(Bundle) is used - so if u create in code (VIEW / WIDGET / LAYOUT etc.) don't forget to set it.