Giter VIP home page Giter VIP logo

androidlibrary's Introduction

库引用说明

在自己项目的project对应的build.gradle里面添加如下代码:

	allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
			maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
		}
	}

在你项目的app_module对应的build.gradle里面引用此库(以1.1.0版本为例),如下:

  android {

     //此项配置也要添加
      compileOptions {
          sourceCompatibility JavaVersion.VERSION_1_8
          targetCompatibility JavaVersion.VERSION_1_8
      }
  }

  dependencies {
      implementation 'com.github.ShaoqiangPei:AndroidLibrary:1.1.0'
  }

在你的项目中自定义一个Application,然后在你的自定义ApplicationonCreate()中进行初始化,类似如下:

/**
 * Title:自定义application
 * description:
 * autor:pei
 * created on 2020/1/9
 */
public class AppContext extends Application {

    private static AppContext instance;

    public static synchronized AppContext getInstance() {
        return instance;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        instance = this;

        //初始化AndroidLibrary
        LibraryConfig.getInstance().init(this)
                //开启log调试,默认为关闭状态
                .setDebug(true)
		//是否打印设备屏幕信息,默认false
                //必须在setDebug之后调用,且当setDebug(true)时,setShowScreenInfo(true)才生效
                .setShowScreenInfo(true);
                
    }

}

在你项目的mainfast.xml中声明自己的application,类似如下:

 <application
        android:name=".AppContext"//声明自己的Application
	//以下省略
        //......
        >
    //此处省略
    //......

  </application>

使用说明

库引用说明记载的是最新版本的引用,若你使用的不是最新版本,请留意迭代说明上的迭代历程,以帮助你迅速接入你想使用的版本 本库引入你项目以后,若要了解各模块使用详细,请参见使用说明索引

androidlibrary's People

Contributors

shaoqiangpei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

androidlibrary's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.