Commit 74c83a339136722870290004b916554c7de03b11

Authored by Imanol-Mikel Barba Sabariego
1 parent 3c502556

update url

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 color {
14   - public static final int Black=0x7f050002;
15   - public static final int Blue=0x7f050004;
16   - public static final int BlueAndroid=0x7f050005;
17   - public static final int Gay=0x7f050007;
18   - public static final int Gray=0x7f05000a;
19   - public static final int Green=0x7f050009;
20   - public static final int Orange=0x7f050003;
21   - public static final int Red=0x7f050008;
22   - public static final int White=0x7f050006;
23   - public static final int Whyte_POwaH=0x7f050001;
24   - public static final int backgroundmain=0x7f050000;
25   - }
26   - public static final class dimen {
27   - public static final int TitleSize=0x7f060000;
28   - public static final int lesize=0x7f060001;
29   - }
30   - public static final class drawable {
31   - public static final int ic_action_search=0x7f020000;
32   - public static final int ic_launcher=0x7f020001;
33   - public static final int ic_ledarklogo=0x7f020002;
34   - public static final int ic_menu_name=0x7f020003;
35   - public static final int ic_startbutton=0x7f020004;
36   - public static final int selectedonlist=0x7f020005;
37   - public static final int selectedonlist2=0x7f020006;
38   - public static final int startbuttontoggle=0x7f020007;
39   - }
40   - public static final class id {
41   - public static final int LinearLayout1=0x7f0a0001;
42   - public static final int RelativeLayout1=0x7f0a0006;
43   - public static final int button=0x7f0a0007;
44   - public static final int itemhelp=0x7f0a000d;
45   - public static final int itemprefs=0x7f0a000c;
46   - public static final int listView1=0x7f0a0003;
47   - public static final int menu_settings=0x7f0a000b;
48   - public static final int rowTextView=0x7f0a000a;
49   - public static final int textView1=0x7f0a0004;
50   - public static final int textView2=0x7f0a0005;
51   - public static final int textViewTitle=0x7f0a0002;
52   - public static final int textViewUrl=0x7f0a0009;
53   - public static final int textViewXml=0x7f0a0008;
54   - public static final int videoView1=0x7f0a0000;
55   - }
56   - public static final class layout {
57   - public static final int activity_video=0x7f030000;
58   - public static final int dirs=0x7f030001;
59   - public static final int help=0x7f030002;
60   - public static final int main_activity=0x7f030003;
61   - public static final int rowlayout=0x7f030004;
62   - }
63   - public static final class menu {
64   - public static final int activity_main=0x7f090000;
65   - public static final int activity_video=0x7f090001;
66   - public static final int menu=0x7f090002;
67   - }
68   - public static final class string {
69   - public static final int app_name=0x7f070000;
70   - public static final int button=0x7f07000c;
71   - public static final int button1=0x7f07000d;
72   - public static final int defaultURL=0x7f070012;
73   - public static final int desc=0x7f070009;
74   - public static final int descarregar=0x7f070003;
75   - public static final int dir=0x7f07000a;
76   - public static final int directoris=0x7f07000b;
77   - public static final int hello_world=0x7f070010;
78   - public static final int help=0x7f070008;
79   - public static final int hint=0x7f070004;
80   - public static final int menu_settings=0x7f070001;
81   - public static final int prefs=0x7f070007;
82   - public static final int startbuttondescription=0x7f07000f;
83   - public static final int title=0x7f07000e;
84   - public static final int title_activity_main=0x7f070002;
85   - public static final int title_activity_video=0x7f070011;
86   - public static final int url=0x7f070005;
87   - public static final int urlhint=0x7f070006;
88   - }
89   - public static final class style {
90   - public static final int AppTheme=0x7f080000;
91   - public static final int leBoldText=0x7f080001;
92   - }
93   - public static final class xml {
94   - public static final int prefs=0x7f040000;
95   - }
96   -}
  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 color {
  14 + public static final int Black=0x7f050002;
  15 + public static final int Blue=0x7f050004;
  16 + public static final int BlueAndroid=0x7f050005;
  17 + public static final int Gay=0x7f050007;
  18 + public static final int Gray=0x7f05000a;
  19 + public static final int Green=0x7f050009;
  20 + public static final int Orange=0x7f050003;
  21 + public static final int Red=0x7f050008;
  22 + public static final int White=0x7f050006;
  23 + public static final int Whyte_POwaH=0x7f050001;
  24 + public static final int backgroundmain=0x7f050000;
  25 + }
  26 + public static final class dimen {
  27 + public static final int TitleSize=0x7f060000;
  28 + public static final int lesize=0x7f060001;
  29 + }
  30 + public static final class drawable {
  31 + public static final int ic_action_search=0x7f020000;
  32 + public static final int ic_launcher=0x7f020001;
  33 + public static final int ic_ledarklogo=0x7f020002;
  34 + public static final int ic_menu_name=0x7f020003;
  35 + public static final int ic_startbutton=0x7f020004;
  36 + public static final int selectedonlist=0x7f020005;
  37 + public static final int selectedonlist2=0x7f020006;
  38 + public static final int startbuttontoggle=0x7f020007;
  39 + }
  40 + public static final class id {
  41 + public static final int LinearLayout1=0x7f0a0001;
  42 + public static final int RelativeLayout1=0x7f0a0006;
  43 + public static final int button=0x7f0a0007;
  44 + public static final int itemhelp=0x7f0a000d;
  45 + public static final int itemprefs=0x7f0a000c;
  46 + public static final int listView1=0x7f0a0003;
  47 + public static final int menu_settings=0x7f0a000b;
  48 + public static final int rowTextView=0x7f0a000a;
  49 + public static final int textView1=0x7f0a0004;
  50 + public static final int textView2=0x7f0a0005;
  51 + public static final int textViewTitle=0x7f0a0002;
  52 + public static final int textViewUrl=0x7f0a0009;
  53 + public static final int textViewXml=0x7f0a0008;
  54 + public static final int videoView1=0x7f0a0000;
  55 + }
  56 + public static final class layout {
  57 + public static final int activity_video=0x7f030000;
  58 + public static final int dirs=0x7f030001;
  59 + public static final int help=0x7f030002;
  60 + public static final int main_activity=0x7f030003;
  61 + public static final int rowlayout=0x7f030004;
  62 + }
  63 + public static final class menu {
  64 + public static final int activity_main=0x7f090000;
  65 + public static final int activity_video=0x7f090001;
  66 + public static final int menu=0x7f090002;
  67 + }
  68 + public static final class string {
  69 + public static final int app_name=0x7f070000;
  70 + public static final int button=0x7f07000c;
  71 + public static final int button1=0x7f07000d;
  72 + public static final int defaultURL=0x7f070012;
  73 + public static final int desc=0x7f070009;
  74 + public static final int descarregar=0x7f070003;
  75 + public static final int dir=0x7f07000a;
  76 + public static final int directoris=0x7f07000b;
  77 + public static final int hello_world=0x7f070010;
  78 + public static final int help=0x7f070008;
  79 + public static final int hint=0x7f070004;
  80 + public static final int menu_settings=0x7f070001;
  81 + public static final int prefs=0x7f070007;
  82 + public static final int startbuttondescription=0x7f07000f;
  83 + public static final int title=0x7f07000e;
  84 + public static final int title_activity_main=0x7f070002;
  85 + public static final int title_activity_video=0x7f070011;
  86 + public static final int url=0x7f070005;
  87 + public static final int urlhint=0x7f070006;
  88 + }
  89 + public static final class style {
  90 + public static final int AppTheme=0x7f080000;
  91 + public static final int leBoldText=0x7f080001;
  92 + }
  93 + public static final class xml {
  94 + public static final int prefs=0x7f040000;
  95 + }
  96 +}
... ...
src/com/upc/pbe/upcnews/MainActivity.java
1 1 package com.upc.pbe.upcnews;
2 2  
3 3 import java.io.File;
  4 +
4 5 import android.app.Activity;
5 6 import android.content.Intent;
6 7 import android.os.Bundle;
... ... @@ -10,12 +11,14 @@ import android.view.MenuItem;
10 11 import android.view.View;
11 12 import android.view.View.OnClickListener;
12 13 import android.widget.ImageButton;
  14 +import android.widget.TextView;
13 15 import android.widget.Toast;
14 16  
15 17 public class MainActivity extends Activity implements OnClickListener {
16 18 private final static String TAG = "Main";
17 19 private static String html;
18 20 private ImageButton buttonDescarrega;
  21 + private TextView URLText;
19 22  
20 23  
21 24 @Override
... ... @@ -29,9 +32,21 @@ public class MainActivity extends Activity implements OnClickListener {
29 32 {
30 33 Log.d(TAG,"Directory " + tempFolder.toString() + " created");
31 34 }
  35 + URLText = (TextView) findViewById(R.id.textViewUrl);
32 36 buttonDescarrega = (ImageButton) findViewById(R.id.button);
33 37 buttonDescarrega.setOnClickListener(this);
34   - this.getUrl();
  38 + updateURL();
  39 + }
  40 +
  41 + public void onResume()
  42 + {
  43 + super.onResume();
  44 + updateURL();
  45 + }
  46 +
  47 + public void updateURL()
  48 + {
  49 + URLText.setText(((UpcApp)getApplication()).getPrefs().getString("server", null));
35 50 }
36 51  
37 52 public boolean onCreateOptionsMenu(Menu menu) {
... ... @@ -40,11 +55,6 @@ public class MainActivity extends Activity implements OnClickListener {
40 55 return true;
41 56 }
42 57  
43   - public String getUrl() {
44   - String u = ((UpcApp) getApplication()).getUrl();
45   - return u;
46   - }
47   -
48 58 public void onClick(View v) {
49 59 Log.d(TAG, "onClicked");
50 60 this.descarregar();
... ... @@ -55,7 +65,7 @@ public class MainActivity extends Activity implements OnClickListener {
55 65 public void descarregar() {
56 66 Descarrega d = new Descarrega();
57 67 Toast.makeText(this, "Download succesfull", Toast.LENGTH_LONG).show();
58   - html = (String) d.doInBackground(this.getUrl());
  68 + html = (String) d.doInBackground(((UpcApp)getApplication()).getUrl());
59 69 }
60 70  
61 71 public boolean onOptionsItemSelected(MenuItem item) {
... ...
src/com/upc/pbe/upcnews/UpcApp.java
... ... @@ -46,7 +46,6 @@ public class UpcApp extends Application implements OnSharedPreferenceChangeListe
46 46  
47 47  
48 48 public void onSharedPreferenceChanged(SharedPreferences arg0, String key) {
49   -
50 49 Log.d(TAG, "onSharedPreferenceChanged for key: " + key);
51 50  
52 51 }
... ...