[Android] Realize login, registration, database operation (very simple)

Finally, go on, don't linger...

         I finally recorded a video : "[Android] Login Registration (Concise Version)"

         - Praise is risk-free, don't be cautious when complaining.


I recently wrote another article, which is an upgraded version of this article. I will use this article to draw attention:

"[Android] Realize login, registration, database operation (very complicated)"


The source code address of this article (go in and find JustLoginRegister):

(Update on 2019-12-05: I have updated Gradle to the latest version 3.5, and dependencies have also been migrated to androidx, hereby explained)

https://github.com/littlecurl/AppProjects

There are detailed comments in the source code. Remember to change the gradle version number to the local gradle version number, otherwise AndroidStduio will download it by itself, wasting time.


I was so busy typing code that I forgot to eat lunch, and I only remembered it at 2:30.

This article I wrote is about using Android to implement login, registration, and database operations.

Put the final rendering first:

 

 

 

First declare that the version of my AndroidStudio is:

          Time to write the text!

          First of all, when we use AndroidStudio to run the written Android program, that is to say, when the small green triangle is pressed to start the small phone, what will happen to the entire AndroidStudio? This matter is so important that you can't learn Android programming without knowing it.

                                                                 

  

        That's right, it's the two icons you see, the two things that torture you to the point of death.

        When you stay up until two o'clock in the night, dragging your tired body to type the last line of code, holding the mouse in your trembling right hand, squinting your eyes and aiming at the small green triangle, you click with the last ounce of strength in your life The left mouse button, and then the whole person Ge You paralyzed on the keyboard waiting for it to run, what happened to it? Behind all this, is the distortion of human nature or the decline of morality? Ahhh, again. What is the logical structure and operating principle behind all this?

        I've tried my best to illustrate my humble opinion on this process.

        First look at the three-level directory of my Android program

 

        I've marked the order 0 → 1 → 2 → 3 → 4 for a total of 5 steps

step 0

Compile, what is Gradle, I don't know, I only know that Android is compiled with Gradle, and it will

1. Check whether Gradle's own program is available or the latest version

2. Start various programs that are invisible on our desktop. If I guess correctly, Gradle is similar to Java and Python, probably some java.exe, javac.exe and so on.

3. Match various dependencies, check the integrity of the existing ones, and download them from the designated website if they do not exist.

step 1

Parse the registration XML. The role of AndroidManifest.xml in Android is similar to the registry in Windows. Each Activity.java needs to be registered, and there are MAIN and LAUNCH settings. MAIN means: main, entry; LAUNCH is: It means to start and load. In other words, AndroidManifest.xml is a guide, telling AndroidStudio where to start running and what the general content is.

 Step 2

Running Activity, the so-called Activity is translated as: activity, interface An Activity is a running interface, and AndroidStudio will start the Activity that is set as MAIN and LAUNCH in AndroidManifest.xml. After the home page is started, it is the jump communication between each activity.

Step 3

Parse the layout XML, and load its own xml layout file when each Activity is created (onCreate). These xml layout files define what the corresponding Activity looks like.

Step 4

After parsing the layout XML, the appearance of each Activity is determined, and then the code in the Activity that performs operations such as responding to clicks and swipes will be returned.

 

Source code download address: https://gitee.com/littlecurl/AppProjects/raw/master/JustLoginRegisterTest.zip

 

 

Come on, everybody! ! !


 .


If you feel good after reading it, leave a like and leave.


.

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326038191&siteId=291194637