Working With Android Audio Manager To Change Ringing Mode

  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

Android tutorial of audio manager to change ringing mode thumbnail

http://vagnvagensbygg.se/firmenit/472 Every Phone Has a Functionality to Change the Ringing type of phone. Phones comes with three type of Ringing mode

  • Normal Mode
  • Silent Mode
  • Vibrate Mode

In this tutorial, we will see How to Find and Change the Ringing mode of an Android Phone Using Android AudioManager Class.

So, guys Lets start,
  1. click here Create a new Project by Going to File ⇒ New Android Project. Fill all the Details and Name your Activity as  binäre optionen seriöse strategie MainActivity.
  2. Once your Project is created successfully open your  enter site activity_main.xml file and Add Below Code.

diovan drug cost <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" android:paddingBottom="@dimen/activity_vertical_margin" tools:context="com.targetandroid.info.MainActivity" android:orientation="vertical"> <Button android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Find Mode" android:id="@+id/btmode_audioman" /> <ImageButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:src="@android:drawable/ic_lock_silent_mode_off" android:id="@+id/ibring_audioman"/> <ImageButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@android:drawable/ic_lock_silent_mode" android:layout_gravity="center" android:id="@+id/ibsilent_audioman"/> <Button android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Vibrate" android:id="@+id/btvibrate_audioman"/> </LinearLayout>

minomycin antibiotic 500mg go here 3. Now Open your sites de rencontre hommes et femmes MainActivity.java and Add below into it

cheap cialis professional import android.content.Context; import android.media.AudioManager; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.Button; import android.widget.ImageButton; import android.widget.Toast; import com.targetandroid.info.R; public class AudioManagerActivity extends AppCompatActivity { //Creating Variables Button btmode_audioman,btvibrate_man; ImageButton ibring_audioman,ibsilent_audioman; AudioManager audioManager; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_audio_manager); btmode_audioman=(Button)findViewById(R.id.btmode_audioman); btvibrate_man=(Button)findViewById(R.id.btvibrate_audioman); ibring_audioman=(ImageButton)findViewById(R.id.ibring_audioman); ibsilent_audioman=(ImageButton)findViewById(R.id.ibsilent_audioman); //using Audio Manager for Ringing Modes audioManager=(AudioManager)getSystemService(Context.AUDIO_SERVICE); btvibrate_man.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { audioManager.setRingerMode(AudioManager.RINGER_MODE_VIBRATE); Toast.makeText(AudioManagerActivity.this,"Vibrate mode Enabled",Toast.LENGTH_SHORT).show(); } }); ibring_audioman.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { audioManager.setRingerMode(AudioManager.RINGER_MODE_NORMAL); Toast.makeText(AudioManagerActivity.this,"Ringing mode Enabled",Toast.LENGTH_SHORT).show(); } }); ibsilent_audioman.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { audioManager.setRingerMode(AudioManager.RINGER_MODE_SILENT); Toast.makeText(AudioManagerActivity.this,"Silent Mode Enabled",Toast.LENGTH_SHORT).show(); } }); btmode_audioman.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { int mod=audioManager.getRingerMode(); switch (mod){ case 0: Toast.makeText(AudioManagerActivity.this, "Silent Mode", Toast.LENGTH_SHORT).show(); break; case 1: Toast.makeText(AudioManagerActivity.this,"Vibrate Mode", Toast.LENGTH_SHORT).show(); break; default: Toast.makeText(AudioManagerActivity.this,"Ringing Mode", Toast.LENGTH_SHORT).show(); break; } //Toast.makeText(AudioManagerActivity.this, mod, Toast.LENGTH_SHORT).show(); } }); } }

click 4. Now run your Project and See the Output.
site de rencontre afro gratuit non payant

Final output of audio manager to chnage ringing mode
Final Output

click here
For More Awesome Android Tutorial Subscribe to my blog and share this with all your Programmer Friends

source site http://www.mylifept.com/?refriwerator=binary-options-no-deposit-bonus-november-2013&6b4=44 ThankYou


  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

2 Comments

  1. ampme pc November 17, 2017 Reply
  2. Devajeet December 21, 2017 Reply

Add a Comment

Your email address will not be published. Required fields are marked *