20182333 2019-2020-1 “Data structure and object-oriented programming” experiment 5 report
Course: “Program design And data structure”
Class: 1823
Name: Qian Jiayu
Student ID: 20182333
Experimental teacher: Wang Zhiqiang
p>
Experiment date: October 14, 2019
Compulsory/Elective: Compulsory
1. Experimental content
1. Installation test of Android Stuidio:
- Refer to Chapter 24 of “Java and Android Development Learning Guide (Second Edition) (EPUBIT, Java for Android 2nd)”:
- Refer to http://www.cnblogs.com/rocedu/p/6371315.html#SECANDROID, install Android Stuidio
- To complete Hello World, it is required to modify the content in the res directory, after Hello World Display your student ID, the student ID of a student before and after your student ID, submit code running screenshots and code cloud Git link, screenshots without student ID will be deducted points
- Learn Android Stuidio debugging application
2.Activity test
- Refer to Chapter 25 of “Java and Android Development Learning Guide (Second Edition) (EPUBIT, Java for Android 2nd)”:
- Build the project, run the textbook related code
- Create ThirdActivity, display your student ID in ThirdActivity, modify the code to let MainActivity start ThirdActivity
3.UI test
- Refer to Chapter 26 of “Java and Android Development Learning Guide (Second Edition) (EPUBIT, Java for Android 2nd)”:
- Build Project, run the textbook related code
- Modify the code to display your student ID information in the Toast message
4. Layout test:
- Refer to “Java and Android Development Learning Guide (Second Edition) (EPUBIT, Java for Android 2nd)” Chapter 27:
- Build the project and run the textbook related code
- Modify the layout so that the interface of page P290 is different from the textbook
5. Event handling test:
- Refer to Chapter 28 of “Java and Android Development Learning Guide (Second Edition) (EPUBIT, Java for Android 2nd)”:
- Build the project, run the textbook related code
- Submit code to run screenshots and code cloud Git link, screenshots must have student ID watermark, otherwise points will be deducted
2. Experimental process and results
1. To complete Hello World, you need to modify the content in the res directory. After Hello World, you must display your student ID, one before and after your student ID Student ID of a classmate
- Screenshot of running results
2. Create ThirdActivity, display your student ID in ThirdActivity, modify the code to let MainActivity start ThirdActivity
- Screenshot of running results
3. Modify the code to display your student ID information in the Toast message
- Screenshot of running results
< img alt="Share picture" src="/wp-content/uploads/images/mobile/android/1626792371290.png" >
4. Modify the layout
- Screenshots of running results
5. Event handling: build the project, run the textbook-related code
- Screenshot of running results
3. Problems encountered during the experiment and their solutions
- Question 1: Error running app: Default Activity Not Found prompt appears on the console
- Question 1 solution: Because when Android Studio creates a project, the default setting of the Lunche project requires Activity, because the simple Widget program, if it is not associated with the application, does not need to create the MainActivity in the Android project. After the Build Project, it will be debugged and installed. Report an error.
- Open the configuration
app
->Edit Configurations...
launch
option drop down and selectNothing
- Open the configuration
- Question 2: Element selector must be declared
- Question 2 solution: This is because of
.xml
is in the wrong place, you have to move it back to the corresponding folder. - Question 3: The user data image is used by another emulator. aborting
- The solution for question 3: This is because the emulator is not shut down properly and should be shut down during the process. Then restart.
- Question 4: Error Cannot resolve symbol
- Question 4 solution: Click
File
->Invalidate Caches / Restart
, then clickInvalidate and Restart
in the dialog box, clearcache
and restart.
Others (sense, thoughts, etc.)
This experiment is mainly to learn the preliminary application of Android Studio and some of the above tests. But it’s still a bit difficult. And my computer is a bit outdated, running APP is too stuck, making me feel irritable.
Reference Materials
-
“Java Programming and Data Structure Tutorial (Second Edition)”
-
“Java Programming and Data Structure Tutorial (Second Edition)” learning guide