Android Articles

Page 59 of 125

Google's Relationships Based Voice Search on Android

Sharon Christine
Sharon Christine
Updated on 13-Jan-2020 171 Views

The top most company in the world – Google announced on its Google+ page that the latest version of voice search command is available which is based on relationships. This voice search command enhances its voice-recognition feature and allows user to make calls, send messages, and search using voice commands.Google has given this interesting feature to Android. That’s why, Android now available with relationship based – voice search command feature which facilitates Android user to make calls and sending messages directly via voice commands for contacts that have been associated with their relationship to the user. In other word, Android ...

Read More

How to add a shadow and a border on circular imageView android?

Azhar
Azhar
Updated on 26-Nov-2019 962 Views

This example demonstrates how to add a shadow and a border on circular imageView 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 − Add the following code to src/MainActivity.javapackage com.app.sample; import androidx.appcompat.app.AppCompatActivity; import androidx.core.graphics.drawable.RoundedBitmapDrawable; import androidx.core.graphics.drawable.RoundedBitmapDrawableFactory; import android.content.Context; import android.content.res.Resources; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.ImageView; import android.widget.RelativeLayout; import android.os.Bundle; public class MainActivity extends AppCompatActivity ...

Read More

How to bind data from a database to an Android CheckBox in a ListView?

Azhar
Azhar
Updated on 26-Nov-2019 956 Views

This example demonstrates how to bind data from a database to an Android CheckBox in a 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 − Add the following code to res/layout/row_item.xml.         Step 4 − Add the following code to src/MainActivity.javapackage com.app.sample; import androidx.appcompat.app.AppCompatActivity; import android.view.View; import android.widget.AdapterView; import android.widget.ListView; import java.util.ArrayList; import android.os.Bundle; public class MainActivity extends AppCompatActivity {    ArrayList dataModels;    ListView ...

Read More

How to Justify Text in TextView in Android?

Azhar
Azhar
Updated on 26-Nov-2019 862 Views

This example demonstrates how to Justify Text in 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 − Add the following code to res/layout/list_item.xml             Step 4 − Add the following code to src/MainActivity.javapackage com.app.sample; import androidx.appcompat.app.AppCompatActivity; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import android.os.Bundle; import java.util.ArrayList; import java.util.List; public class MainActivity extends AppCompatActivity {    private final String TAG = "MainActivity";    private ...

Read More

How to scale an Image in ImageView to keep the aspect ratio in Android?

Azhar
Azhar
Updated on 26-Nov-2019 2K+ Views

This example demonstrates how to scale an Image in ImageView to keep the aspect ratio 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.os.Bundle; import android.widget.ImageView; public class MainActivity extends AppCompatActivity {    @Override    protected void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       setContentView(R.layout.activity_main);       ImageView my_image = (ImageView) findViewById(R.id.my_image);   ...

Read More

How to support different screen size in Android?

Azhar
Azhar
Updated on 26-Nov-2019 1K+ Views

This example demonstrates how to support different screen sizes 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.util.DisplayMetrics; import android.widget.TextView; import android.os.Bundle; public class MainActivity extends AppCompatActivity {    @Override    protected void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       setContentView(R.layout.activity_main);       DisplayMetrics metrics = new DisplayMetrics();       ...

Read More

How to write a SoftKeyboard open and close listener in an activity in Android?

Azhar
Azhar
Updated on 26-Nov-2019 2K+ Views

This example demonstrates how to write a SoftKeyboard open and a close listener in 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.javapackage com.app.sample; import androidx.annotation.RequiresApi; import androidx.appcompat.app.AppCompatActivity; import androidx.constraintlayout.widget.ConstraintLayout; import android.os.Bundle; import android.graphics.Rect; import android.os.Build; import android.view.View; import android.view.ViewTreeObserver; import android.view.inputmethod.InputMethodManager; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; public class MainActivity extends AppCompatActivity implements View.OnClickListener{    ConstraintLayout ...

Read More

How to add jar as library on Android Studio?

Azhar
Azhar
Updated on 26-Nov-2019 2K+ Views

This example demonstrates how to add jar as a library on Android Studio.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 jar file to Project/app/libs/Step 3 − Add the following dependencies to File/Project StructureStep 4 − Add the following code to res/layout/activity_main.xml.     Step 5 − Add the following code to src/MainActivity.javapackage com.app.sample; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; public class MainActivity extends AppCompatActivity {    @Override    protected void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);     ...

Read More

How to send Email on Android using JavaMail API?

Azhar
Azhar
Updated on 26-Nov-2019 3K+ Views

This example demonstrates how to send Email on Android using JavaMail 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 com.app.sample; import androidx.appcompat.app.AppCompatActivity; import android.view.View; import android.widget.Button; import android.widget.EditText; import java.util.Properties; import javax.mail.PasswordAuthentication; import javax.mail.Session; import android.os.Bundle; public class MainActivity extends AppCompatActivity implements View.OnClickListener {    private EditText editTextEmail;    private ...

Read More

How to disable copy/paste from/to EditText in Android App?

Azhar
Azhar
Updated on 26-Nov-2019 1K+ Views

This example demonstrates how do I disable copy/paste from/to 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.xml.         Step 3 − Add the following code to src/MainActivity.javaimport androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.view.ActionMode; import android.view.Menu; import android.view.MenuItem; import android.widget.EditText; public class MainActivity extends AppCompatActivity {    EditText editText;    @Override    protected void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       setContentView(R.layout.activity_main);       editText = ...

Read More
Showing 581–590 of 1,250 articles
« Prev 1 57 58 59 60 61 125 Next »
Advertisements