Hello, Android
Project Introduction
To participate in an information security competition, I chose the behavior analysis and evaluation topic of Android apk. First, I need to know how to compile and run the android program. Our first task is to write an app for multi-user communication.
I have no development experience in Android or java, and only have C # project experience. Because our project is an apk behavior analysis rather than an app, so we can only find a way to "speed up.
Tools and reference books development tools: Android Studio2.0Java reference books: crazy Android handout version 2 starts the first Android project to create a project
Select a topic:
Workspace Introduction
Like most ides, the workspace on the left contains various files. The meaning of these files is clearly stated in the crazy android handout.
There are various la S and controls in the middle.
I select handwriting Layout
Modify control attributes
Add a button
Complete Layout
Improved Button
Click a Button
If the explanation in the figure is not clear, you can enlarge the webpage.
What puzzles me most here is this Code:
pushBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { } });
First, the parameter in the setOnClickListener function should be a ClickListener object. However, this Code directly creates an object and overwrites a function in it. I can't understand it, but I think of the previous section "anonymous Method" in C #. I checked the source code of the View class and found that OnclickListener is an interface of View. So I checked the information online and understood the problem. This is equivalent to creating a new class. This class inherits the OnClickListener interface of View, overwrites the onClick method, and instantiates it through new.
Complete OnClick
Generate apk
Installation and running conclusion
A very simple Android program is completed. First, this article is not an article about how to develop Android programs, but an article about how to quickly understand android. If you have any questions, please correct them.
The first chapter of crazy android handout gives a general introduction to all aspects of Android. It is recommended that you read the lecture several times. The remaining options are more important, for example, the communication between threads in the next article is Handler.