I am trying to get into Android programming, but I cannot understand the Google Tutorials
For example:
public void sendMessage(View view) {
Intent intent = new Intent(this, DisplayMessageActivity.class);
EditText editText = (EditText) findViewById(R.id.edit_message);
String message = editText.getText().toString();
intent.putExtra(EXTRA_MESSAGE, message);
startActivity(intent);
}
I take it this is a variable or is changed for your project? =new intent(this....
Also, is there an easier way of learning this? Ideally I would have something which explains, almost literally, every word in the code surrounding this, I’ve had a look at a book, I think was called ‘Head Start Android Programming’ which was fairly informative.
Overall I’m just very confused by the correct way of doing things, which way to start activities, what goes where and so on..
thisis standard Java syntax, referring to the object whose method is being executed.First, since it would appear that you are unfamiliar with Java, I would recommend learning Java before trying to learn Android development. There are countless books, Web sites, and training courses available on Java programming.
Second, the particular snippet of code you have above is relatively far along in learning Android development — that should be a few hundred pages into the development guide or set of tutorials.
You are fairly lucky, as Head First Android Development appears to be no longer in print, or at least it is unavailable from Amazon.