Android Library Module: Can expand TextView

Source: Internet
Author: User

Objective

Sometimes some of the open source projects we see on GitHub (from Android Studio) are not a complete Android project, but just a library Module, how do we refer to these libraries Module to our own Android module? In fact, the official website also introduced quite clear, but as a beginner really need a more complete guide, so as to avoid wasting too much time. The following is a reference to an open Source library project examples, simple translation of official documents,
Http://developer.android.com/sdk/installing/create-project.html#SettingUpLibraryModule

Steps
    • 0, first we need to download the source code in Https://github.com/Manabu-GT/ExpandableTextView, can not be http://download.csdn.net/detail/leelit/8546629 in the download.
    • 1. Import the Library module into project (note that project is equivalent to workspace in eclipse in as and the module is equivalent to project): File-import module- Find the appropriate library Module
    • 2. Open Project View, click on our project, then find the imported library, click on Build.gradle, comment out the last line of code (otherwise, you will get an error, see
    • http://stackoverflow.com/questions/28450549/ Errorno-such-property-group-for-class-org-gradle-api-publication-maven-intern), preferably also will own Android The Compilesdkversion, buildtoolsversion, and Defaultconfig of Build.gradle in module are copied here. Back to Android view you can find one more module.
    • 3, File-project structure-android module (General app)-dependencies-plus-module Dependency-check-OK
    • 4. If there are some components in the Android module that are used in the library module, such as activity, broadcast Receiver, service, etc., it needs to be declared in the manifest file, and the full package name is required.
Subsequent

This is where we have finished referencing library project. But we still complete this process, how to use this open source project? can refer to
Https://github.com/Manabu-GT/ExpandableTextView

In fact, many of the source code with a sample, I have the contents of the sample castrated a little. The final presentation is this:

Android Library Module: Can expand TextView

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.