Found 1966 Articles for Apps/Applications

How to answer in incoming call programmatically in Android?

Azhar
Updated on 15-Nov-2019 10:20:59

2K+ Views

This example demonstrates how to answer in incoming call programmatically 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.javapackage com.app.sample; import androidx.appcompat.app.AppCompatActivity; import android.content.Context; import android.content.Intent; import android.os.Build; import android.os.Bundle; public class MainActivity extends AppCompatActivity {    @Override    protected void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       setContentView(R.layout.activity_main);    }    public void acceptCall() {       ... Read More

How to create custom notification layouts and text colors in Android?

Azhar
Updated on 15-Nov-2019 10:15:00

2K+ Views

This example demonstrates how to create custom notification layouts and text colors 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.javapackage com.app.sample; import androidx.appcompat.app.AppCompatActivity; import androidx.core.app.NotificationCompat; import android.os.Bundle; import android.os.Bundle; import android.app.Activity; import android.app.NotificationManager; import android.app.PendingIntent; import android.content.Intent; import android.view.Menu; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.RemoteViews; public class MainActivity extends AppCompatActivity {    @Override    protected void onCreate(Bundle savedInstanceState) ... Read More

How to make an alert dialog fill 50% of screen size on Android device?

Azhar
Updated on 15-Nov-2019 10:01:48

2K+ Views

This example demonstrates how to make an alert dialog to fill 50% of screen size on an Android device.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.    

How to detect shake event in Android app?

Azhar
Updated on 15-Nov-2019 09:56:19

2K+ Views

This example demonstrates how to do I 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 androidx.appcompat.app.AppCompatActivity; import android.content.Context; import android.hardware.Sensor; import android.hardware.SensorEvent; import android.hardware.SensorEventListener; import android.hardware.SensorManager; import android.os.Bundle; import android.widget.Toast; import java.util.Objects; public class MainActivity extends AppCompatActivity {    private SensorManager mSensorManager;    private float mAccel;    private float mAccelCurrent;    private float mAccelLast;    @Override    protected void onCreate(Bundle savedInstanceState) ... Read More

How to use search functionality in custom list view in Android?

Azhar
Updated on 15-Nov-2019 09:51:56

2K+ Views

This example demonstrates how do I use the search functionality in custom listview 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 androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.text.Editable; import android.text.TextWatcher; import android.widget.ArrayAdapter; import android.widget.EditText; import android.widget.ListView; import java.util.ArrayList; public class MainActivity extends AppCompatActivity {    ListView listView;    ArrayList months = new ArrayList();    ArrayAdapter arrayAdapter;    EditText etSearch;    @Override ... Read More

How to hide status bar in Android?

Azhar
Updated on 15-Nov-2019 09:46:35

2K+ Views

This example demonstrates how to do I 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 androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.view.Window; import android.view.WindowManager; public class MainActivity extends AppCompatActivity {    @Override    protected void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       requestWindowFeature(Window.FEATURE_NO_TITLE);       getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);       setContentView(R.layout.activity_main);    } }Step 4 − Add the following ... Read More

How to permanently hide Navigation Bar in an Android Activity?

Azhar
Updated on 15-Nov-2019 09:41:31

2K+ Views

This example demonstrates how do I permanently hide Navigation Bar in an Android Activity 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 androidx.appcompat.app.AppCompatActivity; import android.annotation.SuppressLint; import android.os.Build; import android.os.Bundle; import android.view.View; public class MainActivity extends AppCompatActivity {    private int currentApiVersion;    @Override    protected void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       setContentView(R.layout.activity_main);       currentApiVersion ... Read More

How can I get the current Android SDK version programmatically?

Azhar
Updated on 15-Nov-2019 09:36:01

619 Views

This example demonstrates how do I get the current SDK version 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.javaimport android.os.Build; 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);       textView = findViewById(R.id.textView);       int versionAPI = Build.VERSION.SDK_INT; ... Read More

How to display progress dialog before starting an activity in Android?

Azhar
Updated on 15-Nov-2019 07:16:31

792 Views

This example demonstrates how do I to display progress dialog before starting an activity 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 androidx.appcompat.app.AppCompatActivity; import android.app.ProgressDialog; import android.os.AsyncTask; import android.os.Bundle; public class MainActivity extends AppCompatActivity {    ProgressDialog progressDialog;    @Override    protected void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       setContentView(R.layout.activity_main);       progressDialog = new ProgressDialog(this); ... Read More

How to convert milliseconds to date format in Android?

Azhar
Updated on 15-Nov-2019 07:14:40

2K+ Views

This example demonstrates how do I convert milliseconds to date format 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 androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.widget.TextView; import java.text.SimpleDateFormat; public class MainActivity extends AppCompatActivity {    TextView textView;    @Override    protected void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       setContentView(R.layout.activity_main);       textView = findViewById(R.id.textView);       getDate(); ... Read More

Advertisements