Article From:

20172313 2017-2018-2″ program design and data structure “Eleventh weeks learning summary

the summary of the content of the teaching material

  • A brief introduction of the twenty-third chapter Android
  • The twenty-fourth chapter first acquaintance of Android
    • Android Studio It is a Android integrated development tool, based on IntelliJ IDEA. similar to Eclipse ADT, and Android Studio provides an integrated Android development tool for development and debugging.
    • ProjectThere are two main nodes in the window: app and Gradle Scripts. App also contains three nodes: manifests (contains another AndroidManifest.xml file, describes the application), and Java (containsSome Java applications and test classes, res (including resource files).
    • Every Android application must have a manifest file called AndroiManifest.xml to describe the application.
    • LogClass has a way to log messages at different day to level levels. D (debug), I (info), V (verbose), w (warning), e (error), and WTF (E).
  • Twenty-fifth chapter activities
    • ActivityThere are six methods: onPause, onStart, onResume, onDestory, onRestart and onStop. As shown in the following figure:
    • IntentIt represents the startup intent of the Android application, and the Android application will start the specified component based on Intent.

      In the Android help document, the introduction of Intent is An intent is an abstract description of an operation operation an, meaning aNtent is an abstraction of an upcoming operation, and Intent’s literal awareness is “intent”, and the three other basic components of the Android application — Activity, Service and Broadcast, ReceiveR is activated by messages called intent.

  • The twenty-sixth chapter UI component
    • The following components are often used. TextView, EditText, Button, RadioButton and RadioGroup, CheckBox, ImageView.
      TextViewThe basic properties (android:text; Android: textColor; Android: textSize). The basic properties of EditText (android:inputType, android:h)Int, android:drawableLeft, android:drawablePadding). The same properties among controls (android:text, android:width, android:he)Ight, android:id) the unique attributes of each control (Button:onClick, EditText:hint, inputType, CheckBox:Checked, RadioButton:Checke).D)

    • ToastIt is a message prompt box, which displays a message prompt box on the screen, no buttons, no focus, and disappear automatically after a period of time.

      ToastIt is a view that provides users with concise hint information. Don’t get the focus
      Automatically disappears after a period of time
      Toast It is a View view that displays a small amount of information for users.
      Does not affect user input and other operations, mainly for some help / prompts.
      Toast.makeText(Mainthis, “The content of the prompt, Toast.LENGTH_SHORT).Show (); the first is the context object. The two is the content of the display! The third is the time to display. Only LONG and SHORT two will take effect.It’s the two!

  • A notification is a message that appears in the status bar. Unlike Toast, the notification is persistent and will remain displayed until it closes or closes the device. A notice must contain the following three properties: small icons, corresponding to setSmallIcon (); notification heading, corresponding to setCo.NtentTitle (); detailed information, corresponding to setContentText ().

problems and solutions in textbook learning

  • Question 1: when we first started reading the textbook, we learned that Android Studio provides support for Gradle based construction. What exactly is Gradle?
  • Problem 1 solution:

    GradleIt is a project automation building tool based on the concept of Apache Ant and Apache Maven. It uses a Groovy based domain specific language (DSL) to declare project settings and discard all kinds of cumbersome configuration based on XML. Java oriented application oriented. Currently its support language is limited to Java, Groovy, Kotlin and Scala, and plans to support more languages in the future.

Software development pays attention to code reuse, by reuse can make engineering easier to maintain, less code. Developers can use inheritance, combination, function module and so on to reuse the code in different degrees. But I wonder if you have ever thought that software development is also a kind of engineering work, not only to write code, but also to work.The various management of the process (dependency, packaging, deployment, release, differential management of various channels…), you are in build, clean, signature, packaging, and release every day. Have you ever thought about this process and can be described like code, and can be reused.

  • Question 2: when using the listener in AS, it is not clear what the usage and significance of the listener are.
  • Problem 2: solution: search the Internet for information and get a preliminary understanding.

    1、The listener is an abstract class, which contains a function that the system will call when the event is triggered.
    2、In the subclass, rewrite this function according to the needs of your project.
    3、The derived listener needs to be bound to the button, just like an earphone can make a sound, but you can’t hear the sound if you don’t wear it. The general situation is that this button may be required by this button, and the other requires another listener, each of the listeners in its own duty, but the function phase.At the same time, multiple buttons can be used to bind a listener together.
    4、All kinds of controls have common events, such as clicking buttons, dragging a scroll bar, switching a ListView option, and so on, and his binding monitor’s function naming rule is setOn****Listener

  • Question 3: in learning the intentions related to activities, the teaching materials are divided into explicit intentions and implicit intentions, not very clear what they represent.
  • Problem 3 solution: explicit intention: calling the Intent.setComponent () () or Intent.setClass () method explicitly specifies the Intent of the component name as explicit intent, explicitly specifying which group the Intent should pass toPiece.
    Implicit intent: Intent with no specified component name is implicit intent. The Android system will find the most appropriate components based on the action, category, data (URI, and data types) set in the implicit intent to handle this intent.
    Display intent is very common and very simple. It is commonly used to convert Activity calls between applications.
    Implicit intention:
    The simple summary is: the intent includes: Action, Category (additional information), Data (data, specific content), Tpye (type), etc., for example, that the intent is to start a component’s complete action information, just like a hit, and it isAction actions, people are Data content, and Type is the type. What kind of people do we play? The bad person, type is the type of bad finger, only the information is complete to carry out a complete intention, and of course, there are some information, such as scheme is the front of the URI type of data.It is like sms: in this example, as well as host host name, path path and so on.

code trusteeship

  • There is no code cloud link without code.^▽^)

the summary of the wrong questions in last week’s examination

  • Error 1:One operation that we might want to implement on a Stack aF the data structure has room for another item to be to

A . only if the Queue or Stack is implemented using an array
B . only if the Queue or Stack is implemented using a linked list
C . only for a Queue
D . only for a Stack
E . none of the above, a full operation is not useful at all

  • analysis Since the array is a static size object, if it is filled, it should prevent any added type of operation, whether it is a List insert, a queue or a stack. This can be determined by first checking whether the structure is full. If the data structure is implemented using linked lists, thenIt is unnecessary, because we assume that dynamic memory can be used to add new elements.
  • Reason This problem is because I understand the wrong idea, my idea is a stack and a queue using a chain list, and the list is dynamic, so it is meaningless to check whether the structure is full. But I forgot the most important point!!! That is, the linked list is also implemented by an array.
  • Wrong problem 2:In a linked list in Java

A . the link is an object
B . the link is a node
C . the link is a reference
D . the link is an int
E . the link is a class

  • analysis In a linked list, links are references to the next node. By checking the contents of references, link is linked by “cancel reference”. A node is an object. An object is an instance of a class. The data part of a node may be a int, and any other type of data.
  • Reason The mistake of this question is that the definition of the linked list is not clear.
  • Wrong problem 3:A simple linear list

A . is an example of a degenerate tree
B . is an example of a degenerate graph
C . is an example of a degenerate digraph
D . cannot be represented as a degenerate tree, graph or digraph
E . none of the above

  • analysis A simple linear list from its starting node to its end node. Graphs and two binary graphs do not have starting nodes, but trees have the root of a tree. Therefore, a simple linear list is an example of a degenerate tree. It has a branch factor, and each node has only one successor, starting from the root.To the single leaf (end node).
  • Reason When you study, you don’t understand what the degenerate tree code is.
  • Error 4: in Ubuntu, when using the VIM editor, you want to move the cursor, in addition to the direction key, you can also use the hjkl key to move up and down in turn.

A . true
B . false

  • analysis The order of up and down is kjhl
  • Reason This question is very difficult to defend. It is completely ignored that there can be mistakes here.

pairing and mutual evaluation

  • What is worth learning or problems in the blog:
    • Beautifully typed, we have studied the problem very meticulously, and the answers are very comprehensive.
  • What is worth learning or problems in the code:
    • Code is very standard, clear thinking, continue to fuel!

  • This week’s pair of pair learning
    • 20172332
    • 20172326
    • Pair learning content
      • A brief introduction of the twenty-third chapter Android
      • The twenty-fourth chapter initial Android
      • Twenty-fifth chapter activities
      • The twenty-sixth chapter UI component

learning progress bar”

Number of lines of code (New / cumulative)Blogs (New / cumulative)Learning time (New / cumulative)Important growth
target5000That’s ok30piece400hour
First week1261/120/20
Second weeks388/4661/215/35
Third weeks706/11621/317/52
The fourth week1104/22661/420/72
Fifth weeks1126/33921/515/87
Sixth weeks906/42981/620/107
Seventh weeks1233/55311/720/127
Eighth weeks1091/66221/824/151
Ninth weeks320/70421/920/171
Tenth weeks335/73771/1020/191
Eleventh weeks0/73771/1120/211
  • Planned study time: 20 hours

  • Actual time of study: 20 hours


  • 《Baidu Encyclopedia
  • 《How to understand Gradle in a popular way? “
  • 《Probably the most complete Android Studio entry-level document in history.
  • 《Android Studio Android UIControl learning notes
  • 《AndroidLearning record (7) — Usage of intention and implicit intention in Intent

Leave a Reply

Your email address will not be published. Required fields are marked *