Reputation: 35
I can only find guides for javascript implementations of what I am trying to do. I need to pull some sort of unique ID and send it to my web app for Auth verification.
The error I am receiving is
in MainActivity.kt: (22, 29): Unresolved reference: Settings
This is my MainActivity.kt
import android.provider.Settings.Secure;
class MainActivity : AppCompatActivity() {
private val androidId = Settings.Secure.getString(
contentResolver,
Settings.Secure.ANDROID_ID
)
}
For now I just want to be able to tack on the device_id as a php variable for my web app. Something like below:
private val url = "https://test.local?id=" + androidId
Upvotes: 0
Views: 1961
Reputation: 17834
You've imported android.provider.Settings.Secure
, not android.provider.Settings
.
Either change your import to android.provider.Settings
or use Secure.ANDROID_ID
instead of Settings.Secure.ANDROID_ID
.
Upvotes: 2