Digital Music Player App With Full Java And XML Source Code



Digital Music Player App With Full Java And XML Source Code

<?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/white"
android:orientation="vertical"
tools:context=".SplashScreen">
<ImageView
android:id="@+id/Imagee"
android:layout_centerVertical="true"
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_height="400dp"
android:background="@drawable/img"
/>
<TextView
android:layout_above="@+id/Imagee"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/app_name"
android:gravity="center"
android:textStyle="bold"
android:textSize="50sp"
android:textColor="#052E4E"/>
</RelativeLayout>
package com.shamimit.ourmusic;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;

public class SplashScreen extends AppCompatActivity {
Handler h;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash_screen);
h=new Handler();
h.postDelayed(new Runnable() {
@Override
public void run() {

Intent myIntent=new Intent(SplashScreen.this,MainActivity.class);
startActivity(myIntent);
finish();


}
},300);

}
}
<?xml version="1.0" encoding="utf-8"?>
<ScrollView 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="#F8C323"
tools:context=".MainActivity">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">


<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardElevation="10dp"
app:cardCornerRadius="20dp"
android:layout_margin="10dp"
app:cardBackgroundColor="#FAF8F0"
app:cardMaxElevation="12dp"
>

<ImageView
android:layout_width="200dp"
android:layout_height="200dp"
android:layout_gravity="center"
android:src="@drawable/img"
android:layout_margin="10dp"
android:contentDescription="@string/app_name" />
</androidx.cardview.widget.CardView>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="10">
<LinearLayout
android:id="@+id/Music2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="1"
android:layout_weight="2">
<LinearLayout
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="150dp">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardElevation="10dp"
app:cardCornerRadius="20dp"
app:cardBackgroundColor="@color/white"
app:cardUseCompatPadding="true"
>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="150dp"
android:orientation="horizontal"
android:weightSum="2">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:src="@drawable/img"/>
<LinearLayout
android:layout_marginLeft="15dp"
android:layout_marginBottom="15dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:textStyle="bold"
android:textSize="20sp"
android:text="SARKAR (Thalaivaa) Bengali Dubbed Full Movie | Vijay, Amala Paul, Sathyaraj
"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="2"
android:textStyle="normal"
android:textColorLink="@color/black"
android:text="This is Shamim Hosen I hope your are doning greate "/>
<TextView
android:layout_margin="5dp"
android:layout_marginBottom="15dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="2"
android:textStyle="italic"
android:textColorLink="@color/black"
android:text="Duration:5 min "
/>
</LinearLayout>
</LinearLayout>


</LinearLayout>



</androidx.cardview.widget.CardView>
</LinearLayout>

</LinearLayout>
<LinearLayout
android:id="@+id/Music1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="1"
android:layout_weight="2">
<LinearLayout
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="150dp">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardElevation="10dp"
app:cardCornerRadius="20dp"
app:cardBackgroundColor="@color/white"
app:cardUseCompatPadding="true"
>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="150dp"
android:orientation="horizontal"
android:weightSum="2">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:src="@drawable/img"/>
<LinearLayout
android:layout_marginLeft="15dp"
android:layout_marginBottom="15dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:textStyle="bold"
android:textSize="20sp"
android:text="কেন ফ্রান্স তাদের দেশের চারপাশ ঘুরিয়ে ২ বিলিয়ন ডলার খরচ করে এই ব্রিজ বানাচ্ছে? "/>
<TextView
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="2"
android:textStyle="normal"
android:textColorLink="@color/black"
android:text="কেন ফ্রান্স তাদের দেশের চারপাশ ঘুরিয়ে ২ বিলিয়ন ডলার খরচ করে এই ব্রিজ বানাচ্ছে?"/>
<TextView
android:layout_marginTop="10dp"
android:layout_margin="5dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="2"
android:textStyle="italic"
android:textColorLink="@color/black"
android:text="Duration:5 min "/>
</LinearLayout>
</LinearLayout>


</LinearLayout>



</androidx.cardview.widget.CardView>
</LinearLayout>

</LinearLayout>

<LinearLayout
android:id="@+id/Music3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="1"
android:layout_weight="2">
<LinearLayout
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="150dp">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardElevation="10dp"
app:cardCornerRadius="20dp"
app:cardBackgroundColor="@color/white"
app:cardUseCompatPadding="true"
>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="150dp"
android:orientation="horizontal"
android:weightSum="2">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:src="@drawable/img"/>
<LinearLayout
android:layout_marginBottom="15dp"
android:layout_marginLeft="15dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:textStyle="bold"
android:textSize="20sp"
android:text="
সঠিক জ্ঞান - Sothik Gyan
59.3K subscribers
পৃথিবী কিভাবে সৃষ্টি হয়েছিল?কিভাবে পৃথিবীতে মানুষের জন্ম হয়?Science Behind History of Earth Life.

"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="2"
android:textStyle="normal"
android:textColorLink="@color/black"
android:text="This is Shamim Hosen I hope your are doning greate "/>
<TextView
android:layout_margin="5dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="2"
android:textStyle="italic"
android:textColorLink="@color/black"
android:text="Duration:5 min "/>
</LinearLayout>
</LinearLayout>


</LinearLayout>



</androidx.cardview.widget.CardView>
</LinearLayout>

</LinearLayout>
<LinearLayout
android:id="@+id/Music4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="1"
android:layout_weight="2">
<LinearLayout
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="150dp">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardElevation="10dp"
app:cardCornerRadius="20dp"
app:cardBackgroundColor="@color/white"
app:cardUseCompatPadding="true"
>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="150dp"
android:orientation="horizontal"
android:weightSum="2">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:src="@drawable/img"/>
<LinearLayout
android:layout_marginLeft="15dp"
android:layout_width="match_parent"
android:layout_marginBottom="15dp"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:textStyle="bold"
android:textSize="20sp"
android:text="
সঠিক জ্ঞান - Sothik Gyan
59.3K subscribers
পৃথিবী কিভাবে সৃষ্টি হয়েছিল?কিভাবে পৃথিবীতে মানুষের জন্ম হয়?Science Behind History of Earth Life.

"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="2"
android:textStyle="normal"
android:textColorLink="@color/black"
android:text="This is Shamim Hosen I hope your are doning greate "/>
<TextView
android:layout_margin="5dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="2"
android:textStyle="italic"
android:textColorLink="@color/black"
android:text="Duration:5 min "/>
</LinearLayout>
</LinearLayout>


</LinearLayout>



</androidx.cardview.widget.CardView>
</LinearLayout>

</LinearLayout>
<LinearLayout
android:id="@+id/Music5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="1"
android:layout_weight="2">
<LinearLayout
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="150dp">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardElevation="10dp"
app:cardCornerRadius="20dp"
app:cardBackgroundColor="@color/white"
app:cardUseCompatPadding="true"
>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="150dp"
android:orientation="horizontal"
android:weightSum="2">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:src="@drawable/img"/>
<LinearLayout
android:layout_marginLeft="15dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:textStyle="bold"
android:textSize="20sp"
android:text="
সঠিক জ্ঞান - Sothik Gyan
59.3K subscribers
পৃথিবী কিভাবে সৃষ্টি হয়েছিল?কিভাবে পৃথিবীতে মানুষের জন্ম হয়?Science Behind History of Earth Life.

"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="2"
android:textStyle="normal"
android:textColorLink="@color/black"
android:text="This is Shamim Hosen I hope your are doning greate "/>
<TextView
android:layout_margin="5dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="2"
android:textStyle="italic"
android:textColorLink="@color/black"
android:text="Duration:5 min "/>
</LinearLayout>
</LinearLayout>


</LinearLayout>



</androidx.cardview.widget.CardView>
</LinearLayout>

</LinearLayout>
<LinearLayout
android:id="@+id/Music6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="1"
android:layout_weight="2">
<LinearLayout
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="150dp">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardElevation="10dp"
app:cardCornerRadius="20dp"
app:cardBackgroundColor="@color/white"
app:cardUseCompatPadding="true"
>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="150dp"
android:orientation="horizontal"
android:weightSum="2">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:src="@drawable/img"/>
<LinearLayout
android:layout_marginLeft="15dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:textStyle="bold"
android:textSize="20sp"
android:text="YOU: Season 4 Part 1 | Official Trailer | Netfli "/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="2"
android:textStyle="normal"
android:textColorLink="@color/black"
android:text="YOU: Season 4 Part 1 | Official Trailer | Netfli "/>
<TextView
android:layout_margin="5dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="2"
android:textStyle="italic"
android:textColorLink="@color/black"
android:text="Duration:5 min "/>
</LinearLayout>
</LinearLayout>


</LinearLayout>



</androidx.cardview.widget.CardView>
</LinearLayout>

</LinearLayout>


</LinearLayout>



</LinearLayout>
</ScrollView>
package com.shamimit.ourmusic;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;

public class MainActivity extends AppCompatActivity {
LinearLayout Music1,Music2,Music3,Music4,Music5,Music6;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

Music1=findViewById(R.id.Music1);
Music2=findViewById(R.id.Music2);
Music3=findViewById(R.id.Music3);
Music4=findViewById(R.id.Music4);
Music5=findViewById(R.id.Music5);
Music6=findViewById(R.id.Music6);

Music1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
MusicPlayer.video_url="https://www.youtube.com/embed/X91j45S_B34";
Intent myIntent= new Intent(MainActivity.this, MusicPlayer.class);
startActivity(myIntent);
}
});
Music2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
MusicPlayer.video_url="https://www.youtube.com/embed/H5J2GaYxJLc";
Intent myIntent= new Intent(MainActivity.this, MusicPlayer.class);
startActivity(myIntent);
}
});
Music3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
MusicPlayer.video_url="https://www.youtube.com/embed/12lDZheUiOc";
Intent myIntent= new Intent(MainActivity.this, MusicPlayer.class);
startActivity(myIntent);
}
});
Music4.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
MusicPlayer.video_url="https://www.youtube.com/embed/Di310WS8zLk";
Intent myIntent= new Intent(MainActivity.this, MusicPlayer.class);
startActivity(myIntent);
}
});
Music5.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
MusicPlayer.video_url="https://www.youtube.com/embed/udqDFUFIm-A";
Intent myIntent= new Intent(MainActivity.this, MusicPlayer.class);
startActivity(myIntent);
}
});
Music6.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
MusicPlayer.video_url="https://www.youtube.com/embed/3COY_HrMngc";
Intent myIntent= new Intent(MainActivity.this, MusicPlayer.class);
startActivity(myIntent);
}
});
}
}
<?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"
tools:context=".MusicPlayer">

<WebView
android:id="@+id/webview"
android:layout_width="match_parent"
android:layout_height="match_parent"/>

</LinearLayout>
package com.shamimit.ourmusic;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.webkit.WebView;

public class MusicPlayer extends AppCompatActivity {
WebView webview;
public static String video_url="";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_music_player);

webview=findViewById(R.id.webview);

video_url="https://www.youtube.com/embed/X91j45S_B34";
webview.getSettings().setJavaScriptEnabled(true);
webview.loadUrl(video_url);
}
}

g


Post a Comment

Previous Post Next Post
Girl in a jacket