XCLUB-COOL STUFF AROUND YOU

 找回密码
 Register
查看: 682|回复: 0
打印 上一主题 下一主题

Android Developer Options

[复制链接]

592

主题

6130

帖子

9032

积分

Sapphire Star LV19

manager

2019super moderatorXclub KolPrimary beta testersign star1sign star2sign star3post star1post star2post star3X'Club badge exclusive for India

跳转到指定楼层
#1
发表于 2018-04-14 13:38:04 来自手机 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
[h1 itemprop="headline" style="text-align: center;"][a href="https://stablekernel.com/how-to-use-android-developer-options-like-a-pro/" rel="bookmark" title="Permanent Link: How To Use Android Developer Options Like A Pro"]How To Use Android Developer Options Like A Pro[/a][/h1][p]As a software developer, it is very easy to become so engrossed in mastering every nuance of a framework that we often tend to forget just how important it is to understand the subtleties of the hardware we deploy to. This is particularly true for Android developers, where device fragmentation poses the challenge of developing and deploying to a cavalcade of thousands of different devices.[span id="more-2621"][/span]A developer who knows how to employ device Developer Options can alleviate much consternation in the development process. Unfortunately, many Android developers only use the Developer Options when they enable USB Debugging and disregard the treasure trove of tools available to them. So, let’s explore a few of my favorite Android Developer Options.

[h2]WAKE UP SLEEPY HEAD[/h2][p]Enabling the Stay Awake Developer Options prevents the screen from dimming when it is plugged into a USB port. Having to constantly wake up the device during development can become pesky, so this is a good option to enable to maintain your sanity.

[h2]RESPECT THE PROCESS[/h2][p]The Process Stats Developer Option can reveal whether or not your app is a memory glutton. If you are developing a project that implements background services such as geocoding, it is highly recommended to use this option as a standard practice in your development process.[br]

[h2]EXPECT THE UNEXPECTED[/h2][p]My favorite Developer Option is enabling Do Not Keep Activities. This option removes activities from the backstack as soon as a user leaves it; this is invaluable because it compels developers to ensure their code can handle occurrences such as removing an activity due to low memory. Oftentimes, this reveals a bug as minuscule as forgetting to implement onSaveInstanceState or something more sinister such as poor app architecture. In my experience, I have found it beneficial to have this Developer Option enabled at all times. It is also good practice to occasionally use the Limit Background Processes Developer Option to set the background process limit low or disable them altogether. Debugging an application without allowing background processes usually reveals critical flaws as well.

[h2]CULTIVATE AN EYE FOR UI[/h2][p]Rectifying layout issues can be tricky. However, by enabling the Show Layout Boundaries Developer Option, the boundaries for the views in your layouts will be highlighted to serve as a visual indicator. This is very useful when programmatically setting view dimensions for different screen densities.

[p style="text-align: center;"] [br]

[p]Layout waste can be reduced by enabling Debug GPU Overdraw Developer Option. This will identify all the areas where the app is asking the device to draw a UI element on top of another UI element with a red overlay. Depending on the complexity of a view, overdraw can sometimes be impossible to avoid, but it is nice to be able to identify opportunities to use layout resources more efficiently.[br]

[p]The Show Touches and Show Pointer Location Developer Options are also very helpful as they provide visual feedback and cues when a user interacts with a UI element in your app.

[p]Arguably the coolest Android Developer Option is the Simulate Secondary Displays. This option essentially allows you visualize how your app will look on a device with another screen size via an overlay.

[p style="text-align: center;"] [br]

[p style="text-align: center;"][br]

[h2]STAY IN YOUR LANE[/h2][p]Enabling the Strict Mode Enabled Developer Option prevents the main thread from being abused by long, resource-intensive processes. This is an option that I recommend always be enabled, especially if your application makes several web requests. The Show CPU Usage Developer Options is also useful as it overlays a logcat detailing CPU usage in the upper-right corner of your device.

[p]Much like the Show CPU Usage Developer Option, the Profile GPU Rendering provides immediate visual feedback on how hard the GPU is working to present a particular layout. This is a good tool to use in scenarios when you are trying to determine how taxing complex layouts and animations are on older devices.[br]

[p][br]

回复

使用道具 举报

高级模式
B Color Link Quote Code Smilies |上传

本版积分规则

Infinix Official Website|Infinix official mall|infinix Note 4|XCLUB-COOL STUFF AROUND YOU

GMT+8, 2025-01-27 11:14 , Processed in 0.034609 second(s), 23 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表