- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 2041 Articles for Mobile Development
578 Views
This example demonstrate about How to make an Android device vibrate programmatically.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.java Step 3 − Add the following code to src/MainActivity.javapackage app.tutorialspoint.com.sample ; import android.content.Context ; import android.os.Build ; import android.os.Bundle ; import android.os.VibrationEffect ; import android.os.Vibrator ; import android.support.v7.app.AppCompatActivity ; public class MainActivity extends AppCompatActivity { @Override protected void onCreate (Bundle savedInstanceState) { super .onCreate(savedInstanceState) ; ... Read More
1K+ Views
This example demonstrate about How can I define underlined text in an Android layout xml file.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.java Step 3 − Add the following code to src/MainActivity.javapackage app.tutorialspoint.com.sample ; import android.os.Bundle ; import android.support.v7.app.AppCompatActivity ; import android.text.SpannableString ; import android.text.style.UnderlineSpan ; import android.widget.TextView ; public class MainActivity extends AppCompatActivity { @Override protected void onCreate (Bundle savedInstanceState) { super .onCreate(savedInstanceState) ; ... Read More
5K+ Views
This example demonstrate about How to align views at the bottom of the screen in Android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.java Step 3 − Add the following code to src/MainActivity.javapackage app.tutorialspoint.com.sample ; import android.os.Bundle ; import android.support.v7.app.AppCompatActivity ; public class MainActivity extends AppCompatActivity { @Override protected void onCreate (Bundle savedInstanceState) { super .onCreate(savedInstanceState) ; setContentView(R.layout. activity_main ) ; } }Step 4 − Add the following code to androidManifest.xml ... Read More
2K+ Views
This example demonstrate about How to define a MIN and MAX value for EditText in Android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.java Step 3 − Add the following code to src/MinMaxFilter.javapackage app.tutorialspoint.com.sample ; import android.text.InputFilter ; import android.text.Spanned ; public class MinMaxFilter implements InputFilter { private int mIntMin , mIntMax ; public MinMaxFilter ( int minValue , int maxValue) { this . mIntMin = minValue ... Read More
782 Views
This example demonstrate about How can I validate EditText input in Android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.java Step 3 − Add the following code to src/ValidateFilter.javapackage app.tutorialspoint.com.sample ; import android.text.InputFilter ; import android.text.Spanned ; import android.util.Log ; import java.util.regex.Matcher ; import java.util.regex.Pattern ; public class ValidateFilter implements InputFilter { @Override public CharSequence filter (CharSequence source , int start , int end , Spanned dest , int ... Read More
2K+ Views
This example demonstrate about How to check if Location Services are enabled in Android App.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.java Step 3 − Add the following code to src/MainActivity.javapackage app.tutorialspoint.com.sample ; import android.content.Context ; import android.content.DialogInterface ; import android.content.Intent ; import android.location.LocationManager ; import android.os.Bundle ; import android.provider.Settings ; import android.support.v7.app.AlertDialog ; import android.support.v7.app.AppCompatActivity ; import android.view.View ; import android.widget.Button ; import android.widget.TextView ; public class MainActivity extends AppCompatActivity ... Read More
5K+ Views
This example demonstrate about How to get current foreground activity context in AndroidStep 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to src/MyApp.javapackage app.tutorialspoint.com.sample ; import android.app.Activity ; import android.app.Application ; public class MyApp extends Application { private Activity mCurrentActivity = null; @Override public void onCreate () { super .onCreate() ; } public Activity getCurrentActivity () { return mCurrentActivity ; } public void setCurrentActivity ... Read More
2K+ Views
This example demonstrate about How to set default font family for entire Android App.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml. Step 3 − Add the following code to src/MainActivity.javapackage app.tutorialspoint.com.sample ; import android.support.v7.app.AppCompatActivity ; import android.os.Bundle ; public class MainActivity extends AppCompatActivity { @Override protected void onCreate (Bundle savedInstanceState) { super .onCreate(savedInstanceState) ; setContentView(R.layout. activity_main ) ; } }Step 4 − ... Read More
1K+ Views
This example demonstrate about How to check Android Phone Model programmatically.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml. Step 3 − Add the following code to src/MainActivity.javapackage app.tutorialspoint.com.sample ; import android.os.Build ; import android.support.v7.app.AppCompatActivity ; import android.os.Bundle ; import android.widget.TextView ; public class MainActivity extends AppCompatActivity { TextView textView ; @Override protected void onCreate (Bundle savedInstanceState) { super .onCreate(savedInstanceState) ; setContentView(R.layout. activity_main ... Read More
3K+ Views
This example demonstrate about How to create circular ProgressBar in Android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/drawable/circular_progress_bar.xml. Step 3 − Add the following code to res/drawable/circular_shape.xml Step 4 − Add the following code to res/layout/activity_main.xml. Step 3 − Add the following code to src/MainActivity.javapackage app.tutorialspoint.com.sample ; import android.support.v7.app.AppCompatActivity ; import android.os.Bundle ; public class MainActivity extends AppCompatActivity ... Read More