How to import com.android.internal.telephony.Phone?

2,286 views
Skip to first unread message

Jerry

unread,
Apr 20, 2009, 4:59:05 AM4/20/09
to android-platform
Hi there,
I'm trying to invoke the functions belong to class phone and
PhoneFactory. But when I'm trying to import these packages, it reminds
errors:

code:
import com.android.internal.telephony.Phone
import com.android.internal.telephony.PhoneFactory
...
PhoneFactory.makeDefaultPhones(this)
Phone phone = PhoneFactory.getDefaultPhone()

error:
The com.android.internal.telephony.Phone can not be resolved.
The com.android.internal.telephony.PhoneFactory can not be resolved.

But some other packages can be imported. I don't know why. I think all
this packages should be included in the SDK.
Can any one tell me where I am getting wrong?

Thanks.
Nio

Jeff Hamilton

unread,
Apr 20, 2009, 11:02:38 AM4/20/09
to android-...@googlegroups.com
Those classes are internal to the telephony framework. The public APIs
for talking with the telephony framework are in TelephonyManager. The
docs are at http://developer.android.com/reference/android/telephony/TelephonyManager.html.

-Jeff

Daliang Luo

unread,
Apr 20, 2009, 11:05:45 AM4/20/09
to android-...@googlegroups.com
Thanks Jeff. I will try.

2009/4/20 Jeff Hamilton <jh...@android.com>

Daliang Luo

unread,
Apr 20, 2009, 11:40:28 AM4/20/09
to android-...@googlegroups.com
But Jeff, what should I do if I have to call the function invokeOemRilRequestStrings()? There is not method can do that in the class of telephonymanager?

2009/4/20 Daliang Luo <luoda...@gmail.com>

Jeff Hamilton

unread,
Apr 20, 2009, 12:53:00 PM4/20/09
to android-...@googlegroups.com
That functionality isn't exposed through the SDK. Presumably if you
need to call invokOemRilRequestStrings() you're writing code as an OEM
and don't need to confine yourself to the SDK.

-Jeff

Daliang Luo

unread,
Apr 21, 2009, 11:01:36 AM4/21/09
to android-...@googlegroups.com

Thanks Jeff, I see. So it should be fine if I call this in the PhoneApp.java, i.e. any apps within Android are not confined to this.

Thanks Jeff. :)


2009/4/21 Jeff Hamilton <jh...@android.com>
Reply all
Reply to author
Forward
0 new messages