This article is the first part of “Technology Exchange -Android”. It mainly introduces the work content of Android development, involves the technology and the difficulties in the work, and ends with a HelloWorld project.
First, front-end – client – Android
Let’s start with the positioning of Android development in Internet companies. The services of an Internet company can be generally divided into “front end” and “back end”. The front end is the part given to users, such as websites, apps, small programs, etc., which is mainly responsible for data display and user interaction. The back end is the provider of services and is mainly responsible for processing various kinds of data.
The “front end” above is the front end in a broad sense, which can be divided into Web front end, Android and iOS, etc. Android and iOS are also divided into clients in the mobile Internet, which are the categories most directly in contact with users.
PS: Hongmeng OS is special, and it is not too late to further study after the relevant technology and ecology mature. For the time being, it can be considered that Hongmeng OS is no different from Android (both are compatible anyway).
The aforementioned Android development is App development, not games, and game development is a completely different technology.
2. Android related technologies
The capabilities of Android are very complex. Different categories of apps may emphasize different technical points, but the basic functions are similar. For the basic part, we only talk about the technologies that all apps must use, and the practical part will be expanded according to the situation.
1. Premise: Development environment and programming language
There is only one official IDE for Android development: Android Studio. Android Studio supports Windows, Mac, and Linux, so there is a wide range of development machines to choose from, but at least 8GB of memory is required for compilation time and development experience.
You can choose between Java and Kotlin. Kotlin is recommended on the basis of both languages. Officially, Java is always supported, but recently some extension libraries have been built on Kotlin features…
2. Technology involved in the development work
(This is just an overview to understand the scope of Android development, not a complete summary)
First of all, it is based on the structure of the front and back end. Network is a very important part of Android applications. Android development needs to do is to build requests, deal with data and network errors, monitor network status and other work, involving Http, Socket and other technologies.
Interacting with users is at the heart of Android apps, and implementing UI effects through code is the largest part of Android development. In Android, UI drawing is done by a single thread, and to ensure smooth interaction, all time-consuming operations must be done in other threads, so inter-thread communication is an inevitable problem in Android development.
Then there are audio and video and live-streaming technologies, which have become more and more in demand in recent years. Although most users (including me) generally feel that having video and live-streaming in all apps is intrusive and transgressive, it also means that developers need them wherever they work.
There are a lot of technologies that I can’t talk about, and a lot of technologies that I don’t know about. A famous product producer once said that a mobile phone is an extension of the human body. Whatever features exist on Android devices (phone, TV, car, etc.), developers need to implement them.
Third, Hello Android
Making a Hello World project for An Android project can’t just output a string. Let’s add something interactive, like… An interactive Hello World.
First look at the effect:
First, create a new project. We select the latest version of Android Studio: Arctic Fox, create a project with only Empty Activity and wait for it to be initialized.
After completion, the default opened is the Empty Activity newly created with the project template, which is called MainActivity by default. “Activity” corresponds to a page of Android App. It is the basic component of Android App, and also the main content we need to develop.
The following is a part of the detailed operation steps, experienced friends can skip.
Brief implementation steps
The UI changes are made in res/layout/***.xml, which opens to the Tab file activity_main.xml by default. The default template already has a Hello World, so switch to “Split” in the upper right corner of the editor and start editing. To increase interaction, we add a button.
Android: SRC =”@drawable/ic_android_black_24dp” android: SRC =”@drawable/ic_android_black_24dp” You can add it to the project by right-clicking New -> Vector Asset.
The button is now visible in the preview area to the right of the Split.
And then the interaction, which is to click the button once and add one to the number after Hello World.
The code is written in MainActivity, first findViewById to find the XML object corresponding to the View, and then set the button click event listener, after each click to modify the text content.
After the code is completed, open the developer option of the phone, open the USB debugging inside, connect the computer with USB cable, and check the popup window on the phone to allow debugging to run the App on the phone.
“
The Demo code has been uploaded to github and will be updated on the same project for each “basic” article. You can checkout the code for each “basic” article according to the commit information.
This is the end of the overview of Android development, because I don’t know if there is an audience, so the detailed part will have to be by feeling, if you find that you don’t understand or write something wrong be sure to comment, every feedback is very important to me, thanks.
The next article is an overview of Android development from the perspective of code, which is a purification of my four years of work experience. See you tomorrow!