PhoneFactory.getDefaultPhone from apps other than PhoneApp

by Naveen K » Thu, 25 Jun 2009 00:58:26 GMT


Sponsored Links
 Hi,

I am trying to call PhoneFactory.getDefaultPhone from a new
application so that I can access its invokeOemRilRaw* functions. But
it gives me a  "java.lang.RuntimeException:
PhoneFactory.getDefaultPhone must be called from Looper thread" error.

Is this possible ? Or is this function dedicated for the PhoneApp
only ?

Thank you,
Naveen

--~--~---------~--~----~------------~-------~--~----~



PhoneFactory.getDefaultPhone from apps other than PhoneApp

by Thomas Baumgartner » Tue, 07 Jul 2009 00:04:15 GMT


 Hi,

did you find a solution how PhoneFactory.getDefaultPhone() can be
invoked from a new app?

Thomas






--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


PhoneFactory.getDefaultPhone from apps other than PhoneApp

by Naveen K » Wed, 15 Jul 2009 07:11:15 GMT


 PhoneFactory methods are only for PhoneApp. For any other apps to
access services provided by Phone App or RIL, they need to post
intents to TelephonyManager. Any functionality not exposed by
TelephonyManager through intents are private to the Phone App.




--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Labeling points on a map

Hi,

I'm trying to add a label to each of the points on a map that I've
created.  Setting the "title" and "snippet" values of the OverlayItem
don't seem to automatically cause these labels to appear however.  I
would've thought this would be a pretty simple and common
requirement...  Am I missing something?  Can someone tell me if
there's a function that does this?

Thanks in advance.

2. Can you release the MediaPlayer wake lock when the battery is low?

I have received complaints from users of my application that audio
playback will sometimes stop when the screen is blank.  This seems to
be a problem on some phones or Android OS versions, but not everyone
sees this issue.  On checking the documentation I found that the
MediaPlayer by default does not hold a wake lock to prevent the CPU
from being shut down by the power management system while the
MediaPlayer is playing.

I have now added the following call in my application in order to
avoid this problem with the playback stopping:

   MediaPlayer.setWakeMode(this, PowerManager.PARTIAL_WAKE_LOCK);

Now that my application is holding a PARTIAL_WAKE_LOCK, my concern is
what will happen if the battery runs low?  I started to code a
BroadcastReceiver for ACTION_BATTERY_LOW in order to release the wake
lock and make sure that the player would stop if the battery is low.
However when I looked for the correct parameter to pass to the
MediaPlayer.setWakeMode() to restore the original behavior (no wake
lock) I couldn't find any value to do this.

The documented wake lock mode parameters (in order of increasing power
consumption) are:
   PARTIAL_WAKE_LOCK
   SCREEN_DIM_WAKE_LOCK
   SCREEN_BRIGHT_WAKE_LOCK
   FULL_WAKE_LOCK

There is no documented value to pass to MediaPlayer.setWakeMode() in
order to tell it to stop holding the PARTIAL_WAKE_LOCK

There isn't any documentation to indicate if the MediaPlayer is
already listening for the ACTION_BATTERY_LOW broadcast itself and
taking appropriate action, so I really don't have to worry about
this.  There isn't any documentation to tell me how to tell the
MediaPlayer that it is OK to let the CPU shut down when the battery is
low.

I would like my application to be a "good power citizen" and would
appreciate any help and direction on the correct way to implement
this.

3. Using Nexus One as a development phone: Problem with USB driver under windows 7 64 bit

4. Always permission denial when trying to read Email Account

5. AndroidRuntimeException - where is the error in my code?

6. how to get starting material of android

7. 2.1/Nexus One UI standards change