Found 1631 Articles for Android

How to programmatically prevent scrolling in webView in Android?

Azhar
Updated on 05-Aug-2019 08:52:47

1K+ Views

This example demonstrates how do I programmatically prevent scrolling in webView 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.xml.             Step 3 − Add the following code to src/MainActivity.javaimport android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.MotionEvent; import android.view.View; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; public class MainActivity extends AppCompatActivity {    private WebView webView;    @Override    protected void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       ... Read More

How to change the DatePicker Dialog color in Android?

Azhar
Updated on 05-Aug-2019 08:42:46

3K+ Views

This example demonstrates how do I change the DatePicker dialog color 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.xml.     Kindly fine the highlighted code, this is the simplest way to change the colour of your datePicker.Step 3 − Add the following code to src/MainActivity.javaimport android.annotation.TargetApi; import android.os.Build; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.widget.DatePicker; import android.widget.Toast; public class MainActivity extends AppCompatActivity {    @TargetApi(Build.VERSION_CODES.O)    @Override    protected void onCreate(Bundle savedInstanceState) ... Read More

How to programmatically scroll to a specific position in listView in Android?

Azhar
Updated on 05-Aug-2019 08:38:18

2K+ Views

This example demonstrates how do I programmatically scroll to a specific position 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.xml.         Step 3 − Add the following code to src/MainActivity.javaimport android.os.Bundle; import android.app.Activity; import android.view.View; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class MainActivity extends Activity {    @Override    protected void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       setContentView(R.layout.activity_main); ... Read More

How to write date and time changer Listener in Android?

Azhar
Updated on 05-Aug-2019 08:33:28

273 Views

This example demonstrates how do I write date and time changer Listener 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.xml.         Step 3 − Add the following code to src/MainActivity.javaimport android.annotation.TargetApi; import android.content.Intent; import android.os.Build; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; import android.widget.DatePicker; import android.widget.Toast; public class MainActivity extends AppCompatActivity {    Button btnTime;    @TargetApi(Build.VERSION_CODES.O)    @Override    protected void onCreate(Bundle savedInstanceState) {       ... Read More

How to monitor Network connections status in Android?

Azhar
Updated on 05-Aug-2019 08:26:36

610 Views

This example demonstrates how do I monitor Network connections status 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.xml             Step 3 − Add the following code to src/MainActivity.javaimport android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.ImageView; import android.widget.TextView; public class MainActivity extends AppCompatActivity {    ImageView ivConStatus;    TextView tvconStatus;    Button btnCheckNetwork;    @Override    protected void onCreate(Bundle savedInstanceState) ... Read More

How to develop a speech recognizer in android without Google API?

Azhar
Updated on 05-Aug-2019 08:19:56

2K+ Views

This example demonstrates how do I develop a speech recognizer in android without Google API.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.com.sample; import android.Manifest; import android.content.Intent; import android.content.pm.PackageManager; import android.os.Bundle; import android.speech.RecognitionListener; import android.speech.RecognizerIntent; import android.speech.SpeechRecognizer; import android.support.annotation.NonNull; import android.support.v4.app.ActivityCompat; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.view.View; import android.widget.CompoundButton; import android.widget.ProgressBar; import android.widget.TextView; import android.widget.Toast; import ... Read More

How to detect calls in an android device?

Azhar
Updated on 05-Aug-2019 08:08:52

1K+ Views

This example demonstrates how do I detect phone calls 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.xml.     Step 3 − Add the following code to src/MainActivity.javaimport android.Manifest; import android.content.pm.PackageManager; import android.support.v4.app.ActivityCompat; import android.support.v4.content.ContextCompat; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.widget.Toast; public class MainActivity extends AppCompatActivity {    @Override    protected void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       setContentView(R.layout.activity_main);       if (ContextCompat.checkSelfPermission(MainActivity.this, Manifest.permission.READ_PHONE_STATE) != PackageManager.PERMISSION_GRANTED){   ... Read More

How to integrate Emojis Keyboard in an Android app?

Azhar
Updated on 02-Aug-2019 09:27:03

826 Views

This example demonstrates how do I integrate emogis keyboard in android appStep 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.javaimport android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.CheckBox; import android.widget.CompoundButton; import android.widget.ImageView; import hani.momanii.supernova_emoji_library.Actions.EmojIconActions; import hani.momanii.supernova_emoji_library.Helper.EmojiconEditText; import hani.momanii.supernova_emoji_library.Helper.EmojiconTextView; public class MainActivity extends AppCompatActivity {    CheckBox mCheckBox;    EmojiconEditText emojiconEditText, emojiconEditText2;   ... Read More

How to change font color of textView in android?

Azhar
Updated on 02-Aug-2019 09:10:16

4K+ Views

This example demonstrates how do I change font color of TextView 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.xml         Step 3 − Add the following code to src/MainActivity.javaimport android.graphics.Color; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.widget.TextView; public class MainActivity extends AppCompatActivity {    @Override    protected void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       setContentView(R.layout.activity_main);       TextView textView1 = findViewById(R.id.textView1);       textView1.setTextColor(Color.BLUE); ... Read More

How to change the font size of textView in android?

Azhar
Updated on 02-Aug-2019 09:05:12

13K+ Views

This example demonstrates how do I change the font size of TextView 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.xml             Step 3 − Add the following code to src/MainActivity.javaimport 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 − Add the following code to androidManifest.xml ... Read More

Advertisements