A set of mobile payment and checkout screens designed in Adobe XD. The set contains both light and dark screens that can be used to create a shopping payment app
First Add dependencies in your project
implementation 'com.github.HaarigerHarald:android-youtubeExtractor:master-SNAPSHOT'
Now Add maven { url "https://jitpack.io" } link in build gradel(Project)
{
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}
AndroidMenifest.xml
<uses-permission android:name="android.permission.INTERNET" />
Now Add Editbox where user can add Youtube link and one button to download that video from link
Android_activity.xml
"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"
android:padding="20dp"
tools:context=".Youtube">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="20sp"
android:inputType="textPersonName"
android:layout_marginTop="20dp"
android:padding="10dp"
android:id="@+id/link"/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:padding="10dp"
android:onClick="downloadVideo"
android:layout_marginLeft="40dp"
android:layout_marginRight="40dp"
android:text="Download"
android:textSize="28sp"
android:textColor="#13711F" />
MainActivity.class
package com.anyjson.earn.flashdownloader;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import android.app.DownloadManager;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.util.SparseArray;
import android.view.View;
import android.webkit.DownloadListener;
import android.webkit.ValueCallback;
import android.webkit.WebResourceRequest;
import android.webkit.WebResourceResponse;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.EditText;
import android.widget.Toast;
import java.util.HashMap;
import java.util.Map;
import at.huber.youtubeExtractor.VideoMeta;
import at.huber.youtubeExtractor.YouTubeExtractor;
import at.huber.youtubeExtractor.YtFile;
public class Youtube extends AppCompatActivity {
EditText editText;
String newlink;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_youtube);
editText = findViewById(R.id.link);
}
public void downloadVideo(View view) {
String values = editText.getText().toString();
YouTubeExtractor youTubeExtractor = new YouTubeExtractor(Youtube.this) {
@Override
protected void onExtractionComplete(@Nullable SparseArray<YtFile> ytFiles, @Nullable VideoMeta videoMeta) {
if (ytFiles != null) {
int tag;
if (ytFiles.get(137) != null) { // 1080p MP4 format
tag = 137;
} else if (ytFiles.get(22) != null) { // 720p MP4 format
tag = 22;
} else if (ytFiles.get(135) != null) { // 480p MP4 format
tag = 135;
} else {
// No suitable format found
Toast.makeText(Youtube.this, "Sorry, the video could not be downloaded.", Toast.LENGTH_SHORT).show();
return;
}
newlink = ytFiles.get(tag).getUrl();
String title = "MyVideo";
DownloadManager.Request request = new DownloadManager.Request(Uri.parse(newlink));
request.setTitle(title);
request.setDescription("Downloading...");
request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, title + ".mp4");
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
DownloadManager downloadManager = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE);
downloadManager.enqueue(request);
}
}
};
youTubeExtractor.execute(values);
}
}
implementation 'com.github.HaarigerHarald:android-youtubeExtractor:master-SNAPSHOT'
Now Add maven { url "https://jitpack.io" } link in build gradel(Project)
{
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}
AndroidMenifest.xml
<uses-permission android:name="android.permission.INTERNET" />
Now Add Editbox where user can add Youtube link and one button to download that video from link
Android_activity.xml
"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"
android:padding="20dp"
tools:context=".Youtube">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="20sp"
android:inputType="textPersonName"
android:layout_marginTop="20dp"
android:padding="10dp"
android:id="@+id/link"/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:padding="10dp"
android:onClick="downloadVideo"
android:layout_marginLeft="40dp"
android:layout_marginRight="40dp"
android:text="Download"
android:textSize="28sp"
android:textColor="#13711F" />
MainActivity.class
package com.anyjson.earn.flashdownloader;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import android.app.DownloadManager;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.util.SparseArray;
import android.view.View;
import android.webkit.DownloadListener;
import android.webkit.ValueCallback;
import android.webkit.WebResourceRequest;
import android.webkit.WebResourceResponse;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.EditText;
import android.widget.Toast;
import java.util.HashMap;
import java.util.Map;
import at.huber.youtubeExtractor.VideoMeta;
import at.huber.youtubeExtractor.YouTubeExtractor;
import at.huber.youtubeExtractor.YtFile;
public class Youtube extends AppCompatActivity {
EditText editText;
String newlink;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_youtube);
editText = findViewById(R.id.link);
}
public void downloadVideo(View view) {
String values = editText.getText().toString();
YouTubeExtractor youTubeExtractor = new YouTubeExtractor(Youtube.this) {
@Override
protected void onExtractionComplete(@Nullable SparseArray<YtFile> ytFiles, @Nullable VideoMeta videoMeta) {
if (ytFiles != null) {
int tag;
if (ytFiles.get(137) != null) { // 1080p MP4 format
tag = 137;
} else if (ytFiles.get(22) != null) { // 720p MP4 format
tag = 22;
} else if (ytFiles.get(135) != null) { // 480p MP4 format
tag = 135;
} else {
// No suitable format found
Toast.makeText(Youtube.this, "Sorry, the video could not be downloaded.", Toast.LENGTH_SHORT).show();
return;
}
newlink = ytFiles.get(tag).getUrl();
String title = "MyVideo";
DownloadManager.Request request = new DownloadManager.Request(Uri.parse(newlink));
request.setTitle(title);
request.setDescription("Downloading...");
request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, title + ".mp4");
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
DownloadManager downloadManager = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE);
downloadManager.enqueue(request);
}
}
};
youTubeExtractor.execute(values);
}
}
{ repositories { google() jcenter() maven { url "https://jitpack.io" } } }
<uses-permission android:name="android.permission.INTERNET" />
Now Add Editbox where user can add Youtube link and one button to download that video from link
Android_activity.xml
"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"
android:padding="20dp"
tools:context=".Youtube">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="20sp"
android:inputType="textPersonName"
android:layout_marginTop="20dp"
android:padding="10dp"
android:id="@+id/link"/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:padding="10dp"
android:onClick="downloadVideo"
android:layout_marginLeft="40dp"
android:layout_marginRight="40dp"
android:text="Download"
android:textSize="28sp"
android:textColor="#13711F" />
MainActivity.class
package com.anyjson.earn.flashdownloader;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import android.app.DownloadManager;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.util.SparseArray;
import android.view.View;
import android.webkit.DownloadListener;
import android.webkit.ValueCallback;
import android.webkit.WebResourceRequest;
import android.webkit.WebResourceResponse;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.EditText;
import android.widget.Toast;
import java.util.HashMap;
import java.util.Map;
import at.huber.youtubeExtractor.VideoMeta;
import at.huber.youtubeExtractor.YouTubeExtractor;
import at.huber.youtubeExtractor.YtFile;
public class Youtube extends AppCompatActivity {
EditText editText;
String newlink;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_youtube);
editText = findViewById(R.id.link);
}
public void downloadVideo(View view) {
String values = editText.getText().toString();
YouTubeExtractor youTubeExtractor = new YouTubeExtractor(Youtube.this) {
@Override
protected void onExtractionComplete(@Nullable SparseArray<YtFile> ytFiles, @Nullable VideoMeta videoMeta) {
if (ytFiles != null) {
int tag;
if (ytFiles.get(137) != null) { // 1080p MP4 format
tag = 137;
} else if (ytFiles.get(22) != null) { // 720p MP4 format
tag = 22;
} else if (ytFiles.get(135) != null) { // 480p MP4 format
tag = 135;
} else {
// No suitable format found
Toast.makeText(Youtube.this, "Sorry, the video could not be downloaded.", Toast.LENGTH_SHORT).show();
return;
}
newlink = ytFiles.get(tag).getUrl();
String title = "MyVideo";
DownloadManager.Request request = new DownloadManager.Request(Uri.parse(newlink));
request.setTitle(title);
request.setDescription("Downloading...");
request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, title + ".mp4");
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
DownloadManager downloadManager = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE);
downloadManager.enqueue(request);
}
}
};
youTubeExtractor.execute(values);
}
}
"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"
android:padding="20dp"
tools:context=".Youtube">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="20sp"
android:inputType="textPersonName"
android:layout_marginTop="20dp"
android:padding="10dp"
android:id="@+id/link"/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:padding="10dp"
android:onClick="downloadVideo"
android:layout_marginLeft="40dp"
android:layout_marginRight="40dp"
android:text="Download"
android:textSize="28sp"
android:textColor="#13711F" />
MainActivity.class
package com.anyjson.earn.flashdownloader;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import android.app.DownloadManager;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.util.SparseArray;
import android.view.View;
import android.webkit.DownloadListener;
import android.webkit.ValueCallback;
import android.webkit.WebResourceRequest;
import android.webkit.WebResourceResponse;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.EditText;
import android.widget.Toast;
import java.util.HashMap;
import java.util.Map;
import at.huber.youtubeExtractor.VideoMeta;
import at.huber.youtubeExtractor.YouTubeExtractor;
import at.huber.youtubeExtractor.YtFile;
public class Youtube extends AppCompatActivity {
EditText editText;
String newlink;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_youtube);
editText = findViewById(R.id.link);
}
public void downloadVideo(View view) {
String values = editText.getText().toString();
YouTubeExtractor youTubeExtractor = new YouTubeExtractor(Youtube.this) {
@Override
protected void onExtractionComplete(@Nullable SparseArray<YtFile> ytFiles, @Nullable VideoMeta videoMeta) {
if (ytFiles != null) {
int tag;
if (ytFiles.get(137) != null) { // 1080p MP4 format
tag = 137;
} else if (ytFiles.get(22) != null) { // 720p MP4 format
tag = 22;
} else if (ytFiles.get(135) != null) { // 480p MP4 format
tag = 135;
} else {
// No suitable format found
Toast.makeText(Youtube.this, "Sorry, the video could not be downloaded.", Toast.LENGTH_SHORT).show();
return;
}
newlink = ytFiles.get(tag).getUrl();
String title = "MyVideo";
DownloadManager.Request request = new DownloadManager.Request(Uri.parse(newlink));
request.setTitle(title);
request.setDescription("Downloading...");
request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, title + ".mp4");
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
DownloadManager downloadManager = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE);
downloadManager.enqueue(request);
}
}
};
youTubeExtractor.execute(values);
}
}
package com.anyjson.earn.flashdownloader; import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; import android.app.DownloadManager; import android.content.Context; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.os.Environment; import android.util.SparseArray; import android.view.View; import android.webkit.DownloadListener; import android.webkit.ValueCallback; import android.webkit.WebResourceRequest; import android.webkit.WebResourceResponse; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.EditText; import android.widget.Toast; import java.util.HashMap; import java.util.Map; import at.huber.youtubeExtractor.VideoMeta; import at.huber.youtubeExtractor.YouTubeExtractor; import at.huber.youtubeExtractor.YtFile; public class Youtube extends AppCompatActivity { EditText editText; String newlink; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_youtube); editText = findViewById(R.id.link); } public void downloadVideo(View view) { String values = editText.getText().toString(); YouTubeExtractor youTubeExtractor = new YouTubeExtractor(Youtube.this) { @Override protected void onExtractionComplete(@Nullable SparseArray<YtFile> ytFiles, @Nullable VideoMeta videoMeta) { if (ytFiles != null) { int tag; if (ytFiles.get(137) != null) { // 1080p MP4 format tag = 137; } else if (ytFiles.get(22) != null) { // 720p MP4 format tag = 22; } else if (ytFiles.get(135) != null) { // 480p MP4 format tag = 135; } else { // No suitable format found Toast.makeText(Youtube.this, "Sorry, the video could not be downloaded.", Toast.LENGTH_SHORT).show(); return; } newlink = ytFiles.get(tag).getUrl(); String title = "MyVideo"; DownloadManager.Request request = new DownloadManager.Request(Uri.parse(newlink)); request.setTitle(title); request.setDescription("Downloading..."); request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, title + ".mp4"); request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED); DownloadManager downloadManager = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE); downloadManager.enqueue(request); } } }; youTubeExtractor.execute(values); } }