Reputation: 33
Due to recent policy changes, it's very difficult to gain permission to use the READ_CALL_LOG permission on Google Play. Our app searches for the incoming caller's number in our app and if there is a match, show Caller ID information inputted in our app. Thus, we are not a default phone app, but just need access to only the incoming caller's number. Are there any alternatives to READ_CALL_LOG to get the caller's number?
Upvotes: 3
Views: 2226
Reputation: 168
Here how I have achieved this -
Step 1:
Created a CallActivity and read the all call log in onCreate
and displayed in listview with a button Call.
Step 2: When user click on button Call this code get fired
Intent intent = new Intent(Intent.ACTION_DIAL, Uri.fromParts("tel", "1234567890", null));
context.startActivity(intent);
Step 3: In AndroidManifest file update this (For newly created activity only - CallActivity)
<activity
android:name=".CallActivity"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.DIAL" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:mimeType="vnd.android.cursor.item/phone" />
<data android:mimeType="vnd.android.cursor.item/person" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.DIAL" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="voicemail" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.DIAL" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.DIAL" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="tel" />
</intent-filter>
</activity>
You are done.
I was also able to publish my app in play store with CALL_READ_PERMISSION and filled the google policy form with CALLER ID app section. In my case user authentication required to I push the demo account credentials.
Upvotes: 0
Reputation: 106
Android 9 introduces the CALL_LOG permission group and moves the READ_CALL_LOG, WRITE_CALL_LOG, and PROCESS_OUTGOING_CALLS permissions into this group. In previous versions of Android, these permissions were located in the PHONE permission group.
Please go through this link
https://developer.android.com/about/versions/pie/android-9.0-changes-all
Upvotes: 0