android 常用 工具類 com.anguomob:lib 個人總結

再一次偶然的機會發現有一樣的輪子 

地址如下

https://github.com/Blankj/AndroidUtilCode

但是我的將會持續更新。。直至天荒地老

 

下面是我個人的類

git 地址 點我傳送  此處永遠是線上最新的代碼!!!!!

說明書在git README.md 內容同下 可能有會更改 大概如下

最新說明文檔 點我tp

有些代碼寫第一次 興致盎然,可再寫就索然無味了。

CSDN地址

bintray地址

(https://bintray.com/mp624183768/liuan)

爲了更好的使用 我已經添加了n多個權限

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
​
    <!-- um必須的權限 -->
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />
​
    <!-- um推薦的權限 -->
    <!-- 添加如下權限,以便使用更多的第三方SDK和更精準的統計數據 -->
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

目錄大綱

  • AesUtils 對字符串的加密和解密

  • Common 一些常用的類反饋郵箱 版本號

  • DevicesInfoUtils 手機的各項信息

  • FileUtils 設置SD卡路徑

  • Firebase 對於Firbase 統計的封裝

  • LiuanUtils 初始化程序 是否設置友盟統計

  • LogUtils 對log的封裝 debug 能看 relase 不能看

  • OsUtils 獲取手機是不是MIUI 和MIUI版本 支持小米 華爲 魅族

  • PermisstionUtil 安卓6.0權限請求工具類

  • RecordCollection 記錄自定義事件的工具類 友盟需要申請纔可以Firbase不用

  • SpUtils 對ShardedPreferences 的封裝

  • TextUtils 對獲取字符串的封裝 往本地文件追加 刪除 獲取行內容

  • TimeUtils 對SimpleDateFormat 的轉換

  • ToastUtils 對Toast的封裝

    使用方法

    項目級 build.gardle->buildscript->repositories

    加上jcenter()這個庫

    moudle級別 build.gradle->android->dependencies

    加上 implementation 'com.anguomob:lib:1.4.2' 這個包

    程序最先執行的地方

    Application->onCreate() or MainActivity ->onCreate() 下

    LiuanUtils.init(this,"")

    小技巧

    如果你覺得代碼也不是很好,可以把更好的發我郵箱上[email protected] 然後把好的代碼 複製到自己需要的地方,只有開源 才能讓代碼更完善。

    未來

    此程序只是本人花了少許時間弄的 完全達不到要啥有啥的程度,本人後續會繼續完善,直到要啥有啥的 咳咳 程度

 

 

https://blog.csdn.net/mp624183768/article/details/93365480

以下是更新日誌

2019年6月22日 21:12:14 

適配oppo彈框
2019年10月15日 00:58:15
1.1.5發佈 適配 androidX

使用:app》build.gradle

implementation 'com.anguomob:lib:1.4.2'

 

application  下onCreate 第一句

 適配留海狀態欄 1.1.8版本

StatusBarUtil.initStatusBar(this,true, R.color.color_main);

 最外層佈局記得加上 

    android:fitsSystemWindows="true"

 如下

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@android:color/background_dark"
    android:fitsSystemWindows="true">


    <cn.jzvd.JzvdStd
        android:id="@+id/jz_video"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</RelativeLayout>

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章