Skip to content

Commit

Permalink
add getAndroidId()
Browse files Browse the repository at this point in the history
  • Loading branch information
yizems committed Jun 19, 2022
1 parent 218fd71 commit 78057ce
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
10 changes: 10 additions & 0 deletions WIKI_ALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -950,3 +950,13 @@ fun EditText.removeFocusChangeListener(focusChangedListener: View.OnFocusChangeL

```

### DeviceInfo.kt 设备信息

```kotlin
/**
* 获取AndroidId
* @see Settings.Secure.ANDROID_ID
*/
fun getAndroidId(): String
```

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package cn.yizems.util.ktx.android.device

import android.provider.Settings
import cn.yizems.util.ktx.android.context.getGlobalContext

/**
* 获取AndroidId
* @see Settings.Secure.ANDROID_ID
*/
fun getAndroidId(): String {
return Settings.System.getString(getGlobalContext().contentResolver, Settings.Secure.ANDROID_ID)
}

0 comments on commit 78057ce

Please sign in to comment.