Search code examples
androidandroid-activityandroid-studiotelephonymanager

Not Able to Get Country Where User is Using My Android Application


I am not able to get Exact Country Where User is Using my Android Application. I tried Many Ways but not Getting the exact answer.

Firstly i Used TelephonyManager Like this but not getting exact Answer

TelephonyManager tMgr = (TelephonyManager) CheckCountry.this
                    .getSystemService(Context.TELEPHONY_SERVICE);
            phNo = tMgr.getLine1Number();

Then i used this But it return value by getting From My Mobile Settings

String locale = getApplicationContext().getResources()
                    .getConfiguration().locale.getCountry();

Have AnyOne Exact Solution by which I can get Country name then Let me Know


Solution

  • Well I found a better solution for this. By using This api I can get All the details about User Current Location And Country. Here is the API

    API to Get Country