[go: up one dir, main page]

Skip to content

androidroadies/AndroidUtils

Repository files navigation

Android App Common Tasks

Android App Common Tasks library is developed to reduce efforts to achieve common features of the android apps. While developing the apps, we realized that we’re coding for many common tasks in all the apps. For e.g. check the network’s availability, using shared preferences, parsing, etc. And like us, many other android developers might be doing the same. So it needs to be reduced for all to save the development time with ease. And so, we decided to develop a library which can reduce developers’ time and efforts.

  • This Project contains Library of commonly used methods, classes and it's examples.

  • Library also contains easy way to implement social sdk i.e : Facebook, Twitter, Google+, LinkedIn.

This Project includes following common features.

EditText empty validation.
Check network available or not (Internet or Wifi).
Email address validation.
Get current date in String format.
Get device id of from your device.
Set Preferences and get Preferences. Like String, int, long, Boolean, Float.
Remove all preferences. 
Get current location.
Pinch Zoom on image.
Get application Icon drawable.
Send local notification.
Disable sleep mode on while using application.
Enable sleep mode on while using application.
Open image from selected directory path.
Open video from selected directory path.
Open URL to mobile browser.
Shows address location on map.
Create folder or directory.
Download image from URL.
Show date picker.
Show time picker.
Get number of file counts.
Calculate date difference.
Convert date from string to date format.
Get device height.
Get device width.
Get random number.
Add postfix to numbers.
Convert comma separated string to array list.
Convert arrayList to comma separated string.
Play background music.
Stop background music.
Apply blur effect on image.
Convert drawable to bitmap.
Convert bitmap to drawable.
Get device volume for application for sound.
Set bitmap image to preferences.
Get bitmap image form preference.
Get application version code.
Set vertical text-view (left & right).
Check Whether Sd card is available on Device.
Show Share Dialog.
Change Device Profile (Silent or Vibrate or Normal).
Change bitmap to Rounded Cornered.
Show Alert Dialog or Toast.
Preventing double click.
Capture Image.
Pick Image.
Preview Captured Image.
Record Video.
Pick Video.
Preview Captured Video.
Get path of picked image or video (for all versions).
Integrating Social Platforms.
Adding Ripple Effect.
Check Website url is valid or not.
Get all contacts that have email address.
Get bitmap of view (ScreenShot).
Pick Color from ImageView.
Get File Size.
Download File.
Invoke callback after ImageView is loaded.
Notif ImageView

API

isActivityExists
startActivity
getLauncherActivity
getTopActivity
isInstallApp
installApp
installAppSilent
uninstallApp
uninstallAppSilent
isAppRoot
launchApp
getAppPackageName
getAppDetailsSettings
getAppName
getAppIcon
getAppPath
getAppVersionName
getAppVersionCode
isSystemApp
isAppDebug
getAppSignature
getAppSignatureSHA1
isAppForeground
getForegroundApp
getAppInfo
getAppsInfo
cleanAppData
setTransparentStatusBar
hideStatusBar
getStatusBarHeight
isStatusBarExists
getActionBarHeight
showNotificationBar
hideNotificationBar
cleanInternalCache
cleanInternalFiles
cleanInternalDbs
cleanInternalDbByName
cleanInternalSP
cleanExternalCache
cleanCustomCache
copyText
getText
copyUri
getUri
copyIntent
getIntent
closeIO
closeIOQuietly
bytes2HexString, hexString2Bytes
chars2Bytes, bytes2Chars
memorySize2Byte, byte2MemorySize
byte2FitMemorySize
timeSpan2Millis, millis2TimeSpan
millis2FitTimeSpan
bytes2Bits, bits2Bytes
input2OutputStream, output2InputStream
inputStream2Bytes, bytes2InputStream
outputStream2Bytes, bytes2OutputStream
inputStream2String, string2InputStream
outputStream2String, string2OutputStream
bitmap2Bytes, bytes2Bitmap
drawable2Bitmap, bitmap2Drawable
drawable2Bytes, bytes2Drawable
view2Bitmap
dp2px, px2dp
sp2px, px2sp
getInstance
init
isDeviceRooted
getSDKVersion
getAndroidID
getMacAddress
getManufacturer
getModel
shutdown
reboot
reboot2Recovery
reboot2Bootloader
isEmpty
isNotEmpty
urlEncode
urlDecode
base64Encode
base64Encode2String
base64Decode
base64UrlSafeEncode
htmlEncode
htmlDecode
encryptMD2, encryptMD2ToString
encryptMD5, encryptMD5ToString
encryptMD5File, encryptMD5File2String
encryptSHA1, encryptSHA1ToString
encryptSHA224, encryptSHA224ToString
encryptSHA256, encryptSHA256ToString
encryptSHA384, encryptSHA384ToString
encryptSHA512, encryptSHA512ToString
encryptHmacMD5, encryptHmacMD5ToString
encryptHmacSHA1, encryptHmacSHA1ToString
encryptHmacSHA224, encryptHmacSHA224ToString
encryptHmacSHA256, encryptHmacSHA256ToString
encryptHmacSHA384, encryptHmacSHA384ToString
encryptHmacSHA512, encryptHmacSHA512ToString
encryptDES, encryptDES2HexString, encryptDES2Base64
decryptDES, decryptHexStringDES, decryptBase64DES
encrypt3DES, encrypt3DES2HexString, encrypt3DES2Base64
decrypt3DES, decryptHexString3DES, decryptBase64_3DES
encryptAES, encryptAES2HexString, encryptAES2Base64
decryptAES, decryptHexStringAES, decryptBase64AES
getFileByPath
isFileExists
rename
isDir
isFile
createOrExistsDir
createOrExistsFile
createFileByDeleteOldFile
copyDir
copyFile
moveDir
moveFile
deleteDir
deleteFile
listFilesInDir
listFilesInDir
listFilesInDirWithFilter
listFilesInDirWithFilter
listFilesInDirWithFilter
listFilesInDirWithFilter
searchFileInDir
writeFileFromIS
writeFileFromString
readFile2List
readFile2String
readFile2Bytes
getFileLastModified
getFileCharsetSimple
getFileLines
getDirSize
getFileSize
getDirLength
getFileLength
getFileMD5
getFileMD5ToString
getDirName
getFileName
getFileNameNoExtension
getFileExtension
addFragment
hideAddFragment
addFragments
removeFragment
removeToFragment
removeFragments
removeAllFragments
replaceFragment
popFragment
popToFragment
popFragments
popAllFragments
popAddFragment
hideFragment
hideFragments
showFragment
hideShowFragment
getLastAddFragment
getLastAddFragmentInStack
getTopShowFragment
getTopShowFragmentInStack
getFragments
getFragmentsInStack
getAllFragments
getAllFragmentsInStack
getPreFragment
findFragment
dispatchBackPress
setBackgroundColor
setBackgroundResource
setBackground
HandlerHolder
bitmap2Bytes, bytes2Bitmap
drawable2Bitmap, bitmap2Drawable
drawable2Bytes, bytes2Drawable
getBitmap
scale
clip
skew
rotate
getRotateDegree
toRound
toRoundCorner
fastBlur
renderScriptBlur
stackBlur
addFrame
addReflection
addTextWatermark
addImageWatermark
toAlpha
toGray
save
isImage
getImageType
compressByScale
compressByQuality
compressBySampleSize
getInstallAppIntent
getUninstallAppIntent
getLaunchAppIntent
getAppDetailsSettingsIntent
getShareTextIntent
getShareImageIntent
getComponentIntent
getShutdownIntent
getCaptureIntent
hideSoftInput
clickBlankArea2HideSoftInput
showSoftInput
toggleSoftInput
isGpsEnabled
isLocationEnabled
openGpsSettings
register
unregister
getAddress
getCountryName
getLocality
getStreet
isBetterLocation
isSameProvider
Builder.setLogSwitch
Builder.setGlobalTag
Builder.setLogHeadSwitch
Builder.setLog2FileSwitch
Builder.setDir
Builder.setBorderSwitch
Builder.setLogFilter
v
d
i
w
e
a
file
json
xml
openWirelessSettings
isConnected
isAvailableByPing
getDataEnabled
setDataEnabled
is4G
getWifiEnabled
setWifiEnabled
isWifiConnected
isWifiAvailable
getNetworkOperatorName
getNetworkType
getIPAddress
getDomainAddress
isPhone
getIMEI
getIMSI
getPhoneType
isSimCardReady
getSimOperatorName
getSimOperatorByMnc
getPhoneStatus
dial
call
sendSms
sendSmsSilent
getAllContactInfo
getContactNum
getAllSMS
ccs2Pinyin
ccs2Pinyin
getPinyinFirstLetter
getPinyinFirstLetters
getSurnamePinyin
getSurnameFirstLetter
getForegroundProcessName
killAllBackgroundProcesses
killBackgroundProcesses
isMobileSimple
isMobileExact
isTel
isIDCard15
isIDCard18
isEmail
isURL
isZh
isUsername
isDate
isIP
isMatch
getMatches
getSplits
getReplaceFirst
getReplaceAll
getScreenWidth
getScreenHeight
setLandscape
setPortrait
isLandscape
isPortrait
getScreenRotation
captureWithStatusBar
captureWithoutStatusBar
isScreenLock
isSDCardEnable
getSDCardPath
getDataPath
getFreeSpace
getSDCardInfo
getAllRunningService
startService
stopService
bindService
unbindService
isServiceRunning
execCmd
dp2px, px2dp
sp2px, px2sp
applyDimension
forceGetViewSize
measureView
getMeasuredWidth
getMeasuredHeight
showShort
showLong
showIndefinite
addView
dismiss
Builder.setFlag
Builder.setForegroundColor
Builder.setBackgroundColor
Builder.setQuoteColor
Builder.setLeadingMargin
Builder.setMargin
Builder.setBullet
Builder.setFontSize
Builder.setFontProportion
Builder.setFontXProportion
Builder.setStrikethrough
Builder.setUnderline
Builder.setSuperscript
Builder.setSubscript
Builder.setBold
Builder.setItalic
Builder.setBoldItalic
Builder.setFontFamily
Builder.setTypeface
Builder.setAlign
Builder.setBitmap
Builder.setDrawable
Builder.setUri
Builder.setResourceId
Builder.setClickSpan
Builder.setUrl
Builder.setBlur
Builder.append
Builder.create
SPUtils
put
getString
getInt
getLong
getFloat
getBoolean
getAll
remove
contains
clear
isEmpty
isTrimEmpty
isSpace
equals
equalsIgnoreCase
null2Length0
length
upperFirstLetter
lowerFirstLetter
reverse
toDBC
toSBC
ThreadPoolUtils
execute
execute
shutDown
shutDownNow
isShutDown
isTerminated
awaitTermination
submit
submit
invokeAll, invokeAny
schedule
schedule
scheduleWithFixedRate
scheduleWithFixedDelay
millis2String
string2Millis
string2Date
date2String
date2Millis
millis2Date
getTimeSpan
getFitTimeSpan
getNowMills
getNowString
getNowDate
getTimeSpanByNow
getFitTimeSpanByNow
getFriendlyTimeSpanByNow
getMillis
getString
getDate
getMillisByNow
getStringByNow
getDateByNow
isToday
isLeapYear
getChineseWeek
getUSWeek
getWeekIndex
getWeekOfMonth
getWeekOfYear
getChineseZodiac
getZodiac
setGravity
setView
getView
showShortSafe
showLongSafe
showShort
showLong
cancel
zipFiles
zipFile
unzipFiles
unzipFile
unzipFileByKeyword
getFilesPath
getComments
getEntries

How to use

// init it in the function of onCreate in ur Application
Utils.init(context);

Proguard

-keep class com.common.utilcode.** { *; }
-keepclassmembers class com.common.utilcode.** { *; }
-dontwarn com.common.utilcode.**

##Demo You can download the demo apk from here .

##Documentation Refer CommonTaskDoc.pdf for learning how to use methods of this SDK.

=======

LICENSE

The MIT License (MIT)

Copyright (c) 2015

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published