How to programmatically turn on loudspeaker when make/receiv

Basic Tutorials concerning: GUI, Views, Activites, XML, Layouts, Intents, ...

How to programmatically turn on loudspeaker when make/receiv

Postby rickyfan8888 » Fri Dec 03, 2010 11:04 am

Hey..I am quite new to android and still in learning process..currently i plan to make a app which will automatic turn on loudspeaker when the call is connected..and below are part of the codes..
Code: Select all
audiomanager = (AudioManager) contex.getSystemService(Context.AUDIO_SERVICE);

  @Override
    public void onCallStateChanged(int state, String incomingNumber) {
               case TelephonyManager.CALL_STATE_OFFHOOK:
                           am.setSpeakerphoneOn(true); 
               break;
         }


i was testing my code on android 2.1..sdk 7..i thaught using audiomanager.setSpeakerphoneOn(true); and add the permission of MODIFY_AUDIO_SETTINGS in manifest can turn on the loudspeaker..but it seems like it cant...so anyone can help?? thanks in advance..
rickyfan8888
Freshman
Freshman
 
Posts: 3
Joined: Tue Nov 30, 2010 9:53 am

Top

Re: How to programmatically turn on loudspeaker when make/re

Postby replica watches » Tue Dec 28, 2010 10:37 am

Not all the people would be deeply moved by luxurious products. As we all know , most of us are more likely to pursue the quality of them. Watches are very familiar for all of us. It is a symbol of your dignity. IWC watches and Officine Panerai watches look like the luxuries only for successful man. Today, your dream will come true at here. Superb quality Replica watches and Replica handbags with favorable prices help you to achieve your dream. You may not a successful man, and you don’t need to have lots of money. But you must be wealthy, this is a sign of intelligence quotient. Panerai replica watches can not only make you enjoy the joy of life and cherish every minutes, but also express your elegance, nobleness and social status. Transcendental charming on the wrist show the eternity of time. Choose one style of Omega replica watches with classic design with Swiss replica movement can absolutely satisfy yourself. In the harvest season, it is time for you to do something for yourself. A Tag Heuer replica watch will brings lots of vitality in the new year. No matter what kind of Replica watches or designer handbags you like to order, you can find Replica products which is suitable for you. Different U-BOAT styles with differenct prices are waiting for you. If you try to click Franck Muller replica watches catalog, you may also find out some suprises. We invite you to come and have a look on our Coach handbags, Miu Miu handbags, Dolce & Gabbana handbags and other brands handbags, all what you see is what you are going to get. Mirror image quality Versace handbags also can be found in our website. You will get what you paid for. Ladies who love beauty and grace should take our Mulberry handbags into your consideration.
replica watches
Freshman
Freshman
 
Posts: 6
Joined: Tue Dec 28, 2010 9:36 am

Top

Return to Novice Tutorials

Who is online

Users browsing this forum: No registered users and 3 guests