telephonymanager - Is it possible to retrieve the phone numbers of both the dual sim cards in Android programmatically. -
i did refer 1 of answers suggested before , edited because sim index not checked in answer. here's used.
subscriptionmanager subscriptionmanager = subscriptionmanager.from(getapplicationcontext()); list<subscriptioninfo> subsinfolist = subscriptionmanager.getactivesubscriptioninfolist(); (subscriptioninfo subscriptioninfo : subsinfolist) { log.d("test", "current list = " + subscriptioninfo); integer index=subscriptioninfo.getsimslotindex(); if(index==1) { log.d("test", " number " + subscriptioninfo.getnumber()); } else log.d("test", " number " + subscriptioninfo.getnumber()); }
but i'm unable number of sim used in slot 1, number of sim in index 0 received.
here's logcat
current list = {id=2, iccid=89918620400015502403 simslotindex=0 displayname=jio 4g 01 carriername=jio 4g namesource=0 icontint=-16746133 dataroaming=1 iconbitmap=android.graphics.bitmap@6443203 mcc 405 mnc 862} d/test: number 1234567//it's made number. did actual number d/test: current list = {id=3, iccid=89919509129941235317 simslotindex=1 displayname=airtel 02 carriername=airtel namesource=0 icontint=-13408298 dataroaming=1 iconbitmap=android.graphics.bitmap@3986580 mcc 404 mnc 95} d/test: number
as seen in logcat, cannot number sim in slotindex 1. many other details of 2nd sim can retrieved including displayname, carriername etc. subscriptioninfo.getnumber(), works 1 sim.
Comments
Post a Comment