0

Hello I would like to use some function from com.android.dialer.telecom.TelecomUtil inside some java class from an android I'm building but I don't know what dependency I should add to build.graddle to do so

Anyone familiar with this ?

TIA

Leadev
  • 53
  • 5

1 Answers1

0

I don't know what dependency I should add to build.graddle to do so

Assuming that you mean this edition of TelecomUtil, that is not in a library. It is a Java class in the Dialer app from the AOSP.

If you are writing your own AOSP app, such as a custom dialer as part of custom firmware, you can copy TelecomUtil.java into your own project, along with other Dialer app classes that TelecomUtil depends upon (e.g., com.android.dialer.common.LogUtil). Or, copy just the method(s) from TelecomUtil that you need.

If you are writing an ordinary Android SDK app, you can try doing the same thing. You may run into places where the copied code depends upon classes or methods are are not part of the Android SDK, though.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • Thank you very much CommonsWare, in fact what I'm trying to do is making a phone call programmatically in an ordinary apk on a rooted device. I used to execute the shell command su -c am start -a android.intent.action.CALL -d "+number but it does not work on android 10 so I tried to implement what is described in the answer to this question https://stackoverflow.com/questions/63394205/make-a-call-using-action-call-intent-on-android-10-doesnt-work but I could not access to TelecomUtil – Leadev Jul 24 '21 at 16:55