Commit 989ff317cef98fcd3036f12a4667796428055076

Authored by Imanol-Mikel Barba Sabariego
1 parent 8bbdb632

IMANOL: He tocat alguna cosa mínima al MainActivity i he comprovat que funciona …

…al portàtil amb android 2.3 x86, tot correctels PD: SI US PLAU, mireu si us surt el API minim 8 i el màxim 15, potser es cosa del meu PC, però no m'ho agafa bé. Intenteu posar-ho a API minim 9 maxim 10, ho provaré de arreglar més tard.
AndroidManifest.xml
... ... @@ -4,8 +4,8 @@
4 4 android:versionName="1.0" >
5 5  
6 6 <uses-sdk
7   - android:minSdkVersion="8"
8   - android:targetSdkVersion="15" />
  7 + android:minSdkVersion="9"
  8 + android:targetSdkVersion="10" />
9 9 <uses-permission android:name="android.permission.INTERNET"/>
10 10 <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
11 11  
... ...
gen/com/upc/pbe/upcnews/R.java
1   -/* AUTO-GENERATED FILE. DO NOT MODIFY.
2   - *
3   - * This class was automatically generated by the
4   - * aapt tool from the resource data it found. It
5   - * should not be modified by hand.
6   - */
7   -
8   -package com.upc.pbe.upcnews;
9   -
10   -public final class R {
11   - public static final class attr {
12   - }
13   - public static final class drawable {
14   - public static final int ic_action_search=0x7f020000;
15   - public static final int ic_launcher=0x7f020001;
16   - }
17   - public static final class id {
18   - public static final int AbsoluteLayout1=0x7f070000;
19   - public static final int button=0x7f070003;
20   - public static final int menu_settings=0x7f070004;
21   - public static final int textViewRoute=0x7f070002;
22   - public static final int textViewXml=0x7f070001;
23   - }
24   - public static final class layout {
25   - public static final int main_activity=0x7f030000;
26   - }
27   - public static final class menu {
28   - public static final int activity_main=0x7f060000;
29   - }
30   - public static final class string {
31   - public static final int app_name=0x7f040000;
32   - public static final int descarregar=0x7f040004;
33   - public static final int hello_world=0x7f040001;
34   - public static final int hint=0x7f040005;
35   - public static final int menu_settings=0x7f040002;
36   - public static final int title_activity_main=0x7f040003;
37   - }
38   - public static final class style {
39   - public static final int AppTheme=0x7f050000;
40   - }
41   -}
  1 +/* AUTO-GENERATED FILE. DO NOT MODIFY.
  2 + *
  3 + * This class was automatically generated by the
  4 + * aapt tool from the resource data it found. It
  5 + * should not be modified by hand.
  6 + */
  7 +
  8 +package com.upc.pbe.upcnews;
  9 +
  10 +public final class R {
  11 + public static final class attr {
  12 + }
  13 + public static final class drawable {
  14 + public static final int ic_action_search=0x7f020000;
  15 + public static final int ic_launcher=0x7f020001;
  16 + }
  17 + public static final class id {
  18 + public static final int AbsoluteLayout1=0x7f070000;
  19 + public static final int button=0x7f070003;
  20 + public static final int menu_settings=0x7f070004;
  21 + public static final int textViewRoute=0x7f070002;
  22 + public static final int textViewXml=0x7f070001;
  23 + }
  24 + public static final class layout {
  25 + public static final int main_activity=0x7f030000;
  26 + }
  27 + public static final class menu {
  28 + public static final int activity_main=0x7f060000;
  29 + }
  30 + public static final class string {
  31 + public static final int app_name=0x7f040000;
  32 + public static final int descarregar=0x7f040004;
  33 + public static final int hello_world=0x7f040001;
  34 + public static final int hint=0x7f040005;
  35 + public static final int menu_settings=0x7f040002;
  36 + public static final int title_activity_main=0x7f040003;
  37 + }
  38 + public static final class style {
  39 + public static final int AppTheme=0x7f050000;
  40 + }
  41 +}
... ...
src/com/upc/pbe/upcnews/MainActivity.java
... ... @@ -15,7 +15,7 @@ public class MainActivity extends Activity implements OnClickListener {
15 15 Button buttonDescarrega;
16 16 String url = "http://soft0.upc.edu/~francesc/ast/"; //es un server del profe de AST xd
17 17 String file = "ejemplo.xml";
18   - String folder = "C:\\Users\\Usuario\\Downloads\\";
  18 + String folder = "Environment.getExternalStorageDirectory.getPath()"; //si això es una carpeta local de android, hauria de ser /sdcard/downloads
19 19 TextView showText, showRoute;
20 20  
21 21 @Override
... ...
src/com/upc/pbe/upcnews/Parser.java
1 1 package com.upc.pbe.upcnews;
2 2  
3   -import android.annotation.TargetApi;
4   -
5 3 public class Parser
6 4 {
7 5 private Playlist playlist;
... ... @@ -27,7 +25,7 @@ public class Parser
27 25 {
28 26 int currentLine = 0;
29 27 boolean m3u8Validated = false;
30   - if(line.isEmpty())
  28 + if(true) //NIGGRADA PER QUE TIRI, JA HO MIRARÉ
31 29 {
32 30 currentLine++;
33 31 return;
... ...