电子界卡组构建2019_2018–2019年构建现代Android应用程序的路线图

  • Post author:
  • Post category:其他


电子界卡组构建2019

Kriptofolio应用程序系列—简介

(

Kriptofolio app series — Introduction

)

Welcome to this series of blog posts where I will be creating a modern Android app. I will use the best tools and practices available in the year 2018–2019. I am doing this because I want to cover all the hottest topics in the Android world and acquire knowledge in them by teaching you.

欢迎来到这一系列博客文章,我将在这些文章中创建一个现代的Android应用程序。 我将使用2018-2019年可用的最佳工具和实践。 我之所以这样做,是因为我想涵盖Android世界中所有最热门的主题,并通过教您获得有关这些主题的知识。

If you follow this series, you will learn how to develop the app from scratch. Each blog post from this series will cover some specific development topic which I want to talk about. I will try to do my best to create a good quality app and explain the development process. This first blog post from the series is a project’s roadmap of what we are going to do.

如果您遵循此系列,您将学习如何从头开始开发应用程序。 本系列的每篇博客文章都将涵盖一些我想谈论的特定开发主题。 我将尽力创建一个高质量的应用程序并解释开发过程。 该系列的第一篇博客文章是我们要做的项目路线图。

系列内容

(

Series content

)

该应用程序:“ Kriptofolio”(以前称为“我的加密货币”)想法

(

The app: “Kriptofolio” (previously “My Crypto Coins”) idea

)

At first it was hard to think of a plan to showcase all Android development trends, but finally, I found one which I liked. It is related to my huge interest area — blockchain and cryptocurrencies. I decided to create an app which would contain your cryptocurrencies portfolio and let you know how much they are worth converted to fiat money.

最初,很难想到一个计划来展示所有Android开发趋势,但是最后,我找到了一个我喜欢的计划。 这与我巨大的兴趣领域有关-区块链和加密货币。 我决定创建一个包含您的加密货币投资组合的应用程序,并让您知道将其转换为法定货币的价值。

The important thing for the user is that this app is going to ensure 100% trust. It will not require any login/registration process. It won’t collect users’ data by sending it to the server. I guess nobody would feel comfortable sharing information online about owned money.

对用户而言重要的是,此应用将确保100%的信任。 它不需要任何登录/注册过程。 它不会通过将其发送到服务器来收集用户的数据。 我想没有人会愿意在网上共享有关自有资金的信息。

Users’ provided data about cryptocurrency investments will be only stored inside a local database that is kept inside an Android device. However, to know the portfolio’s value converted to the fiat money, the app is going to use the Internet to get the latest conversion rates.

用户提供的有关加密货币投资的数据将仅存储在Android设备中保留的本地数据库中。 但是,要知道投资组合的价值已转换为法定货币,该应用程序将使用互联网获取最新的转换率。

So as you see for training purposes, this app idea is great. It is technically challenging you to try different approaches to work with data. This is one of the most important skills to know to build modern apps. The topic of money for people is so sensitive. To ensure even more trust, I will be developing this app openly by creating this blog posts series and making the project code available so everyone can see that there is nothing to hide.

因此,如您所见,出于培训目的,此应用程序的构想很棒。 从技术上来说,挑战您尝试使用不同的方法来处理数据。 这是构建现代应用程序时应了解的最重要技能之一。 为人民着想的话题是如此敏感。 为了确保获得更多信任,我将通过创建此博客文章系列并提供项目代码来开放开发此应用程序,以便每个人都可以看到没有隐藏的东西。

我们要用什么?

(

What are we going to use?

)

First, to create this app, we need to know about various cryptocurrency prices at the current moment. This data will be provided from the Internet as it is continually changing.

首先,要创建此应用,我们需要了解当前的各种加密货币价格。 随着数据的不断变化,这些数据将从Internet提供。

数据API:

(

Data API:

)


CoinMarketCap

— one of the most popular websites for getting an overview of the cryptocurrency market. This website offers a free

API

that anyone can use and it fits perfectly for us as a data service provider.


CoinMarketCap

—最受欢迎的网站,可概述加密货币市场。 该网站提供了任何人都可以使用的免费

API

,非常适合作为数据服务提供商的我们。

Next, I made a list of my most significant trending things in the Android world that fit this project and should be used in it.

接下来,我列出了适合该项目并应在其中使用的Android世界中最重要的趋势。

编程语言:

(

Programming language:

)


Kotlin

— an official language on Android. It is expressive, concise, and powerful. Best of all, it’s interoperable with existing Android languages and runtime.


Kotlin

-Android上的官方语言。 它富有表现力,简洁而强大。 最重要的是,它可以与现有的Android语言和运行时互操作。

This new language introduction was one of the hottest topics in 2017 for Android. Our app needs to be written in it. I also talk about Kotlin and its features in my past blog post “

Let’s learn Kotlin by building Android calculator app

”.

这项新语言介绍是2017年Android上最热门的主题之一。 我们的应用程序需要编写在其中。 我在过去的博客文章“

通过构建Android计算器应用程序来学习Kotlin

”中也谈到了Kotlin及其功能。

集成开发环境(IDE):

(

Integrated development environment (IDE):

)


Android Studio

— the official IDE for Android. It provides the fastest tools for building apps on every type of Android device. There are no better alternatives for developing native apps. It’s our main choice for an IDE without any question.


Android Studio



Android

的官方IDE。 它提供了用于在每种类型的Android设备上构建应用程序的最快工具。 开发本机应用程序没有更好的选择。 毫无疑问,这是我们选择IDE的主要选择。

项目建设管理系统:

(

Project build management system:

)


Gradle

— is an advanced general purpose build management system based on Groovy and Kotlin. It supports the automatic download and configuration of dependencies or other libraries. It is the recommended build system by Google. It is well integrated inside Android Studio so we will be using it.


Gradle

—是基于Groovy和Kotlin的高级通用构建管理系统。 它支持自动下载和配置依赖项或其他库。 这是Google推荐的构建系统。 它很好地集成在Android Studio中,因此我们将使用它。

建筑:

(

Architecture:

)


Android Architecture Components

— a collection of libraries that help you design robust, testable, and maintainable apps.


Android Architecture Components

–库的集合,可帮助您设计健壮,可测试和可维护的应用程序。


Model–View–ViewModel (MVVM)

— an architectural pattern. The concept is to separate data presentation logic from business logic by moving it into a particular class for a clear distinction. The Android team is pushing this pattern as the default choice. Also, it’s an alternative to

MVC

and popular

MVP

patterns.


模型–视图–视图模型(MVVM)

-一种架构模式。 这个概念是将数据表示逻辑与业务逻辑分开,方法是将其移入特定类以进行明确区分。 Android小组正在将此模式作为默认选择。 而且,它是

MVC

和流行的

MVP

模式的替代方案。

I’ll be talking separately in this series about this pattern choice, other architecture options and how to organize our code well in general. It is essential if we want to build an easily maintainable solid project.

在本系列文章中,我将分别讨论有关模式选择,其他体系结构选项以及如何总体上良好地组织我们的代码。 如果我们要构建一个易于维护的可靠项目,这是至关重要的。


Coroutines

— a concurrency design pattern that you can use on Android to simplify code that executes asynchronously.


协程

—一种并发设计模式,您可以在Android上使用它来简化异步执行的代码。

数据持久性:

(

Data persistence:

)


SQLite Database

— it is an open source SQL database that stores data persistently to a text file on a device. Android comes in with built-in SQLite database implementation. SQLite supports all the relational database features.


SQLite数据库

-这是一个开放源代码SQL数据库,可将数据持久存储到设备上的文本文件中。 Android内置了内置SQLite数据库实现。 SQLite支持所有关系数据库功能。


Shared Preferences

— an API from Android SDK to store and retrieve application preferences. SharedPreferences are merely sets of data values stored persistently. It allows you to save and retrieve data in the form of key value pairs.


共享首选项

-Android SDK中的一个API,用于存储和检索应用程序首选项。 SharedPreferences仅仅是持久存储的数据值集。 它允许您以键值对的形式保存和检索数据。

库:

(

Libraries:

)



Android Jetpack



components:



Android Jetpack



组件:


AppCompat

— it is a set of support libraries which can be used to make the apps that were developed with newer versions work with older versions.


AppCompat-

它是一组支持库,可用于使使用较新版本开发的应用程序与较旧版本一起使用。


Android KTX

— a set of Kotlin extensions for Android app development. The goal of Android KTX is to make Android development with Kotlin more concise, pleasant, and idiomatic by leveraging the features of the language such as extension functions/properties, lambdas, named parameters, and parameter defaults.


Android KTX-

一组用于Android应用程序开发的Kotlin扩展。 Android KTX的目标是通过利用语言的功能(例如扩展功能/属性,lambda,命名参数和参数默认值)来使Kotlin的Android开发更加简洁,愉悦和惯用。


Data Binding

— is a support library that allows you to bind UI components in your layouts to data sources in your app using a declarative format rather than programmatically.


数据绑定

—是一个支持库,允许您使用声明性格式(而不是通过编程方式)将布局中的UI组件绑定到应用程序中的数据源。


Lifecycles

— for managing your activity and fragment lifecycles.


生命周期

-用于管理活动和碎片生命周期。


LiveData

— is an observable data holder class which was designed to help solve common Android Lifecycle challenges and to make apps more maintainable and testable.


LiveData

—是一个可观察的数据持有者类,旨在帮助解决常见的Android Lifecycle难题,并使应用程序更易于维护和测试。


Room

— it provides an abstraction layer over SQLite to allow easy database access while harnessing the full power of SQLite.


Room

—它在SQLite上提供了一个抽象层,以便在利用SQLite的全部功能的同时允许轻松地访问数据库。


ViewModel

— designed to store and manage UI-related data in a lifecycle conscious way. The ViewModel class allows data to survive configuration changes such as screen rotations.


ViewModel

—旨在以生命周期感知的方式存储和管理与UI相关的数据。 ViewModel类允许数据幸免于配置更改(例如屏幕旋转)。


Other:


其他:


ConstraintLayout

— for building flexible and efficient layouts. The Layout Editor uses constraints to determine the position of a UI element within the layout. A constraint represents a connection or alignment to another view, the parent layout, or an invisible guideline.


ConstraintLayout-

用于构建灵活高效的布局。 布局编辑器使用约束来确定UI元素在布局中的位置。 约束表示与另一个视图,父级布局或不可见准则的连接或对齐。


CardView

— element which represents the information in a card manner with a drop shadow (elevation) and corner radius which looks consistent across the platform.


CardView-

卡元素,以卡的方式表示信息,其阴影(高程)和角半径在整个平台上看起来是一致的。


RecyclerView

— a flexible and efficient version of ListView. It is a container for rendering large data set of views that can be recycled and scrolled very efficiently.


RecyclerView

-ListView的灵活高效的版本。 它是一个容器,用于呈现视图的大数据集,可以非常有效地对其进行回收和滚动。


Third-party:


第三方:


Dagger 2

— this is an entirely static, compile-time dependency injection framework for both Java and Android.


Dagger 2-

这是一个针对Java和Android的完全静态的编译时依赖项注入框架。


Retrofit 2

— an open source type-safe HTTP client for Android and Java. With Retrofit, we can compose the HTTP connection easily through a simple, expressive interface just like an API document.


Retrofit 2-

适用于Android和Java的开源类型安全的HTTP客户端。 借助Retrofit,我们可以像API文档一样,通过简单的表达性接口轻松地构成HTTP连接。


OkHttp

— an open source modern, fast and efficient HTTP client which supports HTTP/2 and SPDY.


OkHttp

—一个支持HTTP / 2和SPDY的开源,现代,快速,高效的HTTP客户端。


Gson

— an open source Java library to serialize and deserialize Java objects to and from JSON.


Gson

—一个开源Java库,用于在JSON之间对Java对象进行序列化和反序列化。


Glide

— a fast and efficient image loading library for Android focused on smooth scrolling. Glide offers an easy to use API, a performant and extensible resource decoding pipeline and automatic resource pooling.


Glide

—一个快速高效的Android图像加载库,专注于平滑滚动。 Glide提供了易于使用的API,高性能和可扩展的资源解码管道以及自动资源池。

配置一个新项目

(

Configuring a new project

)

We will create this project from scratch. So I’ll launch Android Studio, create a new Project, name it “My Crypto Coins” and select “Basic Activity”. At this point, there is nothing special to discuss. Our goal is to make a fresh, clean start and avoid any complexity in our minds by adding additional features (e.g., instant app support). We can add anything later if we want during the development process.

我们将从头开始创建该项目。 因此,我将启动Android Studio,创建一个新项目,将其命名为“ My Crypto Coins”,然后选择“ Basic Activity”。 在这一点上,没有什么特别的讨论。 我们的目标是通过添加其他功能(例如,即时应用支持)来重新开始,并避免任何复杂的事情。 如果需要,我们可以在开发过程中稍后添加任何内容。

For a start let’s include Kotlin language support and target

API 23: Android 6.0 (Marshmallow)

.

首先,让我们包括Kotlin语言支持和目标

API 23:Android 6.0(棉花糖)

Why am I not targeting a lower or higher API? Let’s face it. It’s nice to cut the support for some older devices and not worry about any compatibility issues during development. Also, I am a proud owner of an old

Nexus 7 (2013) tablet

, which is running Android 6.0.1. I hope to test my app live on it. 🙂 So for this individual project that impacted my minimum SDK choice.

为什么我不定位较低或较高的API? 面对现实吧。 最好减少对某些旧设备的支持,而不必担心开发过程中的任何兼容性问题。 另外,我还是旧版

Nexus 7(2013)平板电脑的

拥有者,该

平板电脑

运行Android 6.0.1。 我希望可以在上面测试我的应用程序。 🙂因此,对于这个影响我最小的SDK选择的单个项目。

Also as you’ve noticed, I am going to ask IDE to add automatically generated basic activity with fragment support and a floating action button. I feel all that could be useful for our project.

就像您已经注意到的那样,我将要求IDE添加带有片段支持和浮动操作按钮的自动生成的基本活动。 我觉得所有这些对于我们的项目可能都是有用的。


GitHub

— one of the most popular web-based hosting service for version control. This is an open source project, and of course, I will be using it.


GitHub-

最受欢迎的基于Web的版本控制托管服务之一。 这是一个开源项目,当然,我将使用它。

All the blog posts from this series will have its commits made as separate branches and the master branch for the latest source code version. Here is a link for you to the repository.

本系列中的所有博客文章都将其提交分别作为独立的分支和作为最新源代码版本的master分支进行。 这是您到存储库的链接。


在GitHub上查看源代码


(


View Source code on GitHub


)

That’s it for the start. If you have any questions, suggestions, remarks to make, please feel free to do that in comments. And now let’s learn together! Part 2 is up next… 😉

一开始就是这样。 如果您有任何疑问,建议或评论,请随时在评论中进行。 现在让我们一起学习! 接下来是第二部分……





Ačiū! Thanks for reading! I originally published this post for my blog

www.baruckis.com

on February 12, 2018.



阿奇!




谢谢阅读!




我最初于2018年2月12日在我的博客

www.baruckis.com

上发布了这篇文章。

翻译自:

https://www.freecodecamp.org/news/kriptofolio-app-series/

电子界卡组构建2019