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 { ...@@ -17,7 +17,7 @@ android {
install "opencv-contrib-python-headless" install "opencv-contrib-python-headless"
install "fuzzywuzzy" install "fuzzywuzzy"
install "pandas" install "pandas"
install "sklearn" install "scikit-learn"
} }
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
android:requestLegacyExternalStorage="true" android:requestLegacyExternalStorage="true"
android:roundIcon="@mipmap/app_logo" android:roundIcon="@mipmap/app_logo"
android:supportsRtl="true" android:supportsRtl="true"
android:usesCleartextTraffic="true"
android:theme="@style/Theme.ProbabilityAndStatisticsAnalyserAndEducator"> android:theme="@style/Theme.ProbabilityAndStatisticsAnalyserAndEducator">
<activity android:name=".adaptiveLearning.VideoHandler"></activity> <activity android:name=".adaptiveLearning.VideoHandler"></activity>
<activity android:name=".adaptiveLearning.VideoController" /> <activity android:name=".adaptiveLearning.VideoController" />
......
...@@ -56,7 +56,7 @@ public class VideoHandler extends AppCompatActivity { ...@@ -56,7 +56,7 @@ public class VideoHandler extends AppCompatActivity {
try { try {
VideoId = "k3aKKasOmIw"; 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); Picasso.with(VideoHandler.this).load(imag_URL).placeholder(R.drawable.ic_location).into(imageView);
...@@ -90,22 +90,18 @@ public class VideoHandler extends AppCompatActivity { ...@@ -90,22 +90,18 @@ public class VideoHandler extends AppCompatActivity {
ListChecker = obj.asList(); ListChecker = obj.asList();
recommendedList = supportRecommendations.FilterRecommendations(str,ListChecker); recommendedList = supportRecommendations.FilterRecommendations(str,ListChecker);
System.out.println("Recommended List "+recommendedList); System.out.println("Recommended List "+recommendedList);
String title = getTitleQuietly("http://www.youtube.com/watch?v=k3aKKasOmIw"); String titles = getTitleQuietly("https://www.youtube.com/watch?v=k3aKKasOmIw");
System.out.println("Video Title :"+title); title.setText(titles);
} }
public static String getTitleQuietly(String youtubeUrl) { public static String getTitleQuietly(String youtubeUrl) {
System.out.println("test 0");
try { try {
System.out.println("test 1");
if (youtubeUrl != null) { if (youtubeUrl != null) {
System.out.println("test 2"); URL embededURL = new URL("https://www.youtube.com/oembed?url=" +
URL embededURL = new URL("http://www.youtube.com/oembed?url=" +
youtubeUrl + "&format=json" 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"); 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