2

Every time I try to import it, it gives me this error:

The import com.android.internal.telephony.ITelephony cannot be reselved.

It may seem like a novice question but I am really stumped and I cannot find any other answers.

David Wasser
  • 93,459
  • 16
  • 209
  • 274
DevoidSylph
  • 55
  • 1
  • 2
  • 7
  • 1
    If you are an app developer you really aren't really supposed to be importing Android internal classes, so they are likely not exposed by the SDK, but only by the build system for Android internals. What are you building? – Chris Stratton Dec 06 '13 at 19:48
  • I was trying to make an app that blocks incoming calls for a time interval, sort of "Do not Disturb", and this was the way that I was indicated to follow. – DevoidSylph Dec 06 '13 at 20:06
  • Where did you get the tip to use ITelephony? – David Wasser Dec 06 '13 at 21:39

2 Answers2

1

That's not a public class which is exposed as part of the SDK. Only internal platform apps/services/framework can include or use that class.

Larry Schiefer
  • 15,687
  • 2
  • 27
  • 33
-2

Android has two types of APIs that are not accessible via SDK.

The first one is located in package com.android.internal. I will refer to this API as to internal API. The second API type is collection of classes and functions that are marked with @hide javadoc attribute. Even though this strictly is not a single API but a collection of small hidden APIs, I still going to assume this is one API and will refer to it as to hidden API.

You can use internal API using following article

https://devmaze.wordpress.com/2011/01/18/using-com-android-internal-part-1-introduction/

Swapnil Tandel
  • 94
  • 1
  • 12