[android-developers] Re: Mute button in call

2012-03-01 Thread brian lee
Right, as I said this code it working. The microphone is getting
muted. But there is no indication of it in the call, so if you mute it
and look at the screen you have no idea if it is muted. So I wanted to
update the button in the phone app, but I don't think that is
possible. I think my only option is to do a notification and put a
icon at the top of the screen.

On Feb 29, 11:10 pm, Jagruti Sangani jagruti.sang...@inextrix.com
wrote:
 Ok, now you had mute the call and whenever you want to comeback from mute
 that means not mute at that time you do just reverse process of this.That
 means first check is it mute if yes then make  mAudioManager.



  setMicrophoneMute(false);

 I have not tried but it might be working.







 On Wed, Feb 29, 2012 at 9:51 PM, brian lee br...@brianlee.org wrote:
  Here is the code that I am using mute within a broadcast receiver to
  capture the button:
  if(inCall==true){
                         mAudioManager =
  (AudioManager)context.getSystemService(Context.AUDIO_SERVICE);
                         if(mAudioManager.isMicrophoneMute()==true){
                                 Log.v(LOG_TAG, Unmuting Mic);
                                 Toast.makeText(context, Mic Unmuted,
  Toast.LENGTH_LONG).show();

                                 mAudioManager.setMicrophoneMute(false);

                         }
                         else{

                                 Log.v(LOG_TAG, Muting Mic);
                                 mAudioManager.setMicrophoneMute(true);
                                 Toast.makeText(context, Mic Muted,
  Toast.LENGTH_LONG).show();

                         }

  Let me know if you need any more code to understand what I am doing,
  but the above code is muting the call, just not updating the mute
  button in the phone app.

  -Brian

  On Feb 28, 11:24 pm, Jagruti Sangani jagruti.sang...@inextrix.com
  wrote:
   please put the code then and then its posssible bcz if we make the mute
  the
   call then also change the state of call.

   On Tue, Feb 28, 2012 at 2:02 AM, brian lee br...@brianlee.org wrote:
I am trying to have a app mute the call when the camera button is
pressed.

I have that part of the code working, but I can not for the life of me
figure out if there is a way to change the state of the mute button in
the call so you know that it is currently muted. Anyone know how to do
that?

-Brian

--
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

  --
  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

-- 
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: Mute button in call

2012-02-29 Thread brian lee
Here is the code that I am using mute within a broadcast receiver to
capture the button:
if(inCall==true){
mAudioManager =
(AudioManager)context.getSystemService(Context.AUDIO_SERVICE);
if(mAudioManager.isMicrophoneMute()==true){
Log.v(LOG_TAG, Unmuting Mic);
Toast.makeText(context, Mic Unmuted, 
Toast.LENGTH_LONG).show();

mAudioManager.setMicrophoneMute(false);


}
else{

Log.v(LOG_TAG, Muting Mic);
mAudioManager.setMicrophoneMute(true);
Toast.makeText(context, Mic Muted, 
Toast.LENGTH_LONG).show();

}

Let me know if you need any more code to understand what I am doing,
but the above code is muting the call, just not updating the mute
button in the phone app.

-Brian


On Feb 28, 11:24 pm, Jagruti Sangani jagruti.sang...@inextrix.com
wrote:
 please put the code then and then its posssible bcz if we make the mute the
 call then also change the state of call.







 On Tue, Feb 28, 2012 at 2:02 AM, brian lee br...@brianlee.org wrote:
  I am trying to have a app mute the call when the camera button is
  pressed.

  I have that part of the code working, but I can not for the life of me
  figure out if there is a way to change the state of the mute button in
  the call so you know that it is currently muted. Anyone know how to do
  that?

  -Brian

  --
  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

-- 
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] Mute button in call

2012-02-27 Thread brian lee
I am trying to have a app mute the call when the camera button is
pressed.

I have that part of the code working, but I can not for the life of me
figure out if there is a way to change the state of the mute button in
the call so you know that it is currently muted. Anyone know how to do
that?

-Brian

-- 
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] Broadcast Receiver issue

2012-02-23 Thread brian lee
I am trying to write what I think is a very simple application just to
check for when the head phone is plugged in and then mute the
notification sounds. I am a bit confused on the broadcast receiver,
can I have a app that is just that class and have it listen for when
that action happens, do I need a service running as well?

Here is my code:

package com.blee.checkheadphone;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.media.AudioManager;
import android.os.Bundle;
import android.util.Log;

public class CheckheadphoneManager extends BroadcastReceiver {

public static final String LOG_TAG = Checkheadphone;

Context mContext;
private AudioManager mAudioManager;
private final String HEADSET_ACTION =
android.intent.action.HEADSET_PLUG;

@Override
public void onReceive(Context arg0, Intent arg1) {

mContext = arg0;
Log.v(LOG_TAG, Intent captured);
String action = arg1.getAction();

action.equalsIgnoreCase(HEADSET_ACTION);

Bundle bundle = arg1.getExtras();
int headValue = bundle.getInt(state);

mAudioManager =
(AudioManager)arg0.getSystemService(Context.AUDIO_SERVICE);

if(headValue==0){
//System.out.println(Headphone unplugged);
Log.v(LOG_TAG, Headphone unplugged);
//mAudioManager.setSpeakerphoneOn(false);

mAudioManager.setStreamMute(AudioManager.STREAM_NOTIFICATION,
false);

}else{
//mAudioManager.setSpeakerphoneOn(true);
//System.out.println(Headphone plugged);
Log.v(LOG_TAG, Headphone plugged);

mAudioManager.setStreamMute(AudioManager.STREAM_NOTIFICATION,
true);
}

}


}

And my manifest:

?xml version=1.0 encoding=utf-8?
manifest xmlns:android=http://schemas.android.com/apk/res/android;
  package=com.blee.checkheadphone
  android:versionCode=1
  android:versionName=1.0
uses-sdk android:minSdkVersion=10 /
uses-permission
android:name=android.permission.MODIFY_AUDIO_SETTINGS/uses-
permission

application android:icon=@drawable/icon android:label=@string/
app_name


receiver android:name=CheckheadphoneManager
android:enabled=true  
intent-filter
action 
android:name=android.intent.action.HEADSET_PLUG /
category 
android:name=android.intent.category.DEFAULT /


/intent-filter
/receiver


/application
/manifest

When I watch logcat, nothing shows for my app.
Any help will be appreciated.

-- 
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: Broadcast Receiver issue

2012-02-23 Thread brian lee
So, just so I understand this correctly. I will need two classes, one
the broadcastreciever and the other the service. The broadcastreciever
will listen for the boot complete to start the service. The service
will then listen for the headset broadcast and pass that back to the
broadcastreciever class.

sound about right?

On Feb 23, 4:14 pm, YuviDroid yuvidr...@gmail.com wrote:
 This post might help 
 you:http://groups.google.com/group/android-developers/browse_thread/threa...









 On Thu, Feb 23, 2012 at 11:09 PM, brian lee br...@brianlee.org wrote:
  I am trying to write what I think is a very simple application just to
  check for when the head phone is plugged in and then mute the
  notification sounds. I am a bit confused on the broadcast receiver,
  can I have a app that is just that class and have it listen for when
  that action happens, do I need a service running as well?

  Here is my code:

  package com.blee.checkheadphone;

  import android.content.BroadcastReceiver;
  import android.content.Context;
  import android.content.Intent;
  import android.media.AudioManager;
  import android.os.Bundle;
  import android.util.Log;

  public class CheckheadphoneManager extends BroadcastReceiver {

         public static final String LOG_TAG = Checkheadphone;

         Context mContext;
         private AudioManager mAudioManager;
         private final String HEADSET_ACTION =
  android.intent.action.HEADSET_PLUG;

         @Override
         public void onReceive(Context arg0, Intent arg1) {

                 mContext = arg0;
                 Log.v(LOG_TAG, Intent captured);
                 String action = arg1.getAction();

                 action.equalsIgnoreCase(HEADSET_ACTION);

                 Bundle bundle = arg1.getExtras();
                 int headValue = bundle.getInt(state);

                 mAudioManager =
  (AudioManager)arg0.getSystemService(Context.AUDIO_SERVICE);

                 if(headValue==0){
                         //System.out.println(Headphone unplugged);
                         Log.v(LOG_TAG, Headphone unplugged);
                         //mAudioManager.setSpeakerphoneOn(false);

   mAudioManager.setStreamMute(AudioManager.STREAM_NOTIFICATION,
  false);

                 }else{
                         //mAudioManager.setSpeakerphoneOn(true);
                         //System.out.println(Headphone plugged);
                         Log.v(LOG_TAG, Headphone plugged);

   mAudioManager.setStreamMute(AudioManager.STREAM_NOTIFICATION,
  true);
                 }

         }

  }

  And my manifest:

  ?xml version=1.0 encoding=utf-8?
  manifest xmlns:android=http://schemas.android.com/apk/res/android;
       package=com.blee.checkheadphone
       android:versionCode=1
       android:versionName=1.0
     uses-sdk android:minSdkVersion=10 /
     uses-permission
  android:name=android.permission.MODIFY_AUDIO_SETTINGS/uses-
  permission

     application android:icon=@drawable/icon android:label=@string/
  app_name

         receiver android:name=CheckheadphoneManager
  android:enabled=true  
                         intent-filter
                                 action
  android:name=android.intent.action.HEADSET_PLUG /
                                 category
  android:name=android.intent.category.DEFAULT /

                         /intent-filter
                 /receiver

     /application
  /manifest

  When I watch logcat, nothing shows for my app.
  Any help will be appreciated.

  --
  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

 --
 YuviDroid
 Check out Launch-X http://android.yuvalsharon.net/launchx.php (a widget
 to quickly access your favorite apps and 
 contacts!)http://android.yuvalsharon.net

-- 
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] Android and JMX

2011-05-11 Thread brian lee
I am trying to write a simple app to monitor some mbeans of another
java application running.  How can I get android to import
javax.management so I can create a connection to the jmx?

Thanks

-- 
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