I am trying to understand Android TCP client and Server communication, illustrated here and errs here. I get all the time "R cannot be resolved to a variable" and it is used like the below. What is this R -object that has methods such as layout and id?
setContentView(R.layout.main);
textDisplay = (TextView) this.findViewById(R.id.text1);
P.s. You can find the codes in GitHub tcpcommclient and tcpcommserver here.
R is a static class that lists all your resources (usually defined in XML, but all available in your res folder).
For more info: Understand the R class in Android
edit: According to here: The android java class cannot recognize the R file
one of your classes might actually be importing the R.java class. Never do that. If there are imports of that class, remove them.
Also, You might to clean the project (project – clean – clean project)