--ADVERTISEMENT--

In this tutorial, I am going to show how to develop auto complete suggestion in android using AutoCompleteTextView and MultiAutoCompleteTextView without typing all characters of word. AutoCompleteTextView suggests a word to the user and MultiAutoCompleteTextView suggests multiple words. These both auto complete textview completes the words which are stored in the program.

In the XML layout file, I have placed a AutoCompleteTextView and a MultiAutoCompleteTextView to develop auto complete sentence application.

Related:
Android Floating Labels for EditText Using Design Support Library
How to Implement Ripple Effect in Android
Load Image from URL (Internet) in Android

Android Auto Complete Word Example using AutoCompleteTextView and MultiAutoCompleteTextView


XML Layout File

res/layout/autocomplete_android.xml

Java Activity File

src/AutoCompleteAndroid.java

Strings.xml File

res/values/strings.xml

Now, run your Auto Complete android application and type the words which are stored in java file.

Output:

Android Auto Complete using AutoCompleteTextView and MultiAutoCompleteTextView
AutoCompleteTextView

Android Auto Complete using AutoCompleteTextView and MultiAutoCompleteTextView
AutoCompleteTextView

Android TextSwitcher is used to animate TextView when the text changes and to have an animated transition in android application. android.widget.TextSwitcher is a ViewSwitch which contains only children of textview.

In this android textswitcher tutorial, you will learn to implement animation to the text using textswitcher.

Related:
Android Gallery View Example
Android Auto Complete using AutoCompleteTextView and MultiAutoCompleteTextView
Android Custom SeekBar Example

TextSwitcher Example: How to Make Animated TextView Content using TextSwither


XML Layout File

res/layout/android_text_switcher_example.xml

Java Activity File

res/layout/AndroidTextSwitcherExample.java

Strings.xml File

res/values/strings.xml

AndroidManifest.xml File


Now, run your android text switcher example project and click the Next Text button you will be able to see the animated text above the button.

Output:

TextSwitcher Example: How to Make Animated TextView Content using TextSwither

TextSwitcher Example: How to Make Animated TextView Content using TextSwither

Previously we had posted some posts like simple android contact form, material design login screen XML ui design, material design sign up/registration for android, floating label for android using design support library etc. In this tutorial, you will learn to show and hide edittext password in android application. Mobile screen is very small in comparison to desktop so there can be error while typing password in mobile, it is better to put show password option. Here you will learn to put an eye icon for show and hide password.

There are different ways to show and hide password in android like using toggle button, check box, using image icon and so on. But using eye icon is best way to show and hide password and you will learn it here.

Related:
Android Material Design Profile Screen XML UI Design
Android Floating Labels for EditText Using Design Support Library
How to Implement Ripple Effect in Android


Android Example: How to Show and Hide Password in Android Using Eye Icon


Let’s start by adding compile 'com.android.support:appcompat-v7:23.2.0' and compile 'com.github.scottyab:showhidepasswordedittext:0.6' dependencies in your build.gradle file. Build.gradle file will look like below.

build.gradle

XML Layout File

Open your XML layout file and add TextInputLayout widget using design support library. Inside TextInputLayout com.scottyab.showhidepasswordedittext.ShowHidePasswordEditText with app:drawable_hide, app:drawable_show and app:tint_color attributes. Following is the complete content of XML layout file.

res/layout/hide_show_android_edittext_password.xml

Java Activity File

Following is the code of java activity file.

src/HideShowAndroidEditTextPassword.java

 Android Example: How to Show and Hide Password in Android Using Eye Icon

Now, run Show and Hide Android EditText Password Using Eye Icon application and type something in the password edittext, there will appear an eye icon in the right side of edit text. After typing any text, click the eye icon then you’ll be able to see your password in the same place.

In this tutorial, you will learn to add links in text/content in android application using linkify. You can add links in text like email address, website url. You can add html tag to make text clickable with links i.e. <a href=www.viralandroid.com>Android Tutorial</a>.

Related:
How to Get Current GPS Location Programmatically in Android
How to Use Font Awesome Icons in Android Application
Android Dropdown Menu Example

Android Linkify Example: How to add Links to Text in Android


Following is the modified content of xml layout file and strings.xml file.

XML Layout File

res/layout/android_text_linkify_example.xml


Strings.xml File

res/values/strings.xml

Now, run your android linkify example application which will look like output given below.

Output:

Android Linkify Example: How to add Links to Text in Android
Android Text Links Using Linkify

In this tutorial, you will learn to implement an effective and user friendly share action to android app. You can add android share action anywhere in your app. Here I have added share action in actionbar/toolbar and on button’s click event. If user clicks the share button from actionbar/toolbar, many options will be available there to share like email, gmail, facebook, twitter and so on. If you want to add subtitle to your app toolbar/appbar follow Setting Android ActionBar Subtitle and Color tutorial and if you want to make custom material design appbar follow Android Material Design ActionBar/App Bar tutorial.

Here we will share/send message to friends via our android application with message title, description. For subject you need to use EXTRA_SUBJECT and EXTRA_TEXT for text message.

Related:
Sending Email from Android Application
How to Add Spinner (Dropdown List) to Android ActionBar/Toolbar
Implementing SearchView in Android ActionBar

Android Example: How to Add Easy Share Action in Android ActionBar and Button


Create a new android project called android easy share action. Open your app main XML layout file and add a button or textview with onClick attribute. I have added a TextView with onClick attribute. Following is the complete content of XML layout file.

res/layout/activity_main.xml

To add share action in android appbar/toolbar you need to create a XML file in res/menu directory and add an items with attributes like android:id, android:actionProviderClass, android:icon, android:title, app:showAsAction. Action_menu.xml file will look like below.

res/menu/action_menu.xml

Now open your java activity file and add override onCreateOptionsMenu and onOptionsItemSelected methods to implement share action to android actionbar. In onOptionsItemSelected method you need to add some code to open share option and share something to the friends. If you want to share something when user click the button you need to add little bit code in android button onClick like the below. Following is the complete code of java activity file.

src/MainActivity.java

In this tutorial, you will learn to implement an effective and user friendly share action to android app.

That’s all. Run your Adding a Share Action to Android Application and click on the share icon from action bar or click the share button. There, you will see many option to share, choose one of them and then share to your friends.

In this android zoom out tutorial, you will learn to implement Zoom out animation in android application using XML and little bit java code. Android view animation is the basic animation in android and also easy to implement in application.

Android animation can be used in many ways. Following example shows you to use animation in android app. View animation can be defined either in XML or java code. In this android zoom out example project, I have used an ImageView and a Button. When you click Start ZoomOut Animation button, the image will start to zoom out.

Related:
Zoom In Animation in Android
Fade Out Animation in Android
How to Add Ripple Effect/Animation to a Android Button

Zoom Out Animation Example: How to Implement Zoom Out Animation in Android


To implement zoom out animation in android application from XML, first we need to create xml animation file in res/anim/ directory and following is the xml content of anim/zoom_out_animation.xml file.

res/anim/zoom_out_animation.xml

XML Layout File

res/layout/android_zoom_out_animation.xml


Java Activity File

src/AndroidZoomOutAnimation.java

Strings.xml File

res/values/strings.xml

That’s all. Now, run your android zoom out application and click the Start ZoomOut Animation button then the image will zoom out.

Output:

Zoom Out Animation Example: How to Implement Zoom Out Animation in Android
ZoomOut Animation

Android Analog Clock widget is simple to code and it is used to display clock in analog format. In this tutorial, you will learn to display analog clock in android application. Here, I have used an AnalogClock xml component to display clock.

Related:
Display Current Time in Android using TextClock
Android Time Picker Example
Android Navigation Drawer

Android AnalogClock: How to Display AnalogClock in Android


XML Layout File

res/layout/android_analog_clock_example.xml

Java Activity File

src/AnalogClockExample.java

Strings.xml File

res/values/strings.xml

Now, run your analog click example application and click Show AnalogClock button to display clock which will look like output given below.

Output:

Android AnalogClock: How to Display AnalogClock in Android

Android AnalogClock: How to Display AnalogClock in Android
Android AnalogClock Example

Powered by Blogger.