Commit ba5a364f766951967e381ef6c35b4df9d88e87ce

Authored by Imanol-Mikel Barba Sabariego
1 parent 9e241d08

defaultURL

gen/com/upc/pbe/upcnews/R.java
@@ -69,14 +69,14 @@ public final class R { @@ -69,14 +69,14 @@ public final class R {
69 public static final int app_name=0x7f070000; 69 public static final int app_name=0x7f070000;
70 public static final int button=0x7f07000c; 70 public static final int button=0x7f07000c;
71 public static final int button1=0x7f07000d; 71 public static final int button1=0x7f07000d;
72 - public static final int defaultURL=0x7f070012; 72 + public static final int defaultURL=0x7f070013;
73 public static final int desc=0x7f070009; 73 public static final int desc=0x7f070009;
74 public static final int descarregar=0x7f070003; 74 public static final int descarregar=0x7f070003;
75 public static final int dir=0x7f07000a; 75 public static final int dir=0x7f07000a;
76 public static final int directoris=0x7f07000b; 76 public static final int directoris=0x7f07000b;
77 public static final int hello_world=0x7f070010; 77 public static final int hello_world=0x7f070010;
78 public static final int help=0x7f070008; 78 public static final int help=0x7f070008;
79 - public static final int helpText=0x7f070013; 79 + public static final int helpText=0x7f070012;
80 public static final int hint=0x7f070004; 80 public static final int hint=0x7f070004;
81 public static final int menu_settings=0x7f070001; 81 public static final int menu_settings=0x7f070001;
82 public static final int prefs=0x7f070007; 82 public static final int prefs=0x7f070007;
res/layout/main_activity.xml
@@ -44,7 +44,6 @@ @@ -44,7 +44,6 @@
44 android:layout_alignTop="@+id/textViewXml" 44 android:layout_alignTop="@+id/textViewXml"
45 android:layout_centerHorizontal="true" 45 android:layout_centerHorizontal="true"
46 android:layout_marginTop="21dp" 46 android:layout_marginTop="21dp"
47 - android:text="@string/defaultURL"  
48 android:textAppearance="?android:attr/textAppearanceSmall" /> 47 android:textAppearance="?android:attr/textAppearanceSmall" />
49 48
50 </RelativeLayout> 49 </RelativeLayout>
51 \ No newline at end of file 50 \ No newline at end of file
res/values/strings.xml
@@ -18,7 +18,6 @@ @@ -18,7 +18,6 @@
18 <string name="startbuttondescription">Click to Start</string> 18 <string name="startbuttondescription">Click to Start</string>
19 <string name="hello_world">Hello world!</string> 19 <string name="hello_world">Hello world!</string>
20 <string name="title_activity_video">VideoActivity</string> 20 <string name="title_activity_video">VideoActivity</string>
21 - <string name="defaultURL">http://imanolbarba.myftp.biz/PBE</string>  
22 <string name="helpText"> UPC News 0.7 Alpha rev. 148\n \u00A9 Copyright Universitat Politècnica de Catalunya 2012. Tots els 21 <string name="helpText"> UPC News 0.7 Alpha rev. 148\n \u00A9 Copyright Universitat Politècnica de Catalunya 2012. Tots els
23 drets reservats.\n\n Membres de l\'equip de programadors:\n Marc Siquier \n Albert Quiroga\n Imanol Barba 22 drets reservats.\n\n Membres de l\'equip de programadors:\n Marc Siquier \n Albert Quiroga\n Imanol Barba
24 \n Marius Oltean\n\n Professor: Josep Pegueroles\n Assignatura: Projecte Bàsic de Enginyeria\n\n Aplicació dissenyada 23 \n Marius Oltean\n\n Professor: Josep Pegueroles\n Assignatura: Projecte Bàsic de Enginyeria\n\n Aplicació dissenyada
@@ -27,5 +26,6 @@ @@ -27,5 +26,6 @@
27 documents de Requirements Specification, Project Plan i Final Report. \n\n Per reportar errors, 26 documents de Requirements Specification, Project Plan i Final Report. \n\n Per reportar errors,
28 siusplau dirigeixi\'s a la Universitat o escrigui un mail als desenvolupadors.\n\n Necessària la instal·lació 27 siusplau dirigeixi\'s a la Universitat o escrigui un mail als desenvolupadors.\n\n Necessària la instal·lació
29 de la llibreria Vitamio per reproduïr arxius .ts</string> 28 de la llibreria Vitamio per reproduïr arxius .ts</string>
  29 + <string name="defaultURL">imanolbarba.myftp.biz/PBE</string>
30 30
31 </resources> 31 </resources>
32 \ No newline at end of file 32 \ No newline at end of file
res/xml/prefs.xml
1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" > 2 <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >
3 - <EditTextPreference android:key="server" android:title="@string/url" android:summary="@string/urlhint"/> 3 + <EditTextPreference android:key="server" android:title="@string/url" android:summary="@string/urlhint" android:defaultValue="@string/defaultURL"/>
4 </PreferenceScreen> 4 </PreferenceScreen>
5 \ No newline at end of file 5 \ No newline at end of file
src/com/upc/pbe/upcnews/UpcApp.java
@@ -12,7 +12,6 @@ public class UpcApp extends Application implements OnSharedPreferenceChangeListe @@ -12,7 +12,6 @@ public class UpcApp extends Application implements OnSharedPreferenceChangeListe
12 12
13 final static String TAG = "Application"; 13 final static String TAG = "Application";
14 private SharedPreferences prefs; 14 private SharedPreferences prefs;
15 - private String defaultUrl = "imanolbarba.myftp.biz/PBE";  
16 private String url = null; 15 private String url = null;
17 private String desc; 16 private String desc;
18 private final static String localPath = Environment.getExternalStorageDirectory().getPath() + "/UPC NEWS/"; 17 private final static String localPath = Environment.getExternalStorageDirectory().getPath() + "/UPC NEWS/";
@@ -23,7 +22,7 @@ public class UpcApp extends Application implements OnSharedPreferenceChangeListe @@ -23,7 +22,7 @@ public class UpcApp extends Application implements OnSharedPreferenceChangeListe
23 } 22 }
24 23
25 public String getUrl() { 24 public String getUrl() {
26 - url = "http://" + prefs.getString("server", defaultUrl); 25 + url = "http://" + prefs.getString("server", getString(R.string.defaultURL));
27 return url; 26 return url;
28 } 27 }
29 28