Android Technology Exploration and Practice: All-round Exploration from New Function Experience to Troubleshooting

 

 

Table of contents

Android Technology Exploration and Practice: All-round Exploration from New Function Experience to Troubleshooting  

 Chapter 1: Technical Analysis

·The architecture and working principle of Android platform

·The life cycle and interaction mode of application components

·Analysis of design patterns and technical frameworks commonly used in Android development

Chapter 2: Product New Function Experience Evaluation

 Get an in-depth look at the latest Android release, and experience and evaluate its new features:

Analyze the impact of new features on user experience and developers, and make suggestions and improvements:

Chapter 3: Troubleshooting 

Common Android application failures and troubleshooting methods:

Share the experience and lessons of fault debugging: proficient in using various debugging tools,

Chapter 4: Test comparison 

Comparison and evaluation of different testing methods and tools:

Analyze test results and feedback, and propose test optimization suggestions:

Chapter Five: Experience in Use 

From the user's point of view,

Explore methods for UI design and UX optimization:

 Share personal skills and experience in using Android applications:

Chapter Six: Development and Use Skills 

Share practical tips and tool recommendations in the Android development process:

In-depth understanding of performance optimization and memory management methods and techniques:

Explore development and debugging skills and practices to improve development efficiency:

Chapter 7: Popular Science Application 

Introduce some interesting Android applications and technology application scenarios:

Analyze the design and implementation ideas of popular science applications:

Readers are encouraged to try to develop their own popular science applications, and relevant resources and guidance are provided:

epilogue


Android Technology Exploration and Practice: All-round Exploration from New Function Experience to Troubleshooting  

Abstract: The article deeply explores all aspects of the Android platform, including technical analysis, product new function experience evaluation, fault debugging, test comparison, experience, development and use skills, and popular science applications. Through the all-round exploration of Android, readers will be able to understand and apply Android technology more deeply, and improve development efficiency and user experience.

 Chapter 1: Technical Analysis

·The architecture and working principle of Android platform

The Android system is divided into five layers: the Linux kernel layer, the hardware abstraction layer, the runtime library layer, the application framework layer, and the application layer. The Linux kernel layer provides hardware driver access interface and process management. The hardware abstraction layer hides hardware differences inside and provides a unified interface for the upper layer. The runtime library layer includes WebKit, FreeType, OpenGL, etc., providing web pages, images, and 3D rendering capabilities.

The application framework layer includes Activity Manager, Package Manager, Telephony Manager, etc., and manages application views, resources, and telephone services. The application layer runs various applications. This layered architecture allows each part to work with high cohesion and low coupling. The upper layer accesses the lower layer services through the interface, and the lower layer only develops for the interface.

Linux kernel layer: Provides hardware abstraction interface and process/thread management. It is based on the Linux kernel, and has been cut and modified. Hardware abstraction layer: hide the differences of different hardware inside, and provide a unified interface for the upper layer. It consists of multiple libraries, one for each type of hardware.

Runtime library layer: Provides WebKit, OpenGL, FreeType, etc. for web pages, images, and 3D rendering. Implemented in C/C++, but callable in Java.

Application framework layer: Provide Activity Manager, Package Manager, Telephony Manager, etc. to manage application life cycle, resources, telephone services, etc. Developers mainly use Java to develop and call these frameworks. Application layer: run various applications, such as Contacts, Browser, Settings, etc.

·The life cycle and interaction mode of application components

Activity, Service, Broadcast Receiver, and Content Provider are the four major components of Android.

Activity interacts with the user and has a life cycle callback method. Service runs in the background and has no interface components. Broadcast Receiver receives and responds to broadcasts. Content Provider manages application data. Components interact using Intents. Intent specifies behavior and data, and is matched to the corresponding component by Intent Filter. Proficiency in component life cycle and interaction is the foundation of Android development.

Activity: Interact with the user, rewrite the life cycle method to monitor the state change. Service: Runs in the background to perform long-term operations. Has lifecycle methods but no interface. Broadcast Receiver: Receive and respond to broadcasts, no lifecycle method. Content Provider: Manage application data, accessed through ContentResolver. Components interact using Intents. Intent specifies the action to be performed and the data to be operated, and the matching component is found through the Intent Filter to execute the request.

·Analysis of design patterns and technical frameworks commonly used in Android development

Activity: Interact with the user, rewrite the life cycle method to monitor the state change. Service: Runs in the background to perform long-term operations. Has lifecycle methods but no interface. Broadcast Receiver: Receive and respond to broadcasts, no lifecycle method. Content Provider: Manage application data, accessed through ContentResolver. Components interact using Intents. Intent specifies the action to be performed and the data to be operated, and the matching component is found through the Intent Filter to execute the request.

Chapter 2: Product New Function Experience Evaluation

 Get an in-depth look at the latest Android release, and experience and evaluate its new features:

Android 10: This is the latest Android version released. It brings brand new gesture navigation and full screen gestures. Gesture operation replaces virtual buttons, and the fluency is improved by sliding inward/outward to return/switch applications. However, the initial use is unavoidably unfamiliar and requires a short period of adaptation. Gestures make operations feel like touching the screen directly, bringing a high sense of immersion. Project Mainline enables some modules to be updated through the Play Store, making it faster to fix bugs, make applications more compatible, and make development easier. Added reporting requirements for use of touchscreen and location to enhance data control and privacy. Real-time subtitles and smart replies support more scenarios. Android 9 Pie: It focuses on artificial intelligence and battery optimization. App Actions predicts the next action by learning user habits; Slices displays richer application information in search results. These features leverage machine learning to improve user experience. Save power by limiting the running time of background processes and reducing CPU wake-ups. New functions such as displaying the specific power available time allow users to be more aware of power consumption. Group notifications to make users more focused. The quick setting is redesigned, and the frequently used functions are closer at hand.

Analyze the impact of new features on user experience and developers, and make suggestions and improvements:

The new gesture operation brings a differentiated experience, Project Mainline is updated faster to fix bugs, and the enhanced control makes users feel more at ease and improves user experience. Developer applications are easier to be compatible, and the difficulty of development is reduced. But the gesture operation needs to be adapted initially, and the developer also needs to update the application. AI features leverage machine learning to improve user experience. But the experience degrades when the prediction is inaccurate. Battery optimization improves battery life but may affect push results. This requires the joint efforts of users and developers to continuously improve and perfect. Restricting background processes improves battery life but will affect real-time performance, and setting changes will bring re-adaptation. Notification grouping makes information more focused but some information may be missed. This requires developers to take a more refined trade-off, taking into account user needs and system constraints. To sum up, the new experience brought by new functions requires a certain period of adaptation. But the smoothness and convenience that come with it make people fall in love at first sight. Artificial intelligence surprises users but also progresses through misjudgments. System optimization makes the battery last longer and the application becomes more stable, but it also faces problems that affect practicality. All of this requires the joint efforts of users and developers to improve the product and make progress together through continuous use and updates.

Chapter 3: Troubleshooting 

Common Android application failures and troubleshooting methods:

Application crash: read the crash log through adb logcat, find the stack information to locate the cause of the problem. Common reasons are null pointer, array out of bounds, etc. Abnormal layout: Use Hierarchy Viewer to check the layout, locate display problem components, and fix layout bugs. Network request failure: Check the network status, domain name resolution, test the request through tools such as Chrome Postman, and verify the interface and parameters. Application stuttering: Check methods that take too long to execute through Traceview and Systrace to find the cause of inefficiency or ANR.

Use debugging tools and tips to solve common problems: turn on debug mode, set breakpoints to debug and inspect variables, and locate logic problems. Use the adb tool to obtain screenshots, logs, check device parameters, etc., to assist in locating and reproducing bugs. Output detailed logs, and record call stack and exception information when problems occur. Set the log level to Debug to output more detailed logs. Enable Proguard confusion when building with gradle, and remove the Release version for easy debugging. Use the Hierarchy Viewer to preview and analyze the layout, check the nesting depth, and locate and display abnormal components. It can render layouts on different devices. Use Traceview and Systrace to analyze application execution time and ANR problems to find the cause of low efficiency. Use the Device Mode of Chrome Developer Tools to debug and test WebView applications.

Share the experience and lessons of fault debugging: proficient in using various debugging tools,

Such as logs, breakpoints, adb, Hierarchy View, etc. This can greatly improve the efficiency of locating and fixing problems. In the development stage, it is necessary to develop the habit of testing and log output. This can maximize the discovery and resolution of problems and reduce the possibility of bugs after going online. Use corresponding tools for different problems. Use Hierarchy Viewer for layout exceptions, Traceview and Systrace for ANR, and debug mode for logic bugs. Don't give up easily when you encounter problems. Analyze problems and phenomena, and further determine and narrow the scope of problems by querying information and trying various methods. Sometimes the solution to a problem requires a combination of various means and conditions.

Chapter 4: Test comparison 

Comparison and evaluation of different testing methods and tools:

Unit testing: Test methods and classes through frameworks such as JUnit to ensure code quality. Lightweight, written by developers, high coverage, lack of UI tests. Functional testing: also known as black box testing, which verifies software functions by designing test cases. Compiled by testers, it is more comprehensive, lacks a technical perspective, and is more time-consuming. Stress testing: Check the stability and performance of the software under high load. Use tools to generate a large number of requests, and quantitative indicators to measure software performance, with narrow but targeted coverage. beta/grayscale release: Release the version to some users for testing and obtain actual feedback. It covers a wide range of real scenarios, but lacks pertinence and is difficult to quantify.

Introducing best practices for automated testing and UI testing:

Automated testing is performed by writing scripts to operate software, which can be executed automatically without human intervention. It can be used for functional testing, performance testing, security testing, etc. to improve testing efficiency. UI testing is performed by writing scripts to simulate the user interface. Usually, tools such as Espresso, UiAutomator, etc. can be used to test the fluency of various user interactions to find interface bugs. Best practice: Integrate automated testing, such as unit testing, during the development phase. Find problems in time and reduce the amount of regression testing in the later stage. Write functional test scripts for automation of complex business flows. Ensure the quality of core processes. Through the UI test script, test various interface interactions and operation fluency. Check whether the display of the interface is correct. Before the beta version/grayscale release, use automated tools for performance, security, and compatibility testing. Release a more stable version. Test teams can write more comprehensive test plans and scenarios. Developers also need to write unit tests and conduct local tests to find bugs as much as possible.

Analyze test results and feedback, and propose test optimization suggestions:

Through the test report and error statistics, the type and frequency of the problem are analyzed, software defects are found, and improvement countermeasures are proposed. Compatibility of software in different countries and devices requires targeted testing and repair. The actual feedback from users is the most authentic. Continuously improve and fix problems through user feedback to improve the software. Due to time and cost constraints, it is impossible to automate all scenarios. It is necessary to manually create specific test cases and data for real operation testing. Developers must also test the code they write, not just rely on the test report of the test team. Only by solving the problem in the code writing stage can the cost of subsequent regression testing be reduced. In summary, the testing work requires the cooperation of the development team and the testing team. Only when multiple testing methods are used together can the software quality be fully guaranteed.

Chapter Five: Experience in Use 

From the user's point of view,

Share the experience and experience of using Android applications: Fluency: Whether the application opening and interface switching are smooth, there is no obvious lagging phenomenon, and whether the response is fast. This profoundly affects user experience. Ease of use: Whether the interface layout is clear and easy to understand, whether the functions are easy to find and use, and whether it takes too long to adapt and learn. This determines the user's sense of gain and stickiness. Complete functions: Whether it meets the functional expectations of this type of application, whether it provides richer functions that can better meet user needs, and whether the new functions keep up with industry development and user needs. Privacy and security: Whether the application collects too much privacy-related data information, whether there are safeguards and usage restrictions for this information, and whether the application itself has certain security mechanisms and protection measures. Experience coherence: Whether the applications developed by the same development team maintain coherence and unity in interface style, interaction mode, and functional structure, so that users have a consistent sense of experience and expectations.  

Explore methods for UI design and UX optimization:

Refer to the interface style and interaction methods of excellent products and applications in the industry. Use common interface components and design guidelines. The hierarchy is clear, and the important functions are eye-catching and prominent. Guide users to focus through fonts, colors, and spaces. Reduce the number of interface elements to avoid the interface from being too complicated and cumbersome. adopting a minimalistic style. Provide clear and intuitive feedback and prompts. Such as the loading prompt after the operation, the error description after the error, etc. Increase human expression. Use certain exclamation marks, Transitioning and other expressions on the display text to give emotions to the interface. Use common gestures and operating habits. Such as left swipe to delete, pull down to refresh, etc., let users feel familiar. Add detailed design, such as Gaussian blur glass effect, subtle animation transitions, etc. Improve product texture.

 Share personal skills and experience in using Android applications:

Master the core functions and usage skills of various applications to obtain the best user experience. Such as switching Do Not Disturb mode to improve concentration, setting sleep time to manage biological clock, etc. Customize application notifications, close unnecessary ones, adjust the method and quantity of necessary notifications, and avoid interference caused by too many notifications. Enhance system functions through third-party applications. For example, obtain rich weather and schedule information through Weather and Calendar applications; enhance picture management and editing functions through Gallery, etc. Close background processes and unnecessary services to improve power and operating efficiency. Disable live wallpapers, turn off Bluetooth and Wi-Fi, etc. when not in use. Organize app icons using folders or third-party apps to keep your desktop tidy. Find apps faster with search. Regularly clean up the app cache, delete useless apps and files, and keep the phone's storage space sufficient.   

Chapter Six: Development and Use Skills 

Share practical tips and tool recommendations in the Android development process:

Use Android Studio, master Layout Editor, code templates, shortcut keys, etc. to improve development efficiency. Use Gradle to build applications, and automatically download the required dependent libraries through dependency management. Use Git for version control. Code management platforms such as Github and Bitbucket are recommended. Install visual tools for LayoutUse tools like Sketch or Figma for UI/UX design. Use Gson, protobuf and other serialization libraries to convert object data and strings. Simplify web development with frameworks such as Retrofit and OkHttp. Use RxJava, LiveData and other libraries for asynchronous and responsive programming. Use leakcanary to detect memory leaks. STRICT MODE detects time-consuming operations performed in the UI thread. Use Timber to simplify log output and facilitate Locate problems. Master ADB, Hierarchy Viewer and other debugging tools.

In-depth understanding of performance optimization and memory management methods and techniques:

Try to perform time-consuming operations in sub-threads to avoid ANR. Use efficient data structures and algorithms to avoid creating objects in loops or frequently called code. Avoid excessive use of Context objects, use ApplicationContext instead. Use SoftReference or WeakReference to free memory resources that are no longer used. Actively call recycle() to release Bitmap and other resources that occupy a large amount of memory. Optimize the onDraw() method of the custom View and the frequency of calling the invalidate() method. Use Android analysis tools Systrace, Instrument, Perfetto, etc. to analyze memory usage and frame rate, and find optimization points.

Explore development and debugging skills and practices to improve development efficiency:

Proficiency in using Step Over, Step In, Step Out and other debugging methods. Use breakpoints to track changes in variable values ​​and the sequence in which methods are called. Output detailed log information, including Tag, method call trace, exception details and other information to quickly locate problems. Check XML files and Java code for potential problems with lint. Invoke the top command in the adb shell to monitor the application memory usage. Use dumpsys to check application information. Use hot update to update application resources and codes, reducing the number of times to reinstall applications. Quickly generate repetitive code using templates and code blocks.

Chapter 7: Popular Science Application 

Introduce some interesting Android applications and technology application scenarios:

AR allows users to see on the device screen how virtual objects will look composited in their real environment. Such as the general meeting of shareholders, the virtual human effect in the fitting room. Camera and image recognition technology are required. VR immerses users in virtual scenes through head-mounted display devices. Such as roller coaster simulation roller coaster experience, can be used for education, games, medical treatment and so on. Requires high-performance computing and visual rendering. Artificial intelligence is widely used in image recognition, speech recognition, intelligent reply, machine translation and other fields. This requires the support of big data and neural network algorithms. Blockchain technology improves data immutability and security through decentralized bookkeeping. There are applications in payment, medical, supply chain management and other fields. Encryption algorithm and P2P network are required. Robotics enables machines to be manipulated and learn. It can be used in various industries such as engineering, agriculture, consumption, and service. Various sensors, actuators and control algorithms are required.

Analyze the design and implementation ideas of popular science applications:

Pick the right technology (AR/VR/AI/Blockchain/Robotics). Select based on the conditions of hardware devices and development tools and the effect to be achieved. Determine application scenarios and specific functional goals. This requires full research and analysis of the industry and user needs. Goals need to be specific and actionable. Conceive innovative points, such applications will make users feel novelty and interest. But innovation should also be based on science and technology, and avoid being too unrealistic. Select the development language (Java/C++/Python) and related technical framework. Such as OpenCV, TensorFlow, RealSense SDK, etc. If hardware is involved, it is necessary to select suitable sensing devices, actuators, etc. And write device drivers and calibration algorithms. Conceive a good interface and interaction design. This is an important part of user experience. It should be concise and intuitive, echoing the technical effect. Test and debug, find problems to fix and optimize. It will be more effective to take a more realistic usage scenario for testing.   

Readers are encouraged to try to develop their own popular science applications, and relevant resources and guidance are provided:

Choose the technical direction and application scenarios you are interested in for learning and development. Get started with a variety of online learning resources and tutorials. Proficiency in relevant development languages, frameworks and tools. This requires a lot of coding practice and project practice. If you encounter problems during the development process, consult the official documents and various community questions and answers in time to solve them. Improve your ability to solve problems. Communicate with other developers to discuss technical details and implementation methods. This allows for a more comprehensive understanding of related technologies, as well as different ideas and implementation solutions. Try to choose open source libraries, examples and engineering references. This can save a lot of development time and learn excellent technical implementations. Learn and absorb concepts and methods by referring to excellent designs and products. Cultivate your own design thinking and aesthetic ability. After realizing a certain key technology or function, summarize and share the experience. This can test your own understanding and help others learn. Encourage you to challenge yourself and try to learn and practice in the field of science and technology. I will provide you with technical information, answer questions, and share relevant knowledge and experience. Let's make progress together

epilogue

With the launch of the new version of Android, the system is continuously optimized and innovated, bringing many new functions that are convenient for developers and users. Starting with Android 10, Google has introduced new navigation gestures and full-screen gestures. Compared with the previous virtual buttons, full-screen gestures bring a smoother user experience. By sliding in or out, you can easily return or switch applications, or call out the list of recent tasks without long pressing the virtual button. The launcher that comes with the system has also been revised, based on full-screen gesture optimization, making the desktop more concise. In terms of application compatibility, Android 10 actively launched the "Project Mainline" plan, which aims to separate some key modules into independent APKs, which can be distributed and updated through the Play Store without waiting for the official system OTA, so that security vulnerabilities and security vulnerabilities can be fixed faster. bugs, improve application compatibility, and reduce the difficulty of application development. Compared with the previous Android system, Android 10 has also made major adjustments in terms of security and privacy. For example, the reporting requirements for touch screen and location are added, and developers are required to explain the reasons for using these modules; a switch is added to control background location access; Wi-Fi and Bluetooth scanning functions are turned off by default. These adjustments will undoubtedly make the user's private information more secure. From the above three aspects, we can see that Android 10 has greatly improved its functions, compatibility and security, which makes the latest version of Android bring better experience to developers and users. Of course, the upgrade speed of Android also makes it impossible for many users to update the system in time and enjoy the latest functions and security fixes. This is also one of the problems that Google needs to work hard to solve. Overall, the rapid iteration of Android brings vitality to the mobile ecosystem and provides convenience to users and developers. But it is also necessary to balance the update experience of different users to ensure that all users can use the latest and most secure functions. Whether Android can strike a balance between functional innovation and popularity will be a huge challenge it faces.

Through the comprehensive exploration and practice of the article, I hope that everyone can better understand and apply Android technology, and improve their technical level and development efficiency. At the same time, you can better experience and use Android applications, and explore innovations and applications in your own field. The continuous development and innovation of the Android platform has brought us infinite possibilities, let us embark on the journey of Android technology together!

Guess you like

Origin blog.csdn.net/weixin_68829137/article/details/130620630