Force alarm sound

by kaloer » Sun, 10 May 2009 03:31:33 GMT


Sponsored Links
 Hi,

Is it possible to force the volume up? I have an alarm that should
wake the user even if the phone is on silent mode.. Is that possible?

Thank you,
//Kaloer
--~--~---------~--~----~------------~-------~--~----~



Force alarm sound

by Raphael » Sun, 10 May 2009 05:36:10 GMT


 


AudioManager manager = (AudioManager)
mContext.getSystemService(Context.AUDIO_SERVICE);
int max = manager.getStreamMaxVolume(AudioManager.STREAM_RING);
manager.setStreamVolume(AudioManager.STREAM_RING, new_volume, 0 /*flags*/);

See the AudioManager API for more details, especially which stream to
use and of course  you might have to change the ringer mode, cf
manager.setRingerMode(AudioManager.RINGER_MODE_NORMAL).

Please be nice to the user: only do so if the user checks a pref to
allow your app to modify his/her settings and remember to revert the
volume to what it was before ;-)

R/

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


Sponsored Links


Force alarm sound

by kaloer » Sun, 10 May 2009 15:14:10 GMT


 Thank you, it works.
Yes, I'll let the user choose this feature :)





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



Other Threads

1. error while running simple SOAP application

hi,
i want to develop an application which access web services using
ksoap2..... i have simple .net web services running with single method
Add .... the following is code..
package com.Test;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;


import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;


     public class Test extends Activity {
          private Button okButton;


          private static final String SOAP_ACTION = "http://
10.0.2.2:8000/target.asmx/Add";
          private static final String METHOD_NAME = "Add";
          private static final String NAMESPACE = "http//
tempuri.org";
          private static final String URL = "http://10.0.2.2:8000/
target.asmx";

         @Override
         protected void onCreate(Bundle icicle) {
             super.onCreate(icicle);
             setContentView(R.layout.main);

             okButton = (Button) findViewById(R.id.but);
             okButton.setOnClickListener(new View.OnClickListener() {

                 public void onClick(View view) {
                     setResult(RESULT_OK);

                     mymethod();
                 }
             });

         }
         public static void mymethod() {
           SoapObject request = new SoapObject(NAMESPACE,
METHOD_NAME);


           SoapSerializationEnvelope envelope = new
SoapSerializationEnvelope(SoapEnvelope.VER11);
           envelope.dotNet = true;
           envelope.setOutputSoapObject(request);
           HttpTransportSE androidHttpTransport = new HttpTransportSE
(URL);

           try {
                androidHttpTransport.call(SOAP_ACTION, envelope);
           } catch (Exception e) {
                e.printStackTrace();
           }
         }
     }
while running in emulator giving error as "THE APPLICATION TEST
(PROCESS COM.TEST) HAS STOPPED UNEXPECTEDELY.TRY AGAIN"..... please
tell me where the error may be....

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

2. Android on a macbook

So... will it work with a non atom.?

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

3. Porting a WiFi Driver on a android supported platform

4. Which platform is best to start with

5. Why my application get "Not granting permission warning" when i install it by adb and AppsInstaller

6. Unzip file - Both regular and UTF-8 encoded