android权威编程指南_Android开发人员最常见的10大错误:编程指南

android权威编程指南

Android is the other popular platform after iOS. The main advantage of it is numerous free to use apps. Android is a rapidly growing platform available for smartphones, tablets, smartwatch. Despite the new updates and implemented improvements to the Lollipop Android version, some apps published in Google Play occurred the number of bugs and errors. Here in this article, we will learn more in-depth into the list of common pests that appeared from the updates and possible solutions to omit it in the future.

Android是继iOS之后的另一个流行平台。 它的主要优点是可以免费使用许多应用程序。 Android是一个快速增长的平台,可用于智能手机,平板电脑和智能手表。 尽管对Lollipop Android版本进行了新的更新并进行了改进,但在Google Play上发布的某些应用还是发生了许多错误和错误。 在本文的这篇文章中,我们将更深入地了解更新中出现的常见害虫列表以及将来可以省略的常见解决方案。

#1 Android Studio iOS应用 (#1 Android Studio iOS app)

Android programming has its specific rules, and it differs a lot from iOS. Unfortunately, it’s happened to notice that some Android apps are just iOS clones. Android programming differs from iOS a lot, starting from the UX. Nevertheless, it’s happened to meet the next inappropriate to Android mistakes.

Android编程有其特定的规则,与iOS有很大不同。 不幸的是,偶然发现一些Android应用仅仅是iOS的克隆。 从UX开始,Android编程与iOS有很多不同。 尽管如此,碰巧遇到了下一个不适用于Android错误的错误。

  • Try not to make static tabs.

    尽量不要制作静态标签

  • System notifications should be transparent.

    系统通知应透明。

  • Application symbols should not be put inside an adjusted square shape

    请勿将应用符号放在经过调整的正方形内

  • Don’t use a splash screen in other scenarios except for the introduction

    除介绍外,请勿在其他情况下使用启动画面

These samples show only a few things related, which ruin the user experience. Google for Android dev shares the main requirements towards the Android app development. Follow them accurately.

这些示例仅显示了一些相关的内容,这些内容破坏了用户体验。 Google for Android开发人员对Android 应用程序开发具有主要要求。 准确地跟随他们。

Image for post

#2:适用于各种设备的Android编程 (#2: Android programming for various devices)

How to ensure the one app will be a good look on every Android device? While developing a delivery app for tablets and smartphones, consider different screen resolutions. To replace physical devices, use Android Emulator.

如何确保一个应用在每台Android设备上都具有良好的外观? 在为平板电脑和智能手机开发交付应用程序时,请考虑不同的屏幕分辨率。 要替换物理设备,请使用Android Emulator

Image for post

#3:忽略意图 (#3: Omitting Intents)

Using Android Intents is the core component for Android SDKs as it helps to pass data between different apps in the system. For example, you share access link to the gallery via SMS, then your option for Android programming will be the next:

使用Android Intents是Android SDK的核心组件,因为它有助于在系统中不同应用之间传递数据。 例如,您通过短信共享对图库的访问链接,那么下一个用于Android编程的选项将是下一个:

Image for post

#4:省略片段 (#4: Omitting Fragments)

Fragments are helpful when optimizing applications for different screens. It can be combined and positioned as needed on your Android developer account. Fragments are needed to keep all elements loaded well, prevent memory over-usage.

在针对不同屏幕优化应用程序时,片段很有用。 可以根据需要将其组合并放置在您的Android开发者帐户中。 需要使用片段来保持所有元素加载良好,防止内存过度使用。

#5:阻塞主线程 (#5: Blocking the Main Thread)

Image for post

The main thread is responsible for making the app work smoothly and control the speed of app performance. The human eye won’t percept well everything, which is 24 fps with delay greater than 100 ms won’t be perceived as smooth. In the later Android 2.x version, the system refused to make network calls in the main thread.

主线程负责使应用程序平稳运行并控制应用程序性能的速度。 人眼无法感知所有内容,延迟为100毫秒以上的24 fps不会被认为是平滑的。 在更高的Android 2.x版本中,系统拒绝在主线程中进行网络调用。

To omit to block the main thread, utility worker/background threads for bitmap loading, network calls, database querying, image processing, SD reading/writing.

为了避免阻塞主线程,请使用实用程序工作者/后台线程进行位图加载,网络调用,数据库查询,图像处理,SD读/写。

#6:无视以往的经验 (#6: Ignoring the previous experience)

Some basic things in the Android app development were already written, so you can use the previous experience to your app. Don’t reinvent the wheel with the new solution, especially when previous Android dev shared the source code to the open-source GitHub library. Browse over the possible ready samples in Google for developers.

Android应用程序开发中的一些基本知识已经编写完毕,因此您可以将以前的经验用于您的应用程序。 不要用新的解决方案来改造轮子,特别是当以前的Android开发人员将源代码共享到开源GitHub库时。 浏览开发者在Google中可能准备好的示例。

#7:没有成功 (#7: Not Assuming Success)

Despite the 100% clear structure and working libraries, some apps might not fit the users’ psychology. You are creating the app for the human needs at first, and have to consider the user experience when using it. Create a focus group, ask to share feedback, check their comments, assume the final thoughts. Your target audience will point out the main issues that invisible for Android dev.

尽管结构和工作库100%清晰,但是某些应用程序可能不符合用户的心理。 首先,您是在为满足人类需求而创建应用程序,并且在使用时必须考虑用户体验。 创建一个焦点小组,要求分享反馈,检查他们的评论,假设最终想法。 您的目标受众将指出Android开发人员看不见的主要问题。

Image for post

#8:位图使用不佳 (#8: The poor usage of Bitmaps)

Bitmaps loads images to memory before showing it on the screen. People get used to seeing wide and colorful images on their smartphones and tablets. In order to follow the proper image load, make sure you display bitmaps efficiently in Android developer account:

位图将图像加载到内存中,然后再显示在屏幕上。 人们习惯于在智能手机和平板电脑上看到宽阔的彩色图像。 为了遵循适当的图像加载,请确保您在Android开发人员帐户中有效显示位图

  1. Scale the image

    缩放图像

  2. Show what should be displayed

    显示应显示的内容

#9:使用深度视图层次结构 (#9: Using Deep View Hierarchy)

deep view hierarchy

To draw content in Android developer account, you need to parse XML, measure screens, and place all elements in the proper order. This process takes much time and needs to be optimized. Each widget and layout you do requires much time. Using LinearLayout may lea to the deep view hierarchy. This is especially critical when the layout is inflated frequently, such as when used in a ListView or GridView.

要在Android开发人员帐户中绘制内容,您需要解析XML,测量屏幕并将所有元素以正确的顺序放置。 此过程需要很多时间,需要进行优化。 您所做的每个小部件和布局都需要很多时间。 使用LinearLayout可能会进入深度视图层次结构。 当布局经常膨胀时,例如在ListView或GridView中使用时,这尤其重要。

#10:不将minSdkVersion更新为14 (#10: Not updating minSdkVersion to 14)

It is mostly a bad practice than a mistake. Supporting the old version too long without updates might lead to more complexity in the code. The developers shouldn’t stay behind the updates to make sure the app will support the latest features. Ally the recent updates in your Android developer account to ensure system will perform well.

这主要是一种错误的做法,而不是错误的做法。 在没有更新的情况下长时间支持旧版本可能会导致代码更加复杂。 开发人员不应紧跟更新,以确保该应用程序将支持最新功能。 在您的Android开发者帐户中结盟最近的更新,以确保系统运行良好。

update android

结论 (In conclusion)

Android is a widely popular OS. In some locations, it gathers even more users than iOS. Follow the given recommendations to make sure your users will get the 100% working app with a clear UI.

Android是一种广泛流行的操作系统。 在某些地区,它收集的用户甚至超过了iOS。 请遵循给定的建议,以确保您的用户将获得具有清晰UI的100%可正常运行的应用程序。

不要犹豫提出问题 。 我们准备为您提供帮助。 (Don’t hesitate to ask questions. We are ready to help you.)

翻译自: https://medium.com/swlh/top-10-most-common-mistakes-that-android-developers-make-a-programming-tutorial-7ce6415a7d15

android权威编程指南

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值