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