From 100b85051961ff65aee686f7845b83d7debd7cf3 Mon Sep 17 00:00:00 2001 From: Equip de Desenvolupadors de PBE Date: Wed, 5 Dec 2012 13:12:49 +0000 Subject: [PATCH] --- gen/com/upc/pbe/upcnews/R.java | 142 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------------- src/com/upc/pbe/upcnews/Descarrega.java | 11 +++++++---- src/com/upc/pbe/upcnews/Directoris.java | 8 ++++---- src/com/upc/pbe/upcnews/MainActivity.java | 4 ++-- 4 files changed, 84 insertions(+), 81 deletions(-) diff --git a/gen/com/upc/pbe/upcnews/R.java b/gen/com/upc/pbe/upcnews/R.java index 849a54a..ba09742 100644 --- a/gen/com/upc/pbe/upcnews/R.java +++ b/gen/com/upc/pbe/upcnews/R.java @@ -1,71 +1,71 @@ -/* AUTO-GENERATED FILE. DO NOT MODIFY. - * - * This class was automatically generated by the - * aapt tool from the resource data it found. It - * should not be modified by hand. - */ - -package com.upc.pbe.upcnews; - -public final class R { - public static final class attr { - } - public static final class drawable { - public static final int ic_action_search=0x7f020000; - public static final int ic_launcher=0x7f020001; - public static final int ic_menu_name=0x7f020002; - } - public static final class id { - public static final int AbsoluteLayout1=0x7f080009; - public static final int ImageView01=0x7f08000b; - public static final int ImageView1=0x7f08000a; - public static final int LinearLayout1=0x7f080000; - public static final int button=0x7f08000e; - public static final int button1=0x7f080002; - public static final int button2=0x7f080003; - public static final int button3=0x7f080004; - public static final int button4=0x7f080005; - public static final int button5=0x7f080006; - public static final int itemhelp=0x7f080011; - public static final int itemprefs=0x7f080010; - public static final int menu_settings=0x7f08000f; - public static final int textView1=0x7f080007; - public static final int textView2=0x7f080008; - public static final int textViewRoute=0x7f08000c; - public static final int textViewTitle=0x7f080001; - public static final int textViewXml=0x7f08000d; - } - public static final class layout { - public static final int dirs=0x7f030000; - public static final int help=0x7f030001; - public static final int main_activity=0x7f030002; - } - public static final class menu { - public static final int activity_main=0x7f070000; - public static final int menu=0x7f070001; - } - public static final class string { - public static final int app_name=0x7f050000; - public static final int button=0x7f05000c; - public static final int button1=0x7f05000d; - public static final int desc=0x7f050009; - public static final int descarregar=0x7f050003; - public static final int dir=0x7f05000a; - public static final int directoris=0x7f05000b; - public static final int help=0x7f050008; - public static final int hint=0x7f050004; - public static final int logodescription=0x7f05000f; - public static final int menu_settings=0x7f050001; - public static final int prefs=0x7f050007; - public static final int title=0x7f05000e; - public static final int title_activity_main=0x7f050002; - public static final int url=0x7f050005; - public static final int urlhint=0x7f050006; - } - public static final class style { - public static final int AppTheme=0x7f060000; - } - public static final class xml { - public static final int prefs=0x7f040000; - } -} +/* AUTO-GENERATED FILE. DO NOT MODIFY. + * + * This class was automatically generated by the + * aapt tool from the resource data it found. It + * should not be modified by hand. + */ + +package com.upc.pbe.upcnews; + +public final class R { + public static final class attr { + } + public static final class drawable { + public static final int ic_action_search=0x7f020000; + public static final int ic_launcher=0x7f020001; + public static final int ic_menu_name=0x7f020002; + } + public static final class id { + public static final int AbsoluteLayout1=0x7f080009; + public static final int ImageView01=0x7f08000b; + public static final int ImageView1=0x7f08000a; + public static final int LinearLayout1=0x7f080000; + public static final int button=0x7f08000e; + public static final int button1=0x7f080002; + public static final int button2=0x7f080003; + public static final int button3=0x7f080004; + public static final int button4=0x7f080005; + public static final int button5=0x7f080006; + public static final int itemhelp=0x7f080011; + public static final int itemprefs=0x7f080010; + public static final int menu_settings=0x7f08000f; + public static final int textView1=0x7f080007; + public static final int textView2=0x7f080008; + public static final int textViewRoute=0x7f08000c; + public static final int textViewTitle=0x7f080001; + public static final int textViewXml=0x7f08000d; + } + public static final class layout { + public static final int dirs=0x7f030000; + public static final int help=0x7f030001; + public static final int main_activity=0x7f030002; + } + public static final class menu { + public static final int activity_main=0x7f070000; + public static final int menu=0x7f070001; + } + public static final class string { + public static final int app_name=0x7f050000; + public static final int button=0x7f05000c; + public static final int button1=0x7f05000d; + public static final int desc=0x7f050009; + public static final int descarregar=0x7f050003; + public static final int dir=0x7f05000a; + public static final int directoris=0x7f05000b; + public static final int help=0x7f050008; + public static final int hint=0x7f050004; + public static final int logodescription=0x7f05000f; + public static final int menu_settings=0x7f050001; + public static final int prefs=0x7f050007; + public static final int title=0x7f05000e; + public static final int title_activity_main=0x7f050002; + public static final int url=0x7f050005; + public static final int urlhint=0x7f050006; + } + public static final class style { + public static final int AppTheme=0x7f060000; + } + public static final class xml { + public static final int prefs=0x7f040000; + } +} diff --git a/src/com/upc/pbe/upcnews/Descarrega.java b/src/com/upc/pbe/upcnews/Descarrega.java index 870de70..ad88255 100644 --- a/src/com/upc/pbe/upcnews/Descarrega.java +++ b/src/com/upc/pbe/upcnews/Descarrega.java @@ -23,15 +23,17 @@ public class Descarrega extends AsyncTask{ private String html; private File arxiu; - public Descarrega(String url, String nomarxiu, String carpeta) { - this.url = url; + public Descarrega(String nomarxiu, String carpeta) { + this.nomarxiu = nomarxiu; this.carpeta = carpeta; this.html = null; this.arxiu = null; } - public void descarregarguardar() { + public void descarregarguardar(String u) { + + this.url = u; // Creem el directori File dir = new File(carpeta); if (!dir.exists()) { @@ -73,7 +75,8 @@ public class Descarrega extends AsyncTask{ - protected String doInBackground() { + protected String doInBackground(String u) { + this.url = u; try { URLConnection conn = new URL(url).openConnection(); BufferedReader in = new BufferedReader(new InputStreamReader( diff --git a/src/com/upc/pbe/upcnews/Directoris.java b/src/com/upc/pbe/upcnews/Directoris.java index 782a698..e452509 100644 --- a/src/com/upc/pbe/upcnews/Directoris.java +++ b/src/com/upc/pbe/upcnews/Directoris.java @@ -106,8 +106,8 @@ public class Directoris extends Activity implements OnClickListener { //Descarrega de la pàgina HTML del directori i busqueda d'un .m3u8 en ella Log.d(TAG, "Click on " + b.getText()); - d = new Descarrega(url + "/" + b.getText() + "/", file, folder); - String str = d.doInBackground(); + d = new Descarrega(file, folder); + String str = d.doInBackground(url + "/" + b.getText() + "/"); HTMLParser pars = new HTMLParser(); String urlvideo = pars.findvideo(str, url + "/" + b.getText() + "/"); Log.d(TAG, urlvideo); @@ -116,8 +116,8 @@ public class Directoris extends Activity implements OnClickListener { if (urlvideo.equalsIgnoreCase("No s'ha trobat")) { Toast.makeText(this, "The directory " + b.getText() + " does not contain any '.m3u8' file", Toast.LENGTH_LONG).show(); } else { - d = new Descarrega(urlvideo, file, folder); - String m3u8 = d.doInBackground(); + d = new Descarrega(file, folder); + String m3u8 = d.doInBackground(urlvideo); Parser p = new Parser(); try { ArrayList m3u8parsed = p.parseFile(m3u8); diff --git a/src/com/upc/pbe/upcnews/MainActivity.java b/src/com/upc/pbe/upcnews/MainActivity.java index 8cd15ca..1779dcc 100644 --- a/src/com/upc/pbe/upcnews/MainActivity.java +++ b/src/com/upc/pbe/upcnews/MainActivity.java @@ -81,9 +81,9 @@ public class MainActivity extends Activity implements OnClickListener { } public void descarregar() { - Descarrega d = new Descarrega(this.getUrl(), file, folder); + Descarrega d = new Descarrega(file, folder); Toast.makeText(this, "Download succesfull", Toast.LENGTH_LONG).show(); - html = (String) d.doInBackground(); + html = (String) d.doInBackground(this.getUrl()); } public boolean onOptionsItemSelected(MenuItem item) { -- libgit2 0.22.2