private fun addContactToSim(number:String,name:String) {
try {
val simUri = Uri.parse("content://icc/adn")
val values = ContentValues()
values.put("number", number)
values.put("tag", name)
context.getContentResolver().insert(simUri, values)
}
catch (e:Exception)
{
e.printStackTrace()
}
}
This is my Code. I am trying to create a contact. I want save contact in selected sim. If the user clicks on "save contact" then the app should ask if user wants to save it in 'SIM1' or 'SIM2' . Then when the user selects a SIM then it should save the contact in the appropriate sim.
But i don't know how to check if the phone has dual sim and how I will get path of sim.
Please help me.