telephonymanager

Sign App with UICC Carrier Privileges Certificates

喜夏-厌秋 提交于 2019-12-18 13:54:18
问题 I was reading information on this link in regards to signing an application with carrier privileges. I am aware of how to sign an application using a keystore for production releases, but how do I add UICC certificates to my app so it gets carrier privileges? My main goal is to be able to call TelephonyManager functions like: iccOpenLogicalChannel iccCloseLogicalChannel iccTransmitApduLogicalChannel iccTransmitApduBasicChannel This is the stack trace I get when calling one of the above

How do I get information about a phone's IMEI in Android 10?

余生长醉 提交于 2019-12-17 20:32:40
问题 Before Android 10, I was using the TelephonyManager API to retrieve that info, but it's no longer working in Android 10. 回答1: From the Android Developers Documentation Website Starting in Android 10, apps must have the READ_PRIVILEGED_PHONE_STATE privileged permission in order to access the device's non-resettable identifiers, which include both IMEI and serial number. Third-party apps installed from the Google Play Store cannot declare privileged permissions. If your app doesn't have the

dual sim android phone which sim receive a call

徘徊边缘 提交于 2019-12-17 20:28:02
问题 I have an android application that detect the incoming calls, i need to improve this app to work on a duos mobile device. so i create a broadcast receiver registered in manifest for actions: phone state changed and on my onReceive method i need to check which sim receive the call. This is my code Protected void onReceive(Context c, Intent i) { Int whichSim = intent getIntExtra("simSlot",-1); // so this methof return 0 for sim 1 and 1 for sim2 If(whichSim==-1) WhichSim=intent.getIntExtra("com

Make call using a specified SIM in a Dual SIM Device

落花浮王杯 提交于 2019-12-17 10:55:09
问题 I have been searching for this from past few days and I came to know that: "Dual SIM is not supported in Android out of the box. It is a custom modification by manufacturers, and there is no public API to control it." There is a solution provided in the below link but its not working on my phone Samsung Galaxy S4 Mini. Call from second sim I also found this link, which I found very informative. http://www.devlper.com/2010/06/using-android-telephonymanager/ Now I know that using the following

getAllCellInfo returns null in android 4.2.1

走远了吗. 提交于 2019-12-17 09:45:59
问题 My Android version is 4.2.1 and I am trying to make use of TelephonyManager.getAllCellInfo() method. In my manifest file I have the ACCESS_COARSE_UPDATES , ACCESS_COARSE_LOCATION , ACCESS_FINE_LOCATION permissions. However that method returns null . 回答1: From TelephonyManager.getAllCellInfo() javadoc: This is preferred over using getCellLocation although for older devices this may return null in which case getCellLocation should be called. Some sources report that this method is only

How to monitor SIM state change

一笑奈何 提交于 2019-12-17 04:53:26
问题 I'd like to be able to do some stuff when the SIM state change, i.e. play a sound when SIM PIN is required, but I think there are no Broadcast events that can be intercepted by a broadcast receiver for this... registering for android.intent.action .PHONE_STATE does only tell you when the CALL-STATE changes.. An alternative can be starting a service that registers a PhoneStateListener and reacts upon a LISTEN_SERVICE_STATE (when the state is OUT-OF-STATE it can get the SIM state from the

How to monitor SIM state change

蓝咒 提交于 2019-12-17 04:53:04
问题 I'd like to be able to do some stuff when the SIM state change, i.e. play a sound when SIM PIN is required, but I think there are no Broadcast events that can be intercepted by a broadcast receiver for this... registering for android.intent.action .PHONE_STATE does only tell you when the CALL-STATE changes.. An alternative can be starting a service that registers a PhoneStateListener and reacts upon a LISTEN_SERVICE_STATE (when the state is OUT-OF-STATE it can get the SIM state from the

How to know whether I am in a call on Android?

柔情痞子 提交于 2019-12-17 03:57:07
问题 I want to know whether I am in a call. If I am in a call then start the service (service part is clear). How do I do this? While attending the call I need to call the service... I am unaware of how to do this? Any help? 回答1: You need broadcast receiver ... In manifest declare broadcast receiver ... <receiver android:name=".PhoneStateBroadcastReceiver"> <intent-filter> <action android:name="android.intent.action.PHONE_STATE"/> </intent-filter> </receiver> Also declare uses-permission ... <uses

getPsc() using GsmCellLocation always returns -1

早过忘川 提交于 2019-12-13 13:25:36
问题 I'm successfully getting GsmCellLocation and related cid and lac information but the PSC (primary scrambling code) of the serving cell is always coming back with the initialized value -1. Anyone able to get the real PSC value of the serving cell? telephonyManager = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE); GsmCellLocation cellLocation = (GsmCellLocation) telephonyManager.getCellLocation(); psc = cellLocation.getPsc(); Log.d(TAG, "PSC = " + psc); I have all the permissions

How to get cell phone number in android?

你离开我真会死。 提交于 2019-12-13 06:35:51
问题 How to get cell phone number in android ? Here is code. but it's not working TelephonyManager tm = (TelephonyManager)this.getSystemService(this.TELEPHONY_SERVICE); String mobileno = tm.getLine1Number(); can anyone help me to solve this. 回答1: You can use these lines of code to fetch cell phone numbers from your phone contacts picker. try { Intent i = new Intent(Intent.ACTION_PICK,ContactsContract.CommonDataKinds.Phone.CONTENT_URI); startActivityForResult(i, PICK_CONTACT); Toast.LENGTH_SHORT)