There are two ways to make a phone call on Android:
The first method is to make a call and jump to the dialing interface. The source code is as follows:
Intent intent = new Intent(Intent.ACTION_DIAL); Uri data = ("tel:" + "135xxxxxxxx"); (data); startActivity(intent);
The second method is to make a call directly, but some third-party roms (such as MIUI) do not make a call directly, but require the user to choose whether to make a call. The source code is as follows:
Intent intent = new Intent(Intent.ACTION_CALL); Uri data = ("tel:" + "135xxxxxxxx"); (data); startActivity(intent);
The first method does not require permission to apply for, and you can jump directly to the dialing interface.
The second method requires adding this permission to the AndroidMenifest file:<uses-permission android:name=".CALL_PHONE" />
, In Android 6.0, you also need to apply for permissions dynamically in the code.
The above are the two ways to make calls without applying for permission from Android. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to everyone in time!