Hello, Android

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.