How to Get Started With an Android App Template

Creating an attractive user interface for Android apps is almost always a time-consuming task, what with supporting dozens of Android versions, screen sizes, and pixel densities. These days, with more and more users expecting apps to adhere to the guidelines of Material Design, the task has arguably become even harder. Fortunately, CodeCanyon has several Android app templates you can use to jump-start the development of your next app.
In this tutorial, I'll help you get started with one such template, called Material Design UI Android Template App, which was developed by CreativeForm.

为Android应用程序创建有吸引力的用户界面几乎总是一个耗时的任务,支持几十个Android版本,屏幕尺寸和像素密度。 这些天,越来越多的用户期望应用程序遵循材料设计指南,这项任务可能变得更加困难。 幸运的是,CodeCanyon有多个Android应用程序模板,您可以使用它来快速开始下一个应用程序的开发。
在本教程中,我将帮助您开始使用一个这样的模板,称为Material Design UI Android模板应用程序,它由CreativeForm开发。

Prerequisites
To be able to follow this tutorial, you will need the latest version of Android Studio and an Android device or emulator that runs Android 2.3 or higher.
1. Get the Template
Start by signing in to your Envato Market account and purchasing the Material Design UI Android Template App on CodeCanyon.

You will now be able to find the source code of the template—in the form of a ZIP file—in the Downloads section.
After downloading the ZIP file and extracting it to a folder of your choice, you should have the following files and folders:

先决条件
要能够按照本教程,您将需要最新版本的Android Studio和运行Android 2.3或更高版本的Android设备或模拟器。
1.获取模板
首先登录您的Envato Market帐户,然后在CodeCanyon上购买Material Design UI Android模板应用程序。

现在,您可以在“下载”部分中找到模板的源代码(以ZIP文件的形式)。

下载ZIP文件并将其解压缩到所选的文件夹后,应该具有以下文件和文件夹:

2. Open the Template
The template can be used with both Eclipse and Android Studio. In this tutorial, however, let's focus only on the latter.
Fire up Android Studio and select the Open an existing Android Studio project option in the welcome menu. Navigate to the folder in which you extracted the template, select android - AS, and press OK.

2.打开模板
该模板可与Eclipse和Android Studio一起使用。 但在本教程中,我们只关注后者。
启用Android Studio,并在欢迎菜单中选择打开现有的Android Studio项目选项。 导航到您解压缩模板的文件夹,选择android - AS,然后按OK。

3. Configure the Template
Material Design UI Android Template App depends on several open-source libraries. The compileSdkVersion of some of those libraries is API Level 19, which is slightly older than that of the template itself. Therefore, to avoid build errors, you must update the libraries.
The following are the libraries that need to be changed:
StickyListHeaders
Progress Wheel
Open the build.gradle file of each library and change the value of compileSdkVersion to 21 so that it matches the compileSdkVersion of the template.
compileSdkVersion 21
Don't forget to press the Sync Now button after making the changes.

3.配置模板
材质设计UI Android模板应用程序依赖于几个开源库。 其中一些库的compileSdkVersion是API级别19,它比模板本身稍长。 因此,为了避免生成错误,必须更新库。
以下是需要更改的库:
StickyListHeaders
进步轮
打开每个库的build.gradle文件,并将compileSdkVersion的值更改为21,以使其与模板的compileSdkVersion匹配。
compileSdkVersion 21
在进行更改后,不要忘记按“立即同步”按钮。
4. Run the Template
At this point, you can go ahead and run the app template on your Android device or emulator. However, before you press the Run button, make sure that the UIAppTemplate run configuration is selected.

Note that the first time you try to run the app, you might encounter a few errors that are related to character encoding. The errors are present in a file called ProgressWheel.java, which belongs to the Progress Wheel library.
Character encoding errors
The easiest way to fix the errors is to open the file, make sure that its encoding is set to UTF-8, and save it.
Character encoding fix
Once the build completes, you should be able to see the home screen of the app template.

4.运行模板
此时,您可以在Android设备或模拟器上运行应用模板。 但是,在按Run按钮之前,请确保选择了UIAppTemplate运行配置。

请注意,第一次尝试运行应用程序时,您可能会遇到一些与字符编码相关的错误。 这些错误存在于名为ProgressWheel.java的文件中,该文件属于Progress Wheel库。
字符编码错误
修复错误最简单的方法是打开文件,确保其编码设置为UTF-8,并保存。
字符编码修复
一旦构建完成,您应该能够看到应用程序模板的主屏幕。

Conclusion
You can now start customizing Material Design UI Android Template App to match your requirements. It has over 50 different activities, five themes, and well over 100 layout XML files. That means you can build your next app by simply picking a subset of those UI elements and associating your data and business logic with it.

结论
您现在可以开始自定义Material Design UI Android模板应用程序以满足您的要求。 它有50多个不同的activities,五个主题,以及超过100个布局XML文件。 这意味着您可以通过简单选择这些UI元素的子集并将数据和业务逻辑关联起来来构建您的下一个应用程序。

更多相关文章

  1. Android(安卓)zip、tar+gz 压缩解压
  2. ios应用比android大,为什么iOS版APP安装文件比Android大几倍?
  3. 数据存储之——Android文件存储系统及文件系统(Android(安卓)Q)
  4. Android中的资源分析
  5. 数据存储之——Android内、外存储分区&常用存储目录详解(Android(
  6. 使用android快速开发框架afinal 开发android应用程序
  7. Android基础笔记(二)-数据存储和界面展现
  8. 想抢先体验Android操作系统的魅力吗?那就使用Android(安卓)LiveCD
  9. 如何发布你的Android应用程序

随机推荐

  1. 如何在Linux上安装Ruby
  2. 源代码是什么
  3. C#和C ++的区别是什么
  4. 浅谈Ruby和C语言之间的异同点
  5. C#中的数据类型是什么?C#中的四种数据类型
  6. erp系统是什么
  7. Ruby是什么?Ruby的优缺点
  8. 什么是C#中的多态性?
  9. auto是什么意思
  10. 在C,C ++和C#中的Int是什么