Dear friends!
Locate in the project that we passed android interface opening
access to Haoma way the city is not in our customers success, do not achieve
the occasional caller ID, test out the Results Based on customer reaction
said: six times as access to one, thencustomers and were tested by removing
an application on the phone can get access to but the second has not, then
delete and then successfully obtained a "delete a" once such a conclusion
can be successful, lead to such problems Our position is very difficult, I
saw yesterday source, in the source code TelephonyRegistry class can be seen
directly on the phone now that the call number in the updateDisplayForPerson
method [mPhoneNumber.setText (displayNumber);], but these did not android open
interfaces and API which provides a way to get only
android.telephony.PhoneStateListener or according to source
[TelephonyRegistry.broadcastCallStateChanged (int state, String
incomingNumber) method of the last line mContext.sendBroadcast (intent,
android.Manifest.permission.READ_PHONE_STATE);]Another way to accept the
broadcast, which we have tried two methods, conclusions are sometimes the
client side to get to the number, the customer is located the city as the
capital city of a province of China, and left that phone customers in
Nanjing, China(also China's capital city of a province) has been on our side
can get to the call number, and the customer when we were in Nanjing
demonstrates to him, when did this issue did not arise, when we can get to
the call number , I also checked the Internet a lot of information and
basically had no corresponding argument, asked a few of the companies and
companies outside the android counterparts, they have never encountered a
similar problem to give any reference of views, there is no way the case I
thought to ask you, hope you have this experience or understanding of this
issue have more to give me a peer-cause of the problem or the solutions, not
very grateful.
code:
public class PhoneStateBroadcastReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
TelephonyManager tm = (TelephonyManager) context
.getSystemService(Service.TELEPHONY_SERVICE);
switch (tm.getCallState()) {
case TelephonyManager.CALL_STATE_RINGING:
//The following "incomingNumber" This value, sometimes to have access to,
and sometimes for less than
incomingNumber =
intent.getStringExtra("incoming_number");
Logic...
break;
}
}
<receiver android:name=".PhoneStateBroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.PHONE_STATE" />
</intent-filter>
</receiver>
<uses-permission android:name="android.permission.ADD_SYSTEM_SERVICE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission
android:name="android.permission.WRITE_APN_SETTINGS"></uses-permission>
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<uses-permission
android:name="android.permission.READ_CONTACTS"></uses-permission>
<uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS" />
<uses-permission android:name="android.permission.ACCESS_SURFACE_FLINGER" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en