Posts

Showing posts from April, 2020

Vibrate Phone | Android Studio | Java

Image
How to vibrate phone programmatically for a specific time? You can easily implement the phone vibrate programmatically using Android Vibrator API . In this example, we will vibrate the phone for 1000 microseconds i.e. 1 second by clicking a button you can change the duration according to your requirements. >>Watch For Kotlin Step 1:  Create a new project   OR   Open your existing project Step 2:  Code Open AndroidManifest and add  VIBRATE permission. AndroidManifest <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android= "http://schemas.android.com/apk/res/android" package= "com.blogspot.atifsoftwares.vibratephone" > <!--VIBRATE permission--> <uses-permission android:name= "android.permission.VIBRATE" /> <application android:allowBackup= "true" android:icon= "@mipmap/ic_launcher" android:label=

Vibrate Phone | Android Studio | Kotlin

Image
How to vibrate phone programmatically for a specific time? You can easily implement the phone vibrate programmatically using  Android Vibrator API . In this example, we will vibrate the phone for  1000 microseconds  i.e.  1 second  by clicking a  button  you can change the duration according to your requirements. >>Watch For Java Step 1:  Create a new project   OR   open an existing project Step 2:  Code Open AndroidManifest and add  VIBRATE permission. AndroidManifest <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android= "http://schemas.android.com/apk/res/android" package= "com.blogspot.atifsoftwares.vibratephone" > <!--VIBRATE permission--> <uses-permission android:name= "android.permission.VIBRATE" /> <application android:allowBackup= "true" android:icon= "@mipmap/ic_launcher" android:label=

Progress Dialog | Android Studio | Java

Image
Simple Progress Dialog | Android Studio | Java What are Progress Bars? The Progress bars are used to show the progress of some ongoing task for example if you are downloading some file(s) from the internet you can display the progress bar while the file is being downloaded. Another example could be that when you are creating an account you can show progress bar while the account is being created. In  Android , there is a class named  ProgressDialog that is a type of dialog and allows you to show progress while doing some task(s). >>Watch For Kotlin Step 1:  Create a new project   OR   Open your existing project Step 2:  Code activity_main.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:app= "http://schemas.android.com/apk/res-auto" xmlns:tools= "http://schemas.android.com/tools" android:layout_width= "match_

Progress Dialog | Android Studio | Kotlin

Image
Simple Progress Dialog | Android Studio | Java  What are Progress Bars?  The Progress bars are used to show the progress of some ongoing task for example if you are downloading some file(s) from the internet you can display the progress bar while the file is being downloaded. Another example could be that when you are creating an account you can show progress bar while the account is being created.  In Android , there is a class named ProgressDialog that is a type of dialog and allows you to show progress while doing some task(s).  >>Watch For Java Step 1:  Create a new project   or   open an existing project Step 2: Code activity_main.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:app= "http://schemas.android.com/apk/res-auto" xmlns:tools= "http://schemas.android.com/tools" android:layout_width= "match_pa

Moving object with touch events | Android Studio | Kotlin

Image
How to move object/view with touch events on the screen? We can easily move any Object/View (ImageView, TextView, Button, etc.) on the screen using the Touch feature. In this tutorial, we will add an ImageView in our activity layout and will move that ImageView on screen. >>Watch For Java Step 1:  Create a new project   or   open an existing project Step 2: Code activity_main.xml <RelativeLayout xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:tools= "http://schemas.android.com/tools" android:layout_width= "match_parent" android:layout_height= "match_parent" android:id= "@+id/relative_layout" tools:context= ".MainActivity" > <TextView android:layout_width= "wrap_content" android:layout_height= "wrap_content" android:layout_centerHorizontal= "true" android:layout_marginTop= "20dp

Moving object with touch events | Android Studio | Java

Image
How to move object/view with touch events on the screen? We can easily move any Object/View (ImageView, TextView, Button, etc.) on the screen using the Touch feature. In this tutorial, we will add an ImageView in our activity layout and will move that ImageView on screen. >>Watch For Kotlin Step 1:  Create a new project   OR   Open your existing project Step 2:  Code activity_main.xml <RelativeLayout xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:tools= "http://schemas.android.com/tools" android:layout_width= "match_parent" android:layout_height= "match_parent" android:id= "@+id/relative_layout" tools:context= ".MainActivity" > <TextView android:layout_width= "wrap_content" android:layout_height= "wrap_content" android:layout_centerHorizontal= "true" android:layout_marginTop= &quo

Reset Firebase Password | Android Studio | Kotlin

Image
How to reset the firebase password? If the user forgot the password then the user can easily reset the password by entering the registered email. The user will receive a link to reset the password. >>Watch For Java The User can send a password reset email to a user with the sendPasswordResetEmail method. For example: activity_forgot_password.xml <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:app= "http://schemas.android.com/apk/res-auto" xmlns:tools= "http://schemas.android.com/tools" android:layout_width= "match_parent" android:layout_height= "match_parent" android:background= "@color/colorWhite" android:padding= "10dp" tools:context= ".ForgotPasswordActivity" > <TextView android:id= "@+id/label1Tv" android:layo

Reset Firebase Password | Android Studio | Java

Image
How to reset the firebase password? If the user forgot the password then the user can easily reset the password by entering the registered email. The user will receive a link to reset the password. >>Watch For Kotlin The User can send a password reset email to a user with the sendPasswordResetEmail method. For example: activity_forgot_password.xml <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:app= "http://schemas.android.com/apk/res-auto" xmlns:tools= "http://schemas.android.com/tools" android:layout_width= "match_parent" android:layout_height= "match_parent" android:background= "@color/colorWhite" android:padding= "10dp" tools:context= ".ForgotPasswordActivity" > <TextView android:id= "@+id/label1Tv" android:lay