Commit 6e5a63a6 authored by Gamage B.G.N.U's avatar Gamage B.G.N.U

Errors in recommandation system is fixed

parent 7f2e923d
......@@ -17,7 +17,7 @@ android {
install "opencv-contrib-python-headless"
install "fuzzywuzzy"
install "pandas"
install "sklearn"
install "scikit-learn"
}
......
......@@ -24,6 +24,7 @@
android:requestLegacyExternalStorage="true"
android:roundIcon="@mipmap/app_logo"
android:supportsRtl="true"
android:usesCleartextTraffic="true"
android:theme="@style/Theme.ProbabilityAndStatisticsAnalyserAndEducator">
<activity android:name=".adaptiveLearning.VideoHandler"></activity>
<activity android:name=".adaptiveLearning.VideoController" />
......
......@@ -56,7 +56,7 @@ public class VideoHandler extends AppCompatActivity {
try {
VideoId = "k3aKKasOmIw";
String imag_URL = "http://img.youtube.com/vi/"+VideoId+"/0.jpg"; // this is link which will give u thumnail image of that video
String imag_URL = "https://img.youtube.com/vi/"+VideoId+"/0.jpg"; // this is link which will give u thumnail image of that video
Picasso.with(VideoHandler.this).load(imag_URL).placeholder(R.drawable.ic_location).into(imageView);
......@@ -90,22 +90,18 @@ public class VideoHandler extends AppCompatActivity {
ListChecker = obj.asList();
recommendedList = supportRecommendations.FilterRecommendations(str,ListChecker);
System.out.println("Recommended List "+recommendedList);
String title = getTitleQuietly("http://www.youtube.com/watch?v=k3aKKasOmIw");
System.out.println("Video Title :"+title);
String titles = getTitleQuietly("https://www.youtube.com/watch?v=k3aKKasOmIw");
title.setText(titles);
}
public static String getTitleQuietly(String youtubeUrl) {
System.out.println("test 0");
try {
System.out.println("test 1");
if (youtubeUrl != null) {
System.out.println("test 2");
URL embededURL = new URL("http://www.youtube.com/oembed?url=" +
URL embededURL = new URL("https://www.youtube.com/oembed?url=" +
youtubeUrl + "&format=json"
);
System.out.println("test 3");
String test = new JSONObject(IOUtils.toString(embededURL,"UTF-8")).getString("title");
System.out.println("testt"+ test);
return new JSONObject(IOUtils.toString(embededURL,"UTF-8")).getString("title");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment