[android-developers] Re: Updating the Call Log.
Hello, I have the same problem too. When I add a call to the calllog the name becomes unknown with my HTC Desire 2.2, while in the Emulator it works fine. This is the code: private void addToCallLog(){ String phoneName = Test Tested; String originalNumber = 11223233445; ContentValues values = new ContentValues(); values.put(CallLog.Calls.CACHED_NAME, phoneName); values.put(CallLog.Calls.NUMBER, originalNumber); //values.put(CallLog.Calls.CACHED_NUMBER_LABEL, phoneNumber); values.put(CallLog.Calls.DURATION,((endCall - startCall) / 1000 ) - 2 ); values.put(CallLog.Calls.DATE,System.currentTimeMillis() ); Uri uri = getContentResolver().insert(CallLog.Calls.CONTENT_URI, values); } Did you solved it? how? Thanks On Nov 13, 2:46 pm, Anders anders.bromha...@gmail.com wrote: Hello. I'm trying to update the CalLog to change the name/cached name of an entry. I have successfully updated a row but once i go into thecalllogon my phone the displayed name is removed after a short moment. I figured this is because the number of the incoming called is not found in any of the contacts. But why would it then clear the cached name that is in theLog? If the number is not in contacts thecalllogshould display the cached name without trying to refresh it? Atleast that's the behaviour I expect. So, my question is: Is it possible to add a name to an incoming number to display in thecalllogwithout adding the number and name to the contact list? I've figured it should be possible to add the contact first, then mark it as removed and thus get it displayed in thecalllogbut that seems like a stupid work-around. // Anders -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] MEDIA_BUTTON BroadcastReceiver in stand-by mode
Hello everyone, I have a problem with this BroadcastReceiver. It works only if the phone is not in stand-by mode. And I cannot understand the reason. receiver android:name=it.mandave.headset.receiver.MediaButtonIntentReceiver android:enabled=true intent-filter action android:name=android.intent.action.MEDIA_BUTTON / /intent-filter /receiver How can I let it work also in stand-by mode (so when the display is turned off)? Thanks a lot in advance -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: MEDIA_BUTTON BroadcastReceiver in stand-by mode
I'm not sure about it... Maybe I have to register my broadcastreceiver not ion the Manifest, but in the java code? On 9 Nov, 14:12, Mark Murphy mmur...@commonsware.com wrote: On Tue, Nov 9, 2010 at 8:09 AM, Mark Murphy mmur...@commonsware.com wrote: On Tue, Nov 9, 2010 at 8:04 AM, Mandave davide.ma...@gmail.com wrote: That's very strange, because if I short-press my headset button Play/ Pause, it starts/stops music of my default player...So I think there is a way to let it work. If the music is playing, the device is not asleep (a.k.a., stand-by mode). The music player might be holding a PARTIAL_WAKE_LOCK when it is on-screen to enable this functionality. The source code to that app is available athttp://source.android.com -- you might want to examine it to see how they are handling the media button. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy Android App Developer Books:http://commonsware.com/books -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: MEDIA_BUTTON BroadcastReceiver in stand-by mode
That's very strange, because if I short-press my headset button Play/ Pause, it starts/stops music of my default player...So I think there is a way to let it work. In my case, with long-press, nothing happens... Thanks On 9 Nov, 13:57, Mark Murphy mmur...@commonsware.com wrote: On Tue, Nov 9, 2010 at 5:08 AM, Mandave davide.ma...@gmail.com wrote: I have a problem with this BroadcastReceiver. It works only if the phone is not in stand-by mode. And I cannot understand the reason. receiver android:name=it.mandave.headset.receiver.MediaButtonIntentReceiver android:enabled=true intent-filter action android:name=android.intent.action.MEDIA_BUTTON / /intent-filter /receiver How can I let it work also in stand-by mode (so when the display is turned off)? AFAIK, that is not possible. When the device is asleep (a.k.a., stand-by mode), it does not respond to buttons, except the power button. Besides, since the device is asleep, there is no code running to respond to the button, since the CPU is powered down. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy Android App Developer Books:http://commonsware.com/books -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: MEDIA_BUTTON BroadcastReceiver in stand-by mode
No luck with registering broadcast in Java code... On 9 Nov, 15:02, Mandave davide.ma...@gmail.com wrote: I'm not sure about it... Maybe I have to register my broadcastreceiver not ion the Manifest, but in the java code? On 9 Nov, 14:12, Mark Murphy mmur...@commonsware.com wrote: On Tue, Nov 9, 2010 at 8:09 AM, Mark Murphy mmur...@commonsware.com wrote: On Tue, Nov 9, 2010 at 8:04 AM, Mandave davide.ma...@gmail.com wrote: That's very strange, because if I short-press my headset button Play/ Pause, it starts/stops music of my default player...So I think there is a way to let it work. If the music is playing, the device is not asleep (a.k.a., stand-by mode). The music player might be holding a PARTIAL_WAKE_LOCK when it is on-screen to enable this functionality. The source code to that app is available athttp://source.android.com -- you might want to examine it to see how they are handling the media button. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy Android App Developer Books:http://commonsware.com/books -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Check when a Bluetooth Device is connected
Hello, I'm trying to develop an app that knows the right moment the Bluetooth Headset (or any other Bluetooth Device) is connected to the Phone. How can I do it? I already tried with BroadcastReceiver (android.bluetooth.intent.action.HEADSET_STATE_CHANGED) defined in my manifest but with no results... receiver android:name=.BluetoothReceiver android:enabled=true intent-filter action android:name=android.bluetooth.intent.action.HEADSET_STATE_CHANGED / /intent-filter /receiver public class BluetoothReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { // Do stuff…… } } What's wrong? I want to use 1.6 sdk. Thanks in advance for your help. Greetings -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Check when Bluetooth Headset is connected
Hello, I'm trying to develop an app that knows the right moment the Bluetooth Headset is connected to the Phone. How can I do it? I already tried with BroadcastReceiver (android.bluetooth.intent.action.HEADSET_STATE_CHANGED) defined in my manifest but with no results... Thanks in advance for your help. Greetings -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en