20172306 "Java program design" the first week to summarize the learning content of learning materials
This week, I studied the 23rd and 26th chapters of the book "Android and Java".
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"> <activity android:name=".MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity></application>
Debug your application: The way to test which sentence is the same as in idea for debugging. The difference is that the Android.util.log class is available in Android to log messages, and there are abbreviations that allow us to look for errors.
- 25th Chapter Activities
There are many ways to do this: onCreate: Called only once in the declaration cycle, Onstrat: can be called multiple times in a declaration, Onresume: can be called multiple times, OnPause: can be called multiple times, what happens after this depends on whether the activity becomes completely invisible, if yes, Call OnStop, otherwise the Onresume method is called, and when the activity is stopped, the OnDestroy method is called and can only be called once during the active cycle. When I looked on the Internet, I found this picture, and the Wenbin Wang I saw was also found in this picture.
When we start a new activity, we can take advantage of the intent method. You can call the Startactivityforresult method if you like to get a result of the invoke activity.
- 26th Chapter UI Components
- What you do with the UI tool is reflected in the layout file, as an XML element, to see what you've generated, and click the XML view at the bottom of the UI tool.
- Toast
- It is a small pop-up dialog that displays a message as feedback to the user, it does not replace the current activity, and only occupies a single message space
- Toast toast = toast. Maketext (This, "20172306", Length_long);
Toast. Show ();
is an example of a good toast.
- Notice
- A notification is a message that appears on the status bar, and unlike a toast, the notification is persistent and remains displayed until it is closed or the device is turned off.
- Notification is an instance of Android.app.Notification, and the easiest way to create a notification is to use a nested class called Builder that can instantiate the class by passing a context.
- Notification n = new Notification.builder (context). Bulid ();
- To publish a notification, you can use the Notificationmanager
- Notificationmanager Notificationmanager = (Notificationmanager)
Getsystemservice (Notification_service)
Problems in teaching materials learning and the solving process
- Issue 1: Install Android Studio First, but it will show sync failed. Then it will prompt me to download a gradle.zip, the problem was remembered to solve, forget
- Problem 1 Solution: I'll follow the download, then it will say, try again. I went down, the results about 12 times over, I gave up, I don't think so, and then I went online to find a solution, he said let me download zip on the official website, but no use, and then another classmate and I encountered the same problem, did not solve, and then re-built a project, it is somehow good!!!
- Question 2: When you look at the toast, remember that the teacher said you can change the time of the toast display, but I do not know how to do it?
Problem 2 Solution: I checked the internet. Discover that we can set a method ourselves to set the time to change the toast.
- Question 3: Seniors say that when we're doing something, we can build one module at a time without a project, but when I'm building the second one, my Android studio suddenly Gradle and goes wrong.
Solution for Issue 3: I don't know what's going on, just restart Android for a bit, and I don't know why, I guess it's a little slow to react!
[Code Hosting]
No code this WEEK!!!!
Last week's summary of the wrong quiz
An abstract data type contains a data structure and methods for manipulating and accessing the structure. In these lists, only this vector is a combination of the two vectors. An array is a data structure, but there is no method (such as an Insert method or search method) that references a variable and the original type is data, rather than a structure.
All of these answers are types of object-oriented attributes. Abstract data types encapsulate the data structure and the methods that manipulate them, preserving information hiding. As a result, all Adts use hidden information so that data structures cannot be manipulated directly from outside the ADT, but other object-oriented features are not required.
In a linked list, a link is a reference to the next node. By examining the contents of the reference material, you can use "dereference" to track the link. The Node object. An object is an instance of a class. The data portion of the node is most likely an int, as well as other types of data.
A simple linear list is directed from its starting node to its end node. Neither the diagram nor the graph has a starting node, but the tree is indeed the root of the tree. So, a simple linear list is an example of a degenerate tree with a branching factor, each node having a separate successor, starting at the root and ending with a single leaf (end node).
Although both operations are "add" or "insert" operations for their respective abstract data types, they differ in that push is added at the top (or front end) of the stack, and Enqueue is always added after the queue
An array is a data structure that can be used to store a series of values, but there are no implemented actions in the array to perform list operations, such as adding to the end, or deleting a given value.
Both the queue and the stack are abstract data types, and their implementation is irrelevant, and it is the operation that defines them (Enqueue, dequeue, push, pop). As a result, two Adts can be implemented using arrays or linked lists.
In Java, all data is primitive or class. ADT is a data structure, so it is not just a primitive type, but a different type of structure. Therefore, ADT must be defined in the class. Not all classes are Adts, but all Adts are defined as classes.
Although the two-way list has multiple links in each node, it is still linear when you draw a picture of a two-way list.
Apt-cache Search Tree
TAR–CF Dky.tar Dky
Grep–rn MAIN/SRC
The upper and lower left and right order is KJHL
Pair and peer review templates:
- Blogs that are worth learning or questions:
- Based on the scoring criteria, I scored this blog: 8 points.
reviewed the classmates blog and code
- This week's study of the knot
- Pair of students study No. 1
- Pairs of learning content
- studied together from chapter 23rd to chapter 26th.
- Together to do the teacher on the blue ink cloud five experiments
- Together, we studied chapters 27th and 28 during the experiment.
Other (sentiment, thinking, etc., optional)
这学期Java的学习很快就要结束了,这貌似也是这学期最后一次写教学的博客了。这一门课我学的不够好,自己也知道原因,一是自己这学期放在Java的时间不够多,很多练习自己都是一知半解的;一个是学习进程太快,自己理解的太慢了,很多时候自己刚学一半就又要进行下两章的学习了。往往会让自己对这门课失去一些兴趣;一个是自己的博客写的吧,不够好,不够细致吧,而且我问题比较少,其实也有,就是很多时候我都想着解决问题就不记得,等写的时候,我就不记得都有什么问题了。不过,自己还是没能合理的安排好自己的时间。其实最开始自己还是立志一定要学好Java的,后来渐渐走歪了。我希望自己假期的时候吧,能把Java的一些基础的东西再学习学习,我知道下学期还要继续学习有关知识,我吸取这次的经验,争取在下学期学好这门课
Learning progress Bar
|
lines of code (new/cumulative) |
Blog Volume (Add/accumulate) |
Learning Time (new/cumulative) |
Important Growth |
Goal |
5000 rows |
30 Articles |
400 hours |
|
First week |
193/200 |
1/1 |
20/20 |
|
Second week |
247/440 |
1/1 |
22/42 |
|
Third week |
445/895 |
2/2 |
20/62 |
|
Week Four |
885/1780 |
1/1 |
43/105 |
|
Week Five |
775/2555 |
1/1 |
55/160 |
|
Week Six |
1171/3726 |
1/1 |
38/198 |
|
Seventh Week |
596/4322 |
1/1 |
60/258 |
|
Eighth Week |
569/4891 |
2/2 |
55/313 |
|
Nineth Week |
1890/6781 |
1/1 |
66/379 |
|
Tenth Week |
1021/7793 |
1/1 |
70/449 |
|
11th Week |
0/7793 |
3/3 |
50/499 |
|
Resources
The Toast of Android
Android Life cycle
20172306 Summary of the first week of Java programming and data structure