Android Development's post
How to add Shadow and Text on ImageView in AndroidAndroid Development

How to add Shadow and Text on ImageView in AndroidAndroid Development
Basically, it works like a stack where each view is stacked on top of the other
Create a drawable
file for shadow view and assign name as image_shadow
and add code in this file.
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<corners
android:radius="10dp"
/>
<gradient
android:angle="270"
android:centerX="300%"
android:startColor="#00000000"
android:endColor="#99000000"
android:type="linear"
/>
<size
android:width="270dp"
android:height="60dp"
/>
<stroke
android:width="1dp"
android:color="#878787"
/>
</shape>
Now, xml
file and add the below code into it and set this drawable
file as view background
<androidx.appcompat.widget.LinearLayoutCompat
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"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".MainActivity">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/imageView"
android:layout_width="250dp"
android:layout_height="250dp"
android:scaleType="centerCrop"
android:src="@drawable/shopping_image"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
<View android:id="@+id/view"
android:layout_width="250dp"
android:layout_height="250dp"
android:background="@drawable/image_shadow"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:textColor="@android:color/white"
android:text="Write your text here"
android:textSize="25sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="@+id/view"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.appcompat.widget.LinearLayoutCompat>
How can I run my app on my phone without USB connection with my pcAndroid Development

How can I run my app on my phone without USB connection with my pcAndroid Development
we learning in this blog run your app without connecting a USB cable.The main purpose of this blog user-run app without any restriction.Some time connect cable with device and device disturbing and the app not run properly issues
Step 1:
Notes:
- the third image in an already installed plugin in my android studio so friend your android studio in install this plugin.
- then your android studio restart - this point flow.
- your android studio again start then forth image in showing "ADB Wifi" option showing
- click ADB Wifi and below image showing one look open in your android studio
- a simple click to connect
- before click to connect remember your device and pc in connect same wifi otherwise not connect the device
- android studio open first time one time connect your device with USB then not needed
How to Customize Snackbar in AndroidAndroid Development

How to Customize Snackbar in AndroidAndroid Development
dependencies { implementation "com.google.android.material:$latest_version" }
Snackbar.make(view, "Show some message here", Snackbar.LENGTH_SHORT).show()
<?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout 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:id="@+id/coordinatorLayout" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.example.application.snackbarapp.MainActivity"> <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent"> <Button android:id="@+id/button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_centerVertical="true" android:text="show snackbar" /> </RelativeLayout> </android.support.design.widget.CoordinatorLayout>
import android.graphics.Color; import android.support.design.widget.CoordinatorLayout; import android.support.design.widget.Snackbar; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.TextView; public class MainActivity extends AppCompatActivity { private CoordinatorLayout coordinatorLayout; private Button button; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); coordinatorLayout = findViewById(R.id.coordinatorLayout); button = findViewById(R.id.button); button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { showSnackbar(); } }); } public void showSnackbar() { Snackbar snackbar = Snackbar.make(coordinatorLayout, "Marked as Read", Snackbar.LENGTH_INDEFINITE) .setAction("UNDO", new View.OnClickListener() { @Override public void onClick(View v) { Snackbar snackbar1 = Snackbar.make(coordinatorLayout, "Undo successful", Snackbar.LENGTH_SHORT); snackbar1.show(); } }) .setActionTextColor(Color.RED); snackbar.show(); } }
How to create APK and Bundle in android javaAndroid Development

How to create APK and Bundle in android javaAndroid Development
APK can be created with two types:
1.Debug APK
2.Release APK
- Debug APK is very fast in building and Release APK is a little bit slow.
How to create Release APK File:
- Flowing below all steps
- Open android studio
- Click Build on the toolbar
- Click Generate Signed Bundle/APK.
- Select APK
- Click the Next button
- After clicking the next button, you will see the following dialog.
- Click the "Create new..." button, highlighted in the following image by a red circle if you are creating an APK for the first time. Otherwise, you can choose from existing.
- It will open one another dialog box
- Key store path in select save location .jks file
- Fill in all the information
- Set a valid name for key alias
- Set 100 as validity years
- Fill Certificate Information
- Click OK
- After you click on it, select "release" from the dialog box
- Select "V1 (Jar Signature)" & "V2 (Full APK Signature)" checkboxes
- Click Finish
- It will start the process of building your APK
How to create a debug .apk file
- Click Build and select Build Bundles(s)/APK(s)
- select "Build APK(s)" from the dialog box
- It will start the process of building your debug APK file creating
Useful Shortcut Keys for Android StudioAndroid Development

Useful Shortcut Keys for Android StudioAndroid Development
- Shift+Shift — Search Every Where
- Ctrl+F — Find Text within a Single File
- Ctrl+Shift+F-Find Text in All Files
- Ctrl+R — Replace Selected Text in a Single File
- Ctrl+Shift+R — Replace Selected Text in all Files (Be Careful while Using This)
- Ctrl+Shift+A —Search for IDE Commands
- Ctrl+N — Navigate to Class
- Ctrl+Shift+N — Navigate to a File
- Ctrl+B — Jump to Declarations
- Alt+ ↑ — Jump to the Previous Method
- Alt+↓ — Jump to Next Method
- Ctrl+G — Jump to Line
- Ctrl+E — Recent Files
- Ctrl+Shift+Back Space — Jump to Last Edited Location
- Ctrl+B — Find Declarations
- Ctrl+Left Mouse(or)Ctrl+Alt+F7— Show Usage
- Alt + F7 / Ctrl + F7 — Find usages /Find usages in file
- Ctrl+Shift+B — Find Implementations
- F3 — Find Next
- Shift+F3 — Find Previous
- F11 — Toggle bookmark
- Ctrl+F11 — Toggle bookmark with the mnemonic(0–9 or A-Z)
- Ctrl +(0–9) — Go to numbered bookmark
- Shift+F11 — Show all Bookmarks
- Ctrl + Shift + F7 — Highlight usages in file
- Ctrl + W — Extend selection (selects a word->line->method->Class )
- Ctrl +Shift+ W — Decrease Selection
- Alt + J — Select next occurrence
- Ctrl + Alt + Shift + J — Select all occurrences
- Alt + Shift + J — Unselect occurrence
- Ctrl+Shift+V — Paste from recent buffers (from a History of Copied Contents)
- Ctrl+F6 — Refractor Code
- Ctrl+D — Duplicate a Line/Selected part
- Ctrl+Y — Delete a Line/Selected part
- Ctrl+Q — Quick Documentation
- Ctrl + Space — Code completion
- Ctrl+Shift+Space — Smart code completion (by expected type removes unrelated suggestions)
- Alt+Insert — Generate Code
- Ctrl+J — Insert Live template
- Ctrl + O — Override methods
- Ctrl + I — Implement methods
- Ctrl + Alt + T — Surround with…
- Ctrl + / — Comment / uncomment with line comment
- Ctrl + Shift + / — Comment / uncomment with block comment
- Ctrl+Alt+L — Reformat code
- Ctrl + F9 — Compile and Run Make a project
- Ctrl + Shift + F9 — Compile selected file, package or module
- Shift + F10 — Run
- Shift + F9 — Debug
- Ctrl + Shift + F10 — Run context configuration from editor
- F8 / F7 — Step over / into
- Shift + F7 / Shift + F8 — Smart step into/Step out
- Alt + F9 — Run to cursor
- Alt + F8 — Evaluate expression
- F9 — Resume program
- Ctrl + F8 — Toggle break point
- Ctrl + Shift + F8 — View breakpoints
How to Implement Splash Screen in AndroidAndroid Development

How to Implement Splash Screen in AndroidAndroid Development
<?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@color/white" /> <item android:drawable="@drawable/ic_icon_vector" android:gravity="center" /> </layer-list>
<!-- Splash Screen theme. --> <style name="SplashTheme" parent="Theme.AppCompat.NoActionBar"> <item name="android:windowBackground">@drawable/splash_background</item> </style>
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.exmple.splash"> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/Theme"> <activity android:name=".SplashActivity" android:theme="@style/SplashTheme"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest>
public class SplashActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); startActivity(new Intent(SplashActivity.this, MainActivity.class)); finish(); } }
How to create different type shape in android javaAndroid Development

How to create different type shape in android javaAndroid Development
- 1.Open android studio
- 2.Go to drawable
- 3.right click drawable menu
- flow below image steps:
- -Creating a capsule shape flow below code:
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <corners android:bottomLeftRadius="30dp" android:bottomRightRadius="30dp" android:radius="60dp" android:topLeftRadius="30dp" android:topRightRadius="30dp" /> <solid android:color="#CFCFCF" /> <padding android:bottom="0dp" android:left="0dp" android:right="0dp" android:top="0dp" /> <size android:height="60dp" android:width="270dp" /> </shape>
- The below image is showing the shape corner radius
- -Solid means shape inner color “#CFCFCF”
- Its very simple shape width - height
How to Create Custom CardView in AndroidAndroid Development

How to Create Custom CardView in AndroidAndroid Development
dependencies { implementation ‘androidx.cardview:cardview:1.0.0’ }
res > drawable > New > Drawable Resource File.
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <gradient android:startColor="#FFAB00" android:endColor="#FFAB00"> </gradient> </shape>
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <gradient android:startColor="#0091EA" android:endColor="#00BFA5"> </gradient> </shape>
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <gradient android:startColor="#AEEA00" android:endColor="#FFD600"> </gradient> </shape>

You can change it according to your needs.
<?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_parent" android:layout_height="match_parent" android:orientation="vertical"> <androidx.cardview.widget.CardView android:layout_width="match_parent" android:layout_height="173dp" android:layout_marginStart="20dp" android:layout_marginTop="20dp" android:layout_marginEnd="20dp" app:cardCornerRadius="8dp"> <LinearLayout android:id="@+id/linearLayout1" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/bg1" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="30dp" android:layout_marginTop="20dp" android:layout_marginEnd="30dp" android:orientation="horizontal"> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Assam" android:textColor="#000000" android:textSize="22sp" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Current Location" android:textColor="#000000" android:textSize="14sp" /> </LinearLayout> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginStart="30dp" android:layout_marginTop="20dp" android:layout_marginEnd="30dp" android:orientation="horizontal"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="25" android:textColor="#000000" android:textSize="28sp" /> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="6dp" android:text="o" android:textColor="#000000" android:textSize="13sp" /> </LinearLayout> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="18 %" android:textColor="#000000" android:textSize="14sp" /> <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:layout_marginStart="6dp" android:text="11.25 AM" android:textColor="#000000" android:textSize="14sp" /> </RelativeLayout> </LinearLayout> </LinearLayout> </androidx.cardview.widget.CardView> <androidx.cardview.widget.CardView android:layout_width="match_parent" android:layout_height="173dp" android:layout_marginStart="20dp" android:layout_marginTop="20dp" android:layout_marginEnd="20dp" app:cardCornerRadius="8dp"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/bg2" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="30dp" android:layout_marginTop="20dp" android:layout_marginEnd="30dp" android:orientation="horizontal"> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Delhi" android:textColor="@color/white" android:textSize="22sp" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="2 days ago" android:textColor="@color/white" android:textSize="14sp" /> </LinearLayout> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginStart="30dp" android:layout_marginTop="20dp" android:layout_marginEnd="30dp" android:orientation="horizontal"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="39" android:textColor="@color/white" android:textSize="28sp" /> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="6dp" android:text="o" android:textColor="@color/white" android:textSize="13sp" /> </LinearLayout> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="35 %" android:textColor="@color/white" android:textSize="14sp" /> <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:layout_marginStart="6dp" android:text="01.05 PM" android:textColor="#D6D6D6" android:textSize="14sp" /> </RelativeLayout> </LinearLayout> </LinearLayout> </androidx.cardview.widget.CardView> <androidx.cardview.widget.CardView android:layout_width="match_parent" android:layout_height="173dp" android:layout_marginStart="20dp" android:layout_marginTop="20dp" android:layout_marginEnd="20dp" app:cardCornerRadius="8dp"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/bg3" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="30dp" android:layout_marginTop="20dp" android:layout_marginEnd="30dp" android:orientation="horizontal"> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Darjeeling" android:textColor="#000000" android:textSize="22sp" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="2 weeks ago" android:textColor="#000000" android:textSize="14sp" /> </LinearLayout> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginStart="30dp" android:layout_marginTop="20dp" android:layout_marginEnd="30dp" android:orientation="horizontal"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="12" android:textColor="#000000" android:textSize="28sp" /> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="6dp" android:text="o" android:textColor="#000000" android:textSize="13sp" /> </LinearLayout> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="9 %" android:textColor="#000000" android:textSize="14sp" /> <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:layout_marginStart="6dp" android:text="05.00 AM" android:textColor="#000000" android:textSize="14sp" /> </RelativeLayout> </LinearLayout> </LinearLayout> </androidx.cardview.widget.CardView> </LinearLayout>