Found 1966 Articles for Apps/Applications

How to control the width and height of the default Alert Dialog in iOS?

Mohtashim M
Updated on 07-Aug-2019 13:58:48

1K+ Views

There will be instance where you might get a requirement to control / manipulate width and height the Alert while developing iOS application. If you’re not familiar with the same, it can trouble you.Here we will be seeing how to control the width and height of default alert box, For controlling the height and width we will be using NSLayoutConstraint.To read more about UIAlertController refer − https://developer.apple.com/documentation/uikit/uialertcontrollerIn this, we will be creating a new project where we will have a button, on tapping that button we will show alert with custom message.Step 1 − Open Xcode → New Project → Single ... Read More

How to get a working vertical seekBar in Android?

Azhar
Updated on 01-Jul-2020 07:39:32

1K+ Views

This example demonstrates how do I get a working vertical seekBar 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.widget.SeekBar; import android.widget.TextView; public class MainActivity extends AppCompatActivity {    SeekBar seekBar;    TextView textView;    int min = 0, max = 100, current = 50;    @Override    protected ... Read More

How to add footer in Android ListView?

Azhar
Updated on 03-Jul-2020 08:30:11

767 Views

This example demonstrates how do I add footer in Android ListView.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 – Create a layout file.xml and name it as listView_footer.xml and add the following code −         Step 4 − Add the following code to src/MainActivity.javaimport java.util.ArrayList; import java.util.Arrays; import java.util.List; import android.app.Activity; import android.os.Bundle; import android.view.LayoutInflater; import android.view.ViewGroup; import android.widget.ArrayAdapter; import ... Read More

Dynamically add elements in ListView in android?

Azhar
Updated on 03-Jul-2020 08:31:00

3K+ Views

This example demonstrates how do I dynamically add elements in 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 java.util.ArrayList; import java.util.Arrays; import java.util.List; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.EditText; import android.widget.ListView; public class MainActivity extends Activity {    ListView listview;    Button addButton; ... Read More

How to create clickable links in a textView on Android?

Azhar
Updated on 03-Jul-2020 08:32:53

3K+ Views

This example demonstrates how do I create clickable links in a textView on 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 – Open res/values/strings.xml and add the following code −    Sample    Tap here to open Link Step 4 − Add the following code to src/MainActivity.javapackage app.com.sample; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.text.method.LinkMovementMethod; import android.widget.TextView; public class MainActivity extends AppCompatActivity {    TextView textView;   ... Read More

How to turn on Flash light programmatically in android?

Azhar
Updated on 03-Jul-2020 08:25:45

3K+ Views

This example demonstrates how do I turn on Flash light programatically 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.content.DialogInterface; import android.content.pm.PackageManager; import android.hardware.camera2.CameraAccessException; import android.hardware.camera2.CameraManager; import android.os.Bundle; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.widget.CompoundButton; import android.widget.ToggleButton; public class MainActivity extends AppCompatActivity {    private CameraManager mCameraManager;    private String mCameraId;    private ToggleButton toggleButton;   ... Read More

How can I send emails using gmail from my Android application?

Azhar
Updated on 03-Jul-2020 08:27:02

405 Views

This example demonstrates how do I send emails using gmail from my Android application.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.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; public class MainActivity extends AppCompatActivity{    EditText editTextMail, editTextSubject, ... Read More

How do I specify different layouts for portrait and landscape orientations in Android?

Azhar
Updated on 30-Nov-2020 13:06:37

2K+ Views

This example demonstrates how do I specify different layouts for portrait and landscape orientations 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 res/layout/activity_main.xml.         Step 3 – Create a layout file by right-clicking on the resources, name the file, from the ‘Available qualifiers, select Orientation.Click >> option.Select Landscape from UI mode.Add the following code in the res/layout/land/activity_main.xml         Step 4 − Add the following code to ... Read More

How to request Location permission at run time in Android?

Azhar
Updated on 01-Jul-2020 07:31:56

5K+ Views

This example demonstrates how do I request Location permission 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 ... Read More

How to pick up and hung up calls in android?

Azhar
Updated on 07-Aug-2019 11:45:57

294 Views

This example demonstrates how do I pick up and hung up 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);   ... Read More

Advertisements