Git Product home page Git Product logo

androidcommon's Introduction

How to use In Android Studio

compile 'com.code19.library:library:0.1.4'

notes

0.1.4 removed ToastUtils,ViewUtils.java,SpannableStringUtils.java,if you used then,you can use 0.1.2.

Common Utils

Demo:
AppUtils.getAppName(MainActivity.this,"com.code19.androidcommon");

library Module:

  • AppUtils.java (about Application tools)

    • getAppName
    • getAppIcon
    • getAppFirstInstallTime
    • getAppLastUpdateTime
    • getAppSize
    • getAppApk
    • getAppVersionName
    • getAppVersionCode
    • getAppInstaller
    • getAppSign
    • getAppTargetSdkVersion
    • getAppUid
    • getNumCores
    • getRootPermission
    • getAppPermissions
    • hasPermission
    • isInstalled
    • installApk
    • uninstallApk
    • isSystemApp
    • isServiceRunning
    • stopRunningService
    • killProcesses
    • runScript
    • runApp
    • cleanCache
    • cleanDatabases
    • cleanSharedPreference
  • CipherUtils.java

    • md5(String input)
    • md5L(String input)
    • md5(InputStream in)
    • base64Encode
    • base64Decode
    • XorEncode
    • XorDecode
    • sha1(String str)
    • sha1(File file)
  • DateUtil.java

    • formatDataTime
    • formatDate
    • formatTime
    • formatDateCustom
    • string2Date
    • getDate
    • getTime
    • getDateTime
    • subtractDate
    • getDateAfter
    • getWeekOfMonth
    • getDayOfWeek
  • DensityUtil.java

    • dip2px
    • dip2sp
    • px2dip
    • px2sp
    • sp2px
    • sp2dip
    • getScreenW
    • getScreenH
    • getScreenRealSize
    • getStatusBarH
    • getNavigationBarrH
  • DeviceUtils.java

    • getAndroidID
    • getIMEI
    • getIMSI
    • getWifiMacAddr
    • getIP
    • getWifiIP
    • getGPRSIP
    • getSerial
    • getSIMSerial
    • getMNC
    • getCarrier
    • getModel
    • getBuildBrand
    • getBuildHost
    • getBuildTags
    • getBuildTime
    • getBuildUser
    • getBuildVersionRelease
    • getBuildVersionCodename
    • getBuildVersionIncremental
    • getBuildVersionSDK
    • getBuildID
    • getSupportedABIS
    • getManufacturer
    • getBootloader
    • getScreenDisplayID
    • getDisplayVersion
    • getLanguage
    • getCountry
    • getOSVersion
    • getGSFID
    • getBluetoothMAC
    • getPsuedoUniqueID
    • getFingerprint
    • getHardware
    • getProduct
    • getDevice
    • getBoard
    • getRadioVersion
    • getUA
    • getDensity
    • getGoogleAccounts
  • FileUtils.java

    • closeIO
    • isFileExist
    • writeFile
    • readFile
    • readFile
    • copyFile
    • copyFileFast
    • shareFile
    • zip
    • unzip
    • formatFileSize
    • Stream2File
    • createFolder
    • createFolder
    • getFileName
    • getFileSize
    • rename
    • getFolderName
    • getFilesArray
    • deleteFile
    • deleteFileByDirectory
    • openImage
    • openVideo
    • openURL
    • downloadFile
    • upgradeApp
    • isSDCardAvailable
    • getAppExternalPath
    • getExtraPath
  • JsonUtils.java

    • toJson
    • fromJson
    • mapToJson
    • collection2Json
    • object2Json
    • string2JSONObject
  • L.java

    • init //Init the Log set Debug and Tag
    • v VERBOSE
    • d DEBUG
    • i INFO
    • w WARN
    • e ERROR
    • a ASSERT
    • json
    • xml
  • NetUtils.java

    • getNetworkType
    • getNetworkTypeName
    • isConnected
    • isNetworkAvailable
    • isWiFi
    • openNetSetting
    • setWifiEnabled
    • setDataEnabled
    • getWifiScanResults
    • getScanResultsByBSSID
    • getWifiConnectionInfo
  • SPUtils.java

    • setSP
    • getSp
    • cleanAllSP
  • StringUtils.java

    • getChsAscii
    • convert
    • getSelling
    • parseEmpty
    • isEmpty
    • chineseLength
    • strLength
    • subStringLength
    • isChinese
    • isContainChinese
    • strFormat2
    • convert2Int
    • decimalFormat
  • SystemUtils.java

    • sendSMS
    • forwardToDial
    • sendMail
    • openWeb
    • openContacts
    • openSettings
    • hideKeyBoard
    • isBackground
    • isSleeping
    • installApk
    • isRooted
    • isRunningOnEmulator
    • goHome
    • hexdigest
    • getDeviceUsableMemory
    • gc
    • getProcessName
    • createDeskShortCut
    • createShortcut
    • shareText
    • shareFile
    • getShareTargets
    • getCurrentLanguage
    • getLanguage
    • isGpsEnabled
    • showSoftInputMethod
    • closeSoftInputMethod
    • showSoftInput
    • closeSoftInput
    • toWeChatScan
    • toAliPayScan
    • toAliPayPayCode
    • getRandomNumber
  • VerificationUtils.java

    • matcherRealName
    • matcherPhoneNum //just matcher chinese phone number
    • matcherAccount
    • matcherPassword
    • matcherPassword2
    • matcherEmail
    • matcherIP
    • matcherUrl
    • isNumeric
    • testRegex

Thanks to all the open source programmers

License

  Copyright (C)  2016 [email protected]

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.

androidcommon's People

Contributors

h4de5ing avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

androidcommon's Issues

Attempt to invoke virtual method 'int android.net.NetworkInfo.getType()' on a null object reference

NetUtlis.class类,出现错误,建议还是做一下是否为null的判断
public static boolean isWiFi(Context cxt) {
ConnectivityManager cm = (ConnectivityManager) cxt.getSystemService(Context.CONNECTIVITY_SERVICE);
// wifi的状态:ConnectivityManager.TYPE_WIFI
// 3G的状态:ConnectivityManager.TYPE_MOBILE
return cm.getActiveNetworkInfo().getType() == ConnectivityManager.TYPE_WIFI;
}

bug阿

L.java 不能打长日志阿 老只有一半阿 坑爹阿

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.