• Android-中 Dicoding Academy-Menjadi Android开发人员专家
  • android应用开发Android development is all the hype these days as it continues to dominate the world of mobile development. Fun projects, great pay, and tons of job prospects are just some of the ...


    Android development is all the hype these days as it continues to dominate the world of mobile development. Fun projects, great pay, and tons of job prospects are just some of the reasons developers are starting their journeys into the exciting world of the Android operating system. Some experts say that there has never been a better time to learn Android skills, especially since the recent updates, like the addition of Kotlin and improvements to Google’s policies.

    这些天来, Android开发一直是炒作,因为它继续主导着移动开发领域。 有趣的项目,丰厚的薪水和大量的工作前景只是开发人员开始踏入令人兴奋的Android操作系统世界的部分原因。 一些专家说,从来没有比现在更好的时间来学习Android技能,尤其是自从最近的更新以来,例如增加了Kotlin并改进了Google的政策。

    If you’ve been thinking about starting your Android journey or you’re just curious about what Android has to offer, you’re in the right place! Today we will walk you through all the basics of Android development and even show you how to build your own functioning application.

    如果您一直在考虑开始Android之旅,或者只是对Android提供的功能感到好奇,那么您来对地方了! 今天,我们将向您介绍Android开发的所有基础知识,甚至向您展示如何构建自己的功能应用程序。

    Here’s what we’ll cover today:


    • What is Android

    • Android development tools

    • How to develop an Android app

    • Resources for Android app development


    什么是Android? (What is Android?)

    Image for post

    Android is one of my world’s most popular operating systems for everything from 5G mobile devices to mobile apps to touchscreen smartphones and tablets. This open-source, Linux-based software is used by Google to power over 2.5 billion devices worldwide, accounting for over 80% of smartphone sales.

    Android是我世界上最受欢迎的操作系统之一,从5G移动设备到移动应用到触摸屏智能手机和平板电脑,应有尽有。 Google使用这种基于Linux的开源软件为全球超过25亿台设备供电,占智能手机销售额的80%以上。

    Android is based on the Linux kernel, which means that the basic operating structure is portable, multi-user, and able to handle complex multitasking. One of the biggest advantages of Android is the freedom of choice that comes with the technology. Not only is the hardware more diverse, but the software is very flexible and customizable.

    Android基于Linux内核,这意味着基本的操作结构是可移植的,多用户的,并且能够处理复杂的多任务处理。 Android的最大优势之一是该技术带来的选择自由。 不仅硬件更加多样化,而且软件也非常灵活和可定制。

    The market for Android development is growing as more and more manufacturers, including Samsung, Lenovo, HTC, and LG, turn to Android to power their products. This means that there’s a huge demand for Android developers worldwide in diverse industries and companies! On top of that, the new Google Play Store policies are the app development market much more lucrative. Learning Android skills will open doors and make you a desirable developer across the board.

    随着越来越多的制造商(包括三星,联想,HTC和LG)转向使用Android驱动其产品,Android开发市场正在增长。 这意味着全球各行各业的Android开发人员都有巨大的需求! 最重要的是,新的Google Play商店政策使应用程序开发市场更加有利可图。 学习Android技能将为您打开大门,使您成为全面的理想开发人员。

    Android开发工具 (Android development tools)

    Getting started as an Android developer is easier than you might think; you’ll need to master some basic skills and tools, such as:

    作为Android开发人员入门比您想象的要容易。 您需要掌握一些基本技能和工具,例如:

    • Programming language skills (Java, Kotlin, and Groovy)

    • XML

    • Android build system

    • Android Studio IDE

      Android Studio IDE

    编程语言技能 (Programming Language Skills)

    Image for post

    There are three programming languages and one markup language used in Android development.


    Java is the official language for Android development and one of the most popular programming languages in the world. Java classes run on Android Runtime (ART), a specialized virtual machine. Take a look at this example from the Android MainActivity.java file.

    Java是Android开发的官方语言,也是世界上最受欢迎的编程语言之一。 Java类在专用的虚拟机Android Runtime(ART)上运行。 在Android MainActivity.java文件中查看此示例。

    Image for post

    Kotlin has been the second official language for Android development since 2017. Known for being much more concise and expressive, Kotlin helps alleviate some of Java’s drawbacks. Here’s an example of the above code in Kotlin so you can compare.

    自2017年以来, Kotlin已成为Android开发的第二种官方语言。Kotlin以更加简洁和富于表现力而闻名,有助于缓解Java的某些弊端。 这是Kotlin中上述代码的示例,因此您可以进行比较。

    Image for post

    If you want to learn more about Kotlin, take a look at our article here to catch up on the basics.


    XML, a markup language, is commonly used in Android development to declare a layout for user interface (UI), dimensions, and strings. Take a look at this example of a layout that shows text in the middle of the user’s screen.

    XML是一种标记语言,在Android开发中通常用于声明用户界面(UI),尺寸和字符串的布局。 看一下此示例布局,该布局在用户屏幕中间显示文本。

    Image for post

    Android构建系统 (Android Build System)

    Gradle powers the Android build automation system and expands upon the concepts of Apache Maven and Apache Ant by introducing a Groovy-based, domain-specific language. Groovy is an optionally typed, dynamic language with static-typing capabilities. It helps improve productivity and speed by integrating with your Java-based program. With Groovy’s ease and Gradle’s mature ecosystem, you can automate your software and deliver much faster builds.

    Gradle支持Android构建自动化系统,并通过引入基于Groovy的特定领域语言扩展了Apache Maven和Apache Ant的概念。 Groovy是一种可选类型的动态语言,具有静态键入功能。 通过与基于Java的程序集成,它有助于提高生产率和速度。 借助Groovy的便捷性和Gradle的成熟生态系统,您可以使软件自动化并提供更快的构建。

    Android Studio IDE (Android Studio IDE)

    The Android Studio IDE is your new best friend for Android development. Based on IntelliJ IDEA, it’s the official development environment for Google’s operating system. It comes with great Android-specific tooling to cover all your needs. Using this IDE will accelerate your development time, and frequent updates mean you’ll never fall behind. It comes loaded with the following features, amongst many others:

    Android Studio IDE是您进行Android开发的新最好朋友。 它基于IntelliJ IDEA,是Google操作系统的官方开发环境。 它带有出色的Android专用工具,可以满足您的所有需求。 使用此IDE将缩短您的开发时间,并且频繁的更新意味着您永远不会落后。 它具有以下功能,以及许多其他功能:

    • Realtime profilers and analyzer

    • Flexible build system

    • Intelligent code editor

    • Visual layout editor

    • Fast emulator


    Android SDK (Android SDK)

    The Android SDK is the official development kit for Android app development. It is composed of modular packages that can be separately downloaded from the Android SDK Manager, including SDK tool, Google API, Android support, Android Debug Bridge (ADB), and more. Just like the IDE, the Android SDK is always being updated. New releases will keep you up to date with the latest features.

    Android SDK是用于Android应用程序开发的官方开发工具包。 它由可从Android SDK管理器单独下载的模块化程序包组成,包括SDK工具,Google API,Android支持,Android调试桥(ADB)等。 就像IDE一样,Android SDK总是在更新。 新版本将使您了解最新功能。

    如何开发Android应用 (How to develop an Android app)

    适用于Android的Java (Java for Android)

    When it comes to creating Android apps, your knowledge of Java is paramount to your success. Java is the official language for developing Android applications, and it supports all of the Android tools. Knowledge of this language will make your dev experience much easier.

    在创建Android应用程序时,您对Java的知识对您的成功至关重要。 Java是用于开发Android应用程序的官方语言,它支持所有Android工具。 了解这种语言将使您的开发人员体验变得更加轻松。

    Java was chosen for Android development because it is well-known, well-supported by development tools, and already pervasive in the mobile phone industry. On top of that, Java runs in a VM, so it doesn’t need to be recompiled.

    选择Java进行Android开发是因为Java广为人知,并且得到开发工具的大力支持,并且已经在手机行业普及。 最重要的是,Java在VM中运行,因此不需要重新编译。

    Before you can start your Android dev journey, you need to get up to speed on Java. If you’re looking to get started with Java, check out Educative’s free courses.

    在开始Android开发之旅之前,您需要掌握Java的最新知识。 如果您希望开始使用Java,请查看Educative的免费课程

    安装Android Studio IDE (Install Android Studio IDE)

    Image for post

    To get started with Android development, you need to install the Android Studio IDE. This user-friendly, drag-and-drop interface is the official IDE development environment. It is purpose-built for high-quality Android apps. This IDE will speed up your development time and make your apps far more reliable and easier to update when new features are released.

    要开始进行Android开发,您需要安装Android Studio IDE。 这个用户友好的拖放界面是官方的IDE开发环境。 它是专为高质量Android应用而构建的。 此IDE将加快您的开发时间,并在发布新功能时使您的应用程序更加可靠并且更易于更新。

    To install Android Studio on Windows, follow these steps.

    要在Windows上安装Android Studio,请按照以下步骤操作。

    1. Visit this link to get the latest version of Android Studio.

      访问此链接以获取最新版本的Android Studio。

    2. You can either download the IDE as a .exe file or a .zip file. For the .exe file, double click the file to launch it. For the .zip file, unpack the ZIP and copy the android-studio folder to your Program files.

      您可以将IDE下载为.exe文件或.zip文件。 对于.exe文件,双击该文件以启动它。 对于.zip文件,请解压缩ZIP文件并将android-studio文件夹复制到您的程序文件中。

    3. This will prompt you to open and launch the android-studio > binfolder.

      这将提示您打开并启动android-studio > bin文件夹。

    4. Once prompted, follow the Android Studio setup wizard, where you can select your SDK packages.

      出现提示后,请按照Android Studio设置向导进行操作,您可以在其中选择SDK包。

    To install Android Studio on Mac, follow these steps.

    要在Mac上安装Android Studio,请按照以下步骤操作。

    1. Visit this link to get the latest version of Android Studio.

      访问此链接以获取最新版本的Android Studio。

    2. Once downloaded, launch the DMG file and drag it to your Applications folder.

    3. Launch Android Studio. From here, you can either start a new project or import previous settings.

      启动Android Studio 。 从这里,您可以开始一个新项目或导入以前的设置。

    4. Follow the setup wizard prompts to select your SDK components.


    If you aren’t ready to download Android Studio IDE, you can also check out Educative’s course with a unique pre-configured Andoird widget

    如果您还不准备下载Android Studio IDE,则还可以通过独特的预配置Andoird小部件查看Educative的课程

    创建一个Hello World应用程序 (Creating a Hello World Application)

    Image for post

    步骤1:Android应用的结构 (Step 1: Structure of an Android App)

    Now that we have our IDE, how do we actually make an Android project? First, let’s look at the structure of a typical Android project.

    现在我们有了IDE,我们如何真正制作一个Android项目? 首先,让我们看一个典型的Android项目的结构。

    app — root module folder

    app —根模块文件夹

    • build.gradle — module config file

      build.gradle —模块配置文件

    • src/main/AndroidManifest.xml — module manifest file

      src / main / AndroidManifest.xml —模块清单文件

    • src/main/java — module source folder for Java or Kotlin files

      src / main / java -Java或Kotlin文件的模块源文件夹

    • src/main/res — module resource folder

      src / main / res —模块资源文件夹

    build.gradle — project config file

    build.gradle —项目配置文件

    gradle, gradle.properties, gradlew, gradlew.bat — Gradle related files for to build Android project

    gradlegradle.propertiesgradlewgradlew.bat —与Gradle相关的文件,用于构建Android项目

    settings.gradle — project settings file


    Image for post

    项目文件 (Project Files)

    The settings.gradle file contains a list of your modules and project name. Keep in mind that an Android project can consist of one or several modules, which can each contain their own feature or logic. The gradle.propertiesfile defines your settings and configures a build environment.

    settings.gradle文件包含您的模块和项目名称的列表。 请记住,一个Android项目可以包含一个或几个模块,每个模块可以包含自己的功能或逻辑。 gradle.properties文件定义您的设置并配置构建环境。

    The gradle, gradlew, and gradlew.bat files are related to Gradle wrapper, so we don’t have to manually install Gradle.


    build.gradle is a top-level build file. Here we can add configuration options shared by all modules. For example, you can give your files access to repositories for core Android functionalities.

    build.gradle是顶级构建文件。 在这里,我们可以添加所有模块共享的配置选项。 例如,您可以授予文件访问Android核心功能存储库的权限。

    模块文件 (Module files)

    Each module has a unique name where we put the application source code. The module build.gradle file contains the configurations related to this module only, such as:

    每个模块都有一个唯一的名称,用于放置应用程序源代码。 模块build.gradle文件仅包含与此模块相关的配置,例如:

    • compileSdkVersion - the version of Android SDK to compile the project

      compileSdkVersion用于编译项目的Android SDK版本

    • minSdkVersion - the minimal supported Android version


    • targetSdkVersion - the target version of Android SDK, used to tell the system to enable compatibility behaviors

      targetSdkVersion -Android SDK的目标版本,用于告诉系统启用兼容性行为

    • applicationId - unique identifier of the application on the device and in Google Play Store

      applicationId设备和Google Play商店中applicationId唯一标识符

    • versionCode - an internal version number


    • versionName - the version name displayed to users


    • compileOptions - compile options to achieve some features of Java 1.8

      compileOptions编译选项以实现Java 1.8的某些功能

    • dependencies - first-party and third-party library dependencies, discussed in the next lessons

      dependencies -第一方和第三方库依赖关系,在下一课中将进行讨论

    Image for post

    The AndroidManifest.xml is where we declare our main components. For example, a manifest file for a travel blog might contain the following things:

    我们在AndroidManifest.xml中声明我们的主要组件。 例如,旅行博客的清单文件可能包含以下内容:

    • package - the package name of the application, in our case com.travelblog

      package -应用程序的包名,在我们的例子com.travelblog

    • theme - the global application theme, in our case MaterialComponents theme


    • label - the label which is used as a value for the application icon


    • activity - the activity, we currently only have one MainActivity

      activity -该活动,我们目前只有一个MainActivity

    All resource-related files need to be placed inside predefined, sub-folders of the src/main/res folder. One subfolder, for example, is the layout folder for all your layout files. We will also have the src/main/java folder for our Java source code.

    所有与资源相关的文件都必须放置在src / main / res文件的预定义子文件夹中。 例如,一个子文件夹是所有布局文件的布局文件夹。 我们还将为Java源代码提供src / main / java文件夹。

    第2步:Android库 (Step 2: Android Libraries)

    An important part of creating your application is the unique features and tools you add to it. That’s where libraries come into play. A library is a collection of pre-written resources that can be added to your app. The Android library ecosystem is large, and you can use dozens of libraries in a single project. You can access most of the Android libraries through maven.

    创建应用程序的重要部分是添加到应用程序中的独特功能和工具。 那就是图书馆发挥作用的地方。 库是可以添加到您的应用程序中的预写资源的集合。 Android库生态系统很大,您可以在一个项目中使用数十个库。 您可以通过maven访问大多数Android库。

    Adding a library to your project is easy: declare the group id, artifact id, and version in the dependencies section of your app/build.gradle file.

    向您的项目中添加库很容易:在app / build.gradle文件的dependencies部分中声明组ID,工件ID和版本。

    Image for post

    Here are some of the most popular libraries in use today:


    • appcompat — makes the apps developed with newer versions work with older versions


    • constraintlayout — allows creating large and complex layouts with a flat view hierarchy


    • material — brings material design components to Android

      material —将材质设计组件带到Android

    • retrofit — a type-safe HTTP client library

      改造 —类型安全的HTTP客户端库

    • moshi — a JSON parser library

      moshi — JSON解析器库

    • glide — an image loading library

      glide —图像加载库

    • room — an official Android ORM database

      —官方的Android ORM数据库

    • dagger — a static, compile-time dependency injection framework

      dagger —静态的编译时依赖项注入框架



    The appcompat library is great for solving compatibility issues between newer and older versions of your app. Its primary component is AppCompatActivity. This base class enables backward compatibility with older versions of Android apps. To add it to your app, use the following code:

    appcompat库非常适合解决应用程序新旧版本之间的兼容性问题。 它的主要组件是AppCompatActivity 。 这个基本类别可与旧版Android应用程式向后相容。 要将其添加到您的应用中,请使用以下代码:

    implementation 'androidx.appcompat:appcompat:1.1.0'

    Constraint layout


    This library enables you to create complex layouts using a flat view hierarchy. It is common to use ConstraintLayout as the root of all the layout files. To add it to your app, use the following code:

    该库使您可以使用平面视图层次结构创建复杂的布局。 通常将ConstraintLayout用作所有布局文件的根。 要将其添加到您的应用中,请使用以下代码:

    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    Image for post

    Material design


    This library brings Material Design components to your app. Material design is a design language used to make your various components more user-friendly. You can take a look at the list of components here. To add it to your app, use the following code:

    该库将Material Design组件引入您的应用程序。 材料设计是一种设计语言,用于使您的各个组件更加人性化。 您可以在此处查看组件列表。 要将其添加到您的应用中,请使用以下代码:

    implementation 'com.google.android.material:material:1.1.0-alpha10'

    步骤3:Android活动 (Step 3: Android Activity)

    One of the core components of Android is activity, one screen of the application user interface. An application is comprised of multiple activities that can be launched on top of each other to form a back stack. A user can navigate through this back stack using the UI components, i.e. a back button.

    Android的核心组件之一是活动,即应用程序用户界面的一个屏幕。 一个应用程序由多个活动组成,这些活动可以相互启动以形成后退堆栈。 用户可以使用UI组件(即后退按钮)浏览该后退堆栈。

    For example, an app may have the following components:


    • LoginActivity — represents login flow

      LoginActivity —代表登录流程

    • ListActivity — represents a list of recent article titles

      ListActivity —表示最近文章标题的列表

    • DetailActivity — represents an article itself

      DetailActivity —表示文章本身

    Activities have their own lifecycles, so the Activity class offers six core callbacks: onCreate( ), onStart( ), onResume( ), onPause( ), onStop( ), onDestroy( ). When the user leaves an activity, the system will dismantle the activity by calling different methods. You can use these methods to check when an activity is being created or destroyed, becomes visible or hidden, etc.

    活动具有自己的生命周期,因此Activity类提供了六个核心回调: onCreate( )onStart( )onResume( )onPause( )onStop( )onDestroy( ) 。 当用户离开活动时,系统将通过调用不同的方法来取消活动。 您可以使用这些方法来检查活动何时被创建或破坏,变得可见或隐藏等。

    Image for post

    Creating an activity involves two main steps: make a Java class and extend it from the Activity superclass. You could then use the library AppCompatActivity to achieve backward compatibility. Android activities must then be declared in the AndroidManfiest.xml file.

    创建活动涉及两个主要步骤:创建Java类并从Activity超类对其进行扩展。 然后,您可以使用库AppCompatActivity来实现向后兼容性。 然后必须在AndroidManfiest.xml文件中声明Android活动。

    步骤4:Android版式 (Step 4: Android Layout)

    Another key aspect of Android development is developing and working with Android layout. The layout defines the overarching structure of your UI (user interface). These are built using views and view groups.

    Android开发的另一个关键方面是开发和使用Android布局。 布局定义了UI(用户界面)的总体结构。 这些是使用视图和视图组构建的。

    Views, also called widgets, might be components such as TextView (render text), EditText (user can type text), and Button (clickable text).

    视图 (也称为窗口小部件)可能是诸如TextView (呈现文本), EditText (用户可以键入文本)和Button (可单击文本)之类的组件。

    ViewGroups, sometimes called layouts, are like invisible containers that determine where certain elements will be housed. This is where you might use the Google library ContraintLayout, which uses constraints to position your widgets. The Android SDK method is simpler for beginners but offers less flexibility.

    ViewGroups有时也称为布局,就像不可见的容器一样,用于确定某些元素的放置位置。 您可以在这里使用Google库ContraintLayout ,该库使用约束来定位窗口小部件。 对于初学者来说,Android SDK方法较为简单,但灵活性较低。

    The easiest way to build a layout is by using an XML file rather than Java code. We can then bind or inflate this layout to an activity. Let’s build a layout to see how it’s done.

    建立布局的最简单方法是使用XML文件而不是Java代码。 然后,我们可以将此布局绑定或膨胀到活动。 让我们构建一个布局,看看它是如何完成的。

    First, inside your app/src/main/res/layout folder, create an activity_main.xmllayout file. In this example, we will use a root layout through ConstraintLayout alongside some XML attributes:

    首先 ,在您的app / src / main / res / layout文件夹中,创建一个activity_main.xml布局文件。 在此示例中,我们将通过ConstraintLayout使用根布局以及一些XML属性:

    • layout_width="match_parent": this defines the width of the layout.

      layout_width="match_parent" :这定义布局的宽度。

    • android:layout_height="match_parent": this defines the height of the layout

      android:layout_height="match_parent" :这定义了布局的高度

    • xmlns:android and xmlns:app: these define XML namespace, Android namespace for attributes from Android SDK, and app namespace for attributes from libraries

      xmlns:androidxmlns:app :这些定义XML名称空间,用于Android SDK中属性的Android名称空间以及用于库中属性的应用程序名称空间

    Image for post

    Secondly, we need to fill our empty layout by defining a child view. In this case, we will define static text that reads “Hello World”. To do so, we use a TextView and the text attribute. We will use wrap_content so the view will take up as much space as possible.

    其次 ,我们需要通过定义子视图来填充我们的空白布局。 在这种情况下,我们将定义读取“ Hello World”的静态文本。 为此,我们使用TextViewtext属性。 我们将使用wrap_content以便视图将占用尽可能多的空间。

    Image for post

    Now that we’ve built our views, we move onto alignment. We want to move our text to the center of the screen since the default positions our views in the upper left corner. To do so, let’s add the following constraints:

    现在,我们已经建立了视图,现在我们进入对齐 。 由于默认位置我们的视图位于左上角,因此我们希望将文本移动到屏幕的中心。 为此,我们添加以下约束:

    • layout_constraintTop_toTopOf: this declares a constraint to align the top of the view to the top of the ConstraintLayout

      layout_constraintTop_toTopOf :这声明一个约束,以将视图的顶部与ConstraintLayout的顶部对齐

    • layout_constraintBottom_toBottomOf: this declares a constraint to align the bottom of the view to the bottom of the ConstraintLayout

      layout_constraintBottom_toBottomOf :这声明一个约束,以使视图的底部与ConstraintLayout的底部对齐

    • layout_constraintLeft_toLeftOf: this declares a constraint to align the left of the view to the left of the ConstraintLayout

      layout_constraintLeft_toLeftOf :这声明一个约束,以使视图的左侧与ConstraintLayout的左侧对齐

    • layout_constraintRight_toRightOf: this declares a constraint to align the right of the view to the right of the ConstraintLayout

      layout_constraintRight_toRightOf :这声明一个约束,以使视图的右边与ConstraintLayout的右边对齐

    Image for post
    Image for post

    Now that everything is aligned where we want it, we move onto layout binding. This serves to associate activity_main.xmllayout with the MainActivity. We do this using the setContentView method when an activity is created inside the onCreate method.

    现在,所有内容都在我们想要的位置对齐了,我们继续进行布局绑定 。 这用于将activity_main.xmllayoutMainActivity关联。 当在onCreate方法内创建活动时,我们使用setContentView方法执行此操作。

    The method setContentView accepts the layout resource ID. This is referenced by the auto-generated Android R class, where all the resource IDs are stored. For binding purposes, we can use the R.layout.activity_mainto obtain the ID of activity_main.xml so we can tell MainActivity to render layout from this file.

    setContentView方法接受布局资源ID。 自动生成的Android R类引用了该类,其中存储了所有资源ID。 出于绑定目的,我们可以使用R.layout.activity_main获取activity_main.xml的ID,以便我们可以告诉MainActivity从该文件中渲染布局。

    Image for post

    The final step is view binding, which enables us to interact with views on runtime. To do so, we bind the view from XML to Java object.

    最后一步是视图绑定 ,这使我们能够在运行时与视图进行交互。 为此,我们将视图从XML绑定到Java对象。

    First, we define a new ID for the TextView using the id attribute with @+id/mainTextView value.

    首先,我们使用带有@ + id / mainTextView值的id属性为TextView定义新的ID。

    Image for post

    We can now bing the TextView from XML to Java object using the findViewById method. The setText method will change our text to make it interactive.

    现在,我们可以使用findViewById方法将TextView从XML findViewById到Java对象。 setText方法将更改文本以使其具有交互性。

    Image for post
    Image for post

    Now you know the basic build and layout process for an Android application! It’s time for you to get started on your own! In the next section, we’ll walk you through some important resources to get you started.

    现在您知道了Android应用程序的基本构建和布局过程! 是时候开始自己动手了! 在下一节中,我们将引导您完成一些重要的资源,以帮助您入门。

    Android开发资源 (Resources for Android Development)

    Image for post

    来自Google和Android的官方资源 (Official Resources from Google and Android)

    学习基础 (Learn the Basics)

    对于中级/高级开发人员 (For intermediate/advanced developers)

    是否想立即开始Android开发? (Want to get started with Android development right now?)

    One of the best resources out there for developers of all levels is Modern Android App Development with Java, a hands-on, project-based course that walks through every stage of development. As you learn, you’ll build a fully functional Travel Blog Application.

    对于所有级别的开发人员来说,最好的资源之一就是使用Java的Modern Android App Development ,这是一个动手的,基于项目的课程,它涵盖了开发的各个阶段。 在学习过程中,您将构建功能齐全的Travel Blog应用程序。

    On top of that, the course comes with Educative’s unique pre-configured Android environment, so you don’t have to download anything to get started. It’s one of the only courses out there with this powerful widget!

    最重要的是,该课程随附Educative独特的预配置Android环境,因此您无需下载任何内容即可开始使用。 这是使用此功能强大的小部件的仅有的课程之一!

    Image for post

    The course begins with a basic intro and moves through each stage of development, including…


    • Intro to Android

    • Login screen

    • Details screen

    • List screen

    • Search and sort

    • Offline functionalities

    • Additional resources

    • and more


    It’s never been easier to get started with Android development to propel your career into the future!


    Happy learning!


    翻译自: https://medium.com/educative/android-development-how-to-develop-an-android-app-bcbe0e2c469a


  • android中文medium字体库

    2017-03-07 14:45:47
  • Medium 是一个写作的平台,他的创始人也创立了Twitter,Square(JakeWharton 大神所在的公司),这篇文章是MediumAndroid工程师Daniel McCartney 分享了他们Android App 使用的开源项目。 Android Open Source ...

    Medium 是一个写作的平台,他的创始人也创立了Twitter,Square(JakeWharton 大神所在的公司),这篇文章是Medium 的Android工程师Daniel McCartney 分享了他们Android App 使用的开源项目。

    Android Open Source Project
    你可以把Android 平台修改构建成你所需要的。当然你也可以提交贡献代码。

    Guava 是支持Java 6+ 的Googel 核心类库,它包括集合类,缓存,并发库,通用注解等等。

    Dagger 2 是一个快速的依赖注入库,它使用APT 的方式在编译时生成代码,在牺牲了微小代价的情况下,使项目架构更加整洁。

    Retrofit 是一个类型安全的Rest 风格的类库,它通过注解的方式来实现网络请求。

    OkHttp 是一个HTTP + SPDY 的网络请求库。

    Jackson 是一个Json 解析和生成库。

    Otto 是一个基于Guava 项目实现的事件总线的类库。

    Glide 是一个图片加载和缓存库,它主要专注于平滑滚动。

    Phrase 是一个Android 字符串资源模板类库。

    ButterKnife 是一个View 注入类库。

    Calligraphy 是一个自定义字体的类库。

    Hugo 是一个通过注解的方法来实现日志功能的类库。

    Mockito 是一个Java 的Mocking 单元测试框架。

    robolectric 是一个Android 的单元测试框架。

    sdk-manager-plugin 是用来下载和管理你的Android SDK的Gradle 插件。

    下面还有很多第三方的工具,可以让你的App 大放异彩。

    facebook-android-sdk 是集成Facebook 平台用于Android 的SDK。

    Fabric 是Twitter 移动开发平台,它集成了一系列好用的工具,比如分析,崩溃捕获等等。

    Google Services | Android Developers
    利用Google 最新的技术,只需要简单的API,实现很多强大的功能。

    本文作者:Daniel McCartney

    本文首发我的微信公众号,分享Android 开发互联网内容

  • W Wajahat Karim和贡献者使用:red_heart:︎构建的MediumClap-Android,以及在Medium上具有拍手效果的自定义浮动动作按钮(FAB)库。 FAB)库,如Medium上的鼓掌效果:page_facing_up:操作方法文章从Android Studio将...
  • android开发工具I kicked off my journey as an Android developer about a year ago, and I have been introduced to several programs that has helped me along the way. These are three of my favourites!大约...


    I kicked off my journey as an Android developer about a year ago, and I have been introduced to several programs that has helped me along the way. These are three of my favourites!

    大约一年前,我开始了作为Android开发人员的旅程,并且向我介绍了一些对我有帮助的程序。 这是我的三个最爱!

    查尔斯·Proxy (Charles Proxy)

    Image for post

    What is this? I’ll let its website explain it:

    这是什么? 我将对其网站进行解释:

    Charles is an HTTP proxy / HTTP monitor / Reverse Proxy that enables a developer to view all of the HTTP and SSL / HTTPS traffic between their machine and the Internet. This includes requests, responses and the HTTP headers (which contain the cookies and caching information).

    Charles是HTTP代理/ HTTP监视器/反向代理,使开发人员可以查看其计算机与Internet之间的所有HTTP和SSL / HTTPS通信。 这包括请求,响应和HTTP标头(其中包含cookie和缓存信息)。

    If you are at all familiar with mobile development, you will likely see how this is useful. If your app interacts with a REST API, you can debug each of your outgoing requests and incoming responses. Charles will snoop your app’s network communication and output every detail of your request including the URL, method, headers, or request body as well as the raw JSON data returned from the server. This is the single source of truth of your app’s network communication and it makes network debugging a breeze. It’s also a great way to prove to your back-end developer that a bug is their fault by sending them the a raw curl command of your network request 😏:

    如果您完全熟悉移动开发,那么您可能会发现这很有用。 如果您的应用程序与REST API交互,则可以调试每个传出请求和传入响应。 Charles将监听您应用程序的网络通信,并输出您的请求的每个细节,包括URL,方法,标头或请求正文以及从服务器返回的原始JSON数据。 这是应用程序网络通信的唯一真实来源,它使网络调试变得轻而易举。 向后端开发人员发送网络请求的原始curl命令来向后端开发人员证明错误是他们的错,这也是一种很好的方法:

    Image for post

    脚本 (scrcpy)

    Are you tired of Vysor and its annoying ads and its blurry screen mirroring? Say hello to scrcpy. This easy-to-install, lightweight and speedy application uses your Android device’s already established USB connection to mirror its screen on your desktop. It is open source, completely ad-free and does not require any root access. Interacting with your real device through this mirrored display is an emulator-like experience as it has very little response delay. The image quality has a high frame rate and is very crispy:

    您是否对Vysor及其烦人的广告以及模糊的屏幕镜像感到厌倦? 向scrcpy打个招呼。 这个易于安装,轻巧且快速的应用程序使用您的Android设备已建立的USB连接将其屏幕镜像到您的桌面上。 它是开源的,完全没有广告,并且不需要任何root访问。 通过该镜像显示器与真实设备进行交互是一种类似于模拟器的体验,因为它几乎没有响应延迟。 图像质量具有很高的帧频并且非常清晰:

    Image for post

    Shout-out to Jacob Kwitkoski for introducing this to me!

    雅各布·科维科斯基( Jacob Kwitkoski)大喊大叫,向我介绍这个!

    uiautomatorviewer (uiautomatorviewer)

    If you are familiar with front-end web development, you can appreciate the convenience of the Inspector in your modern browser which lets you explore your HTML code as you hover over elements on a page. uiautomatorviewer brings the same convenience to the Android world. This tool lets you take UI XML snapshots of what you are currently vieweing on your device. This is of course an alternative to Android Studio’s built-in Layout Inspector, but I have personally found this tool to be faster, simpler, and more reliable.

    如果您熟悉前端Web开发,则可以在现代浏览器中欣赏Inspector的便利,当您将鼠标悬停在页面上的元素上时,浏览器将使您能够探索HTML代码。 uiautomatorviewer为Android世界带来了同样的便利。 使用此工具,您可以获取设备上当前正在查看内容的UI XML快照。 当然,这是Android Studio内置Layout Inspector的替代方法,但是我个人发现该工具更快,更简单,更可靠。

    To access the tool, navigate to



    Run the uiautomatorviewer binary and tap on this icon:


    Image for post

    If you have an Android device connected via USB, the tool will take an XML snapshot of the current view and provide you with a view element tree:


    Image for post

    If you are working on an Android app, be sure to try out these tools to make your life easier! Happy coding!

    如果您使用的是Android应用,请务必尝试使用这些工具,以使您的生活更轻松! 编码愉快!

    翻译自: https://medium.com/swlh/three-handy-tools-for-android-development-a016259942d9


  • android开发人员要求An Android Developer is somebody who creates our lives simple by creating a corresponding desktop or mobile programs that help us in our daily pursuits. Consequently, if you ask who...


    An Android Developer is somebody who creates our lives simple by creating a corresponding desktop or mobile programs that help us in our daily pursuits. Consequently, if you ask who exactly is the Android Developer, I’d say, he’s a Software Developer who specializes in designing software for the Android market. This usually means that the function of an Android Developer within a business is to produce software with respect to exactly what domain your organization works on. He/she can produce simple applications in addition to complex ones such as gambling programs (PUBG, Candy Crush, Word Cookies, etc). As an Android programmer, you have to be very clear about your job posting and your own responsibilities. So, I’ve noted down a couple of important functions and obligations of an Android Developer. Take a look! These functions and responsibilities specify who could be a successful programmer. You need to build and layout Android software Should function in conjunction with the layout and the testing staff so as to produce better products with fewer bugs learn how to utilize different API and information sources understand. How to fix bugs Constant evaluation, finding new technology, and exploiting then the next question is why to pick the function of an Android Developer when you’ve got so many other advancement job functions. Let us see what would be the significant reasons to develop into an Android Developer.

    Android开发人员可以通过创建相应的桌面或移动程序来帮助我们完成日常工作,从而使我们的生活变得简单。 因此,如果您问到底谁是Android开发人员,我想说的是,他是一位专门为Android市场设计软件的软件开发人员。 通常,这意味着企业中Android开发人员的功能是根据您的组织所从事的领域确切地生产软件。 除了赌博程序(PUBG,Candy Crush,Word Cookies等)之外,他/她还可以制作简单的应用程序。 作为一名Android程序员,您必须非常清楚自己的职位发布和自己的职责。 因此,我已经记下了Android开发人员的几个重要功能和义务。 看一看! 这些功能和职责指定了谁可以成为成功的程序员。 您需要构建和布局Android软件应该与布局和测试人员一起使用,以便生产出具有更少错误的更好产品,了解如何利用不同的API和信息源。 如何修复错误不断进行评估,寻找新技术并加以利用,接下来的问题是,为什么在拥有许多其他高级职位功能的情况下,为什么要选择Android开发人员的功能。 让我们看看开发成为Android Developer的重要原因是什么。

    为什么选择Android开发? (Why select Android Development?)

    There are many reasons why you need to go to get Android Development. Permit Android is an open-minded system hence it lessens the package licensing price that adds up on into the very low cost and higher ROI (Return on Investment). They have a huge community that lets you directly interact with the programmers themselves in the event of problems or potential variations. Programs that are made are gaining a great deal of popularity or are ranked high on the google play shop. Google keeps altering certain functionalities and discharging the new models every now and then. Therefore, you get upgrades on a regular basis that include improvised features that are added to your program. Additionally, this is a challenging task to develop, something which may catch the attention of any consumer. It’s easy to embrace If you’re working on any tech such as Software Testing, Complete Stack Development, you’d find it simple to understand how Java programming language that’s one in most of the handiest languages used to create software. It’s also a fact that any user with peer knowledge on Java can quickly create an Andriod program. Simple to learn programmers out there will surely feel the time spent in learning how to create an Android program is relatively less than that which they spend on different technologies. Have an understanding of Java and scripting languages such as Perl, PHP, and the task is finished. Then let us talk Job functions. Who can develop into an Android Developer?

    有许多原因需要您进行Android开发。 许可证Android是一个开放的系统,因此它降低了软件包许可价格,从而大大降低了成本,并提高了ROI(投资回报率)。 他们有一个庞大的社区,可以让您在出现问题或潜在变化时直接与程序员本身进行互动。 制作的程序越来越受欢迎,或者在Google Play商店中排名很高。 Google会不时更​​改某些功能并推出新模型。 因此,您会定期进行升级,其中包括已添加到程序中的即兴功能。 此外,这是一项艰巨的任务,可能会引起任何消费者的注意。 易于拥抱如果您正在从事诸如软件测试,完整堆栈开发之类的任何技术,那么您将很容易理解,Java编程语言是大多数用于创建软件的最便捷语言中的一种。 所有具有Java同行知识的用户都可以快速创建Andriod程序,这也是事实。 简单易学的程序员肯定会感到,学习如何创建Android程序所花费的时间比他们在不同技术上所花费的时间要少。 了解Java和脚本语言(例如Perl,PHP)并完成任务。 接下来让我们谈谈Job函数。 谁可以开发成为Android开发人员?

    谁现在是Android开发人员? (Who is now an Android Developer?)

    Android Software Programmers can stick to a simple pathway to be an effective Android Developer because they already have some idea about how the software work. But if you are a newcomer and wish to Construct a profession in Android Program Development, it is possible to take up the Android Development Training provided at Edureka.To acquire a more in-depth comprehension of how to develop into an Android Developer, you can take a look at this movie by our subject-matter pros. Android Tutorial It’s excellent for both novices and professionals that wish to learn or brush up the fundamentals of Android. Now, let us take a look at the project tendencies. Android program development is on the Forbes’ listing of their most-wanted tech abilities in 2019. It’s just one such technology that features multipurpose job chances. So to catch a few handfuls of tasks on Android Development tasks by having a peek at the project tendencies. It is possible to observe the Android programmer jobs have a tollfree. It’s becoming among the highest leaders in the industry today. Since the industry demand is increasing for Android, mobile application development is growing in India. Programmers having the wisdom and expertise will tote a wonderful bundle within this business. There are roughly 25,000 openings for Android mobile software development in India, this amount indicates a massive amount of growth within this business. Speaking about the salary obtained by an Android Developer, have a look at this chart. Based on Glassdoor, to get a Younger, the true salary is near 4LPA also it keeps growing with the number of years of expertise. And also, since the number of job vacancies is far somewhat more, the wages can also be pretty damn good. This chart below shows the wages tendency in 2019. See the gain in the median salary obtained. It’s near 65,000 Euros annually that’s quite a great deal of cash. Now you have known who’s an Android Developer and exactly what the occupation trends and wages, let us move on, and have a peek at just how precisely you are able to turn into an effective Android Developer.

    Android软件程序员可以通过简单的途径成为一名有效的Android开发人员,因为他们已经对该软件的工作原理有所了解。 但是,如果您是新手,并且希望构建Android程序开发专业,则可以参加Edureka提供的Android开发培训。要更深入地了解如何开发为Android开发人员,您可以请由我们的专业人士看这部电影。 Android教程对于希望学习或掌握Android基础知识的新手和专业人士而言,它都是绝佳的选择。 现在,让我们看一下项目趋势。 Android程序开发已列入《福布斯》 2019年他们最想要的技术能力。这仅仅是一项具有多用途工作机会的技术。 因此,通过窥视项目趋势,可以在Android开发任务上捕获少量任务。 有可能观察到Android程序员的工作有免费电话。 它正在成为当今行业中最高的领导者之一。 由于行业对Android的需求在增加,因此印度的移动应用程序开发也在增长。 拥有智慧和专业知识的程序员将在这个行业中拥有出色的捆绑。 印度大约有25,000个Android移动软件开发职位,这一数字表明该业务已经有了巨大的增长。 说到Android开发人员获得的薪水,请查看此图表。 以Glassdoor为基础,要变得更年轻,真正的薪水接近4LPA,并且随着多年专业知识的发展,它也在不断增长。 而且,由于职位空缺的数量要多得多,所以工资也可以说是非常不错的。 下图显示了2019年的工资趋势。请参阅获得的工资中位数的增长。 每年将近65,000欧元,这是一笔不菲的现金。 现在,您已经知道谁是Android开发人员,以及确切的职业趋势和工资,让我们继续前进,来看看您能够成为一名有效的Android开发人员的精确程度。

    如何成为一名有效的Android开发人员? (How to Be an effective Android developer?)

    you need to be well-versed in various themes under Android Development such as the skillset. Below are a couple of noteworthy skills which you ought to master to be able to bag the function of an Android Developer. Must have a strong understanding of Android SDK and distinct variations of Android. Decent understanding with SQL. Proficient comprehension of code versioning tools, for example, Git. Familiarity using RESTful APIs that links Android programs to backend services. Have the capacity to design software around UI for example touch. Familiarity with constant integration. Mastering these skills will surely help you develop as a fruitful Android Developer. And also do notice that Android is just one such domain where occupations are not out of stock. So begin now to become a wonderful programmer. So for this, we arrive at the conclusion of the article on” How to become an Android Developer”. I hope you’re clear with all the topics which are covered within this blog and prepared to begin your search to become an Android Developer. In case you haven’t already begun your groundwork yet, it is wise to start straight away. You could even register in one of Edureka’s certificate program to quick-start your understanding. Have any questions? Do not forget to mention these in the remarks. We’ll return to you.

    您需要精通Android开发下的各种主题(例如技能组)。 以下是一些值得注意的技能,您必须掌握这些技能才能使用Android Developer的功能。 必须对Android SDK和Android的不同版本有深刻的了解。 对SQL的体面理解。 熟练掌握代码版本控制工具,例如Git。 熟悉使用将Android程序链接到后端服务的RESTful API。 有能力围绕UI设计软件,例如触摸。 熟悉不断集成。 掌握这些技能必将帮助您成为富有成果的Android开发人员。 还要注意的是,Android只是其中一种职业不缺货的领域。 因此,现在就开始成为一名出色的程序员。 因此,我们得出了“如何成为一名Android开发人员”一文的结论。 希望您对本博客中涵盖的所有主题一目了然,并准备开始进行搜索以成为一名Android开发人员。 如果您还没有开始进行基础工作,那么立即开始是明智的。 您甚至可以在Edureka的一项证书计划中注册,以快速开始您的理解。 有什么问题吗? 不要忘了在备注中提及这些。 我们会回到您的身边。

    翻译自: https://medium.com/swlh/how-to-become-an-android-developer-3635e6494435


  • 转自:Medium开发团队谈架构设计  背景  说到底,Medium是个社交网络,人们可以在这里分享有意思的故事和想法。据统计,目前累积的用户阅读时间已经超过14亿分钟,合两千六百年。  我们支持着每个月两千五百万...
  • Android开发常用开源框架

    万次阅读 多人点赞 2016-10-23 12:41:20
    Android开发常用开源框架2 Android开发常用开源框架3 2017年伊始,你需要尝试的25个Android第三方库 Android开发常用第三方平台 免费的计算机编程类中文书籍 free-programming-books Mark!Android最佳的开源库集锦 ...
  • Android 开发规范

    2015-01-19 17:45:57
    该文章来自 https://software.intel.com/zh-cn/blogs/2014/09/18/android/?utm_campaign=CSDN&utm_source=intel.csdn.net&utm_medium=Link&utm_content=%20intelandroid-%20guifan 一、Android 编码规范 1....
  • 如果您想转行成为Android开发人员,或者刚开始使用Android开发。 这份全面的指南将帮助您获得梦always以求的面试机会。 关于如何准备android开发人员面试准备的话题很多,但是关于如何进行面试的话题却很少。 ...
  • Android开发技术路线

    千次阅读 2018-01-10 20:11:00
    00写在前边 01学习资料清单 02 学习网站 03 算法学习 04 项目学习 ...记录一下自己学习Android所走过的...Android开发知识相关 《疯狂Aondroid讲义》李刚 《第一行代码Android》郭霖 《App研发录》 包建强 《...
  • android应用程序开发Android App Development guide for beginners. 适用于初学者的Android应用开发指南。... 为什么要学习android开发。 If you want a well-paying job, then you should go for the A...
  • Android开发基础概念

    2017-03-30 15:04:09
  • android开发各种相关干货

    千次阅读 2015-12-01 15:51:53
    Android知识库 csdn上面的知识库,包括开发工具、基础知识、软件架构等等各方各面的知识,非常全面。... 收集整理Android开发所需的Android SDK、开发中用到的工具、Android开发教程、Android设计规范,免费的设计素材
  • Android开发资料整理

    2019-06-26 11:01:44
    安卓项目开发过程资料整理 1 AndroidStudio 下载 http://www.androidguide.cn/ 工具下载 2 Android Studio插件整理 https://blog.csdn.net/yang5726685/article/details/79619949 ...
  • Android开发心得整理

    2016-03-29 09:10:46
    原文链接:https://medium.com/@laanayabdrzak/android-development-some-of-the-best-practices-27722c685b6a#.x3b8wsvz9 在开发了几个项目之后我决定写篇文章分享一下一路走来的经验教训。 在使用任何第三方...
  • android辅助开发As developers, we make many assumptions about how users consume our application and that can actually hinder instead of help them. We need to ensure we’re keeping our flows as simple ...
  • android开发人员要求by Ayusch Jain 通过Ayusch Jain 如果您想成为一名Android开发人员,请阅读这些书 (If you want to become an Android developer, read these books) I’ve been an Android developer for the...
  • 有关Android开发的提示和技巧的备忘单。 这是我从各种来源收集到的一组有关Android开发的简单提示和技巧。 它可以帮助我指导社区中的其他android开发人员有关每个android开发人员应了解的知识。 我也可以随时随地...
  • android 开发字体包

    2017-05-22 09:04:40
    压缩包包含以下字体包,可以在安卓开发中使用: Roboto-Black,Roboto-BlackItalic,Roboto-Bold,Roboto-BoldItalic,Roboto-Italic,Roboto-Light,Roboto-LightItalic,Roboto-Medium,Roboto-MediumItalic,Roboto-...
  • Android开发方式分析

    2012-05-24 22:22:14
    [size=large][b]开发Android应用程序,原生开发于中间件开发分析[/b][/size] [size=medium][b]一、[/b][/size] [b]应用程序开发分为不同的层次,从最复杂的NDK ==》JDK ==》中间件 ==》图形界面 NDK...
  • [size=medium]Google I/O 2013...与Eclipse的ADT插件类似,速速体验下Google针对Android开发定制的IDE。 详细下载地址及介绍见: [color=darkred][url]http://developer.android.com/sdk/installing/studio.html...
  • android初学者 Android开发 (Android Development) 通往编码世界学习者的诚实路线图。 (An honest route map to the learners in the world of coding.) When I started learning android development, I was so ...
  • android初学者 Android开发 (Android Development) 通往编码世界学习者的诚实路线图。 (An honest route map to the learners in the world of coding.) When I started learning android development, I was so ...
  • 出自https://medium.freecodecamp.com/android-development-best-practices-83c94b027fd3#.8c6rnro74 让我们一起探索在设计和开发安卓app的一些最好的做法。 首先,当你开发一款安卓应用时,你应该准备好运行在一...
  • android开发图片分辨率

    2019-10-05 20:36:14
    一直受到android开发图片分辨率问题困扰.drawable-(xdpi,hdpi,mdpi,ldpi,nodpi)这几个文件夹到底怎么放图片呢? dpi是什么呢? dpi是“dot per inch”的缩写,每英寸像素数。四种密度分类: ldpi (low), mdpi ...



1 2 3 4 5 ... 20
收藏数 11,601
精华内容 4,640