From f1d268b7500c8ff0ed6f7c7250f9c02f9e090325 Mon Sep 17 00:00:00 2001 From: Equip de Desenvolupadors de PBE Date: Sun, 18 Nov 2012 12:11:04 +0000 Subject: [PATCH] Ja funciona lo de canviar el server. I alguna altra petita modificació --- bin/UPC_NEWS_v0.apk | Bin 0 -> 175757 bytes bin/classes.dex | Bin 0 -> 333228 bytes bin/classes/com/upc/pbe/upcnews/HTMLParser.class | Bin 0 -> 1155 bytes bin/classes/com/upc/pbe/upcnews/Parser.class | Bin 0 -> 857 bytes bin/classes/com/upc/pbe/upcnews/Playlist.class | Bin 0 -> 289 bytes bin/jarlist.cache | 3 +++ bin/res/drawable-hdpi/ic_action_search.png | Bin 0 -> 409 bytes bin/res/drawable-hdpi/ic_launcher.png | Bin 0 -> 8528 bytes bin/res/drawable-ldpi/ic_launcher.png | Bin 0 -> 3147 bytes bin/res/drawable-mdpi/ic_action_search.png | Bin 0 -> 311 bytes bin/res/drawable-mdpi/ic_launcher.png | Bin 0 -> 4651 bytes bin/res/drawable-xhdpi/ic_action_search.png | Bin 0 -> 491 bytes bin/res/drawable-xhdpi/ic_launcher.png | Bin 0 -> 12959 bytes bin/resources.ap_ | Bin 0 -> 36867 bytes gen/com/upc/pbe/upcnews/R.java | 36 ++++++++++++++++++++---------------- res/layout/main_activity.xml | 4 ++-- res/values/strings.xml | 7 +++---- src/com/upc/pbe/upcnews/MainActivity.java | 23 +++++++++++++++++------ 18 files changed, 45 insertions(+), 28 deletions(-) create mode 100644 bin/UPC_NEWS_v0.apk create mode 100644 bin/classes.dex create mode 100644 bin/classes/com/upc/pbe/upcnews/HTMLParser.class create mode 100644 bin/classes/com/upc/pbe/upcnews/Parser.class create mode 100644 bin/classes/com/upc/pbe/upcnews/Playlist.class create mode 100644 bin/jarlist.cache create mode 100644 bin/res/drawable-hdpi/ic_action_search.png create mode 100644 bin/res/drawable-hdpi/ic_launcher.png create mode 100644 bin/res/drawable-ldpi/ic_launcher.png create mode 100644 bin/res/drawable-mdpi/ic_action_search.png create mode 100644 bin/res/drawable-mdpi/ic_launcher.png create mode 100644 bin/res/drawable-xhdpi/ic_action_search.png create mode 100644 bin/res/drawable-xhdpi/ic_launcher.png create mode 100644 bin/resources.ap_ diff --git a/bin/UPC_NEWS_v0.apk b/bin/UPC_NEWS_v0.apk new file mode 100644 index 0000000..493aebc Binary files /dev/null and b/bin/UPC_NEWS_v0.apk differ diff --git a/bin/classes.dex b/bin/classes.dex new file mode 100644 index 0000000..75001d6 Binary files /dev/null and b/bin/classes.dex differ diff --git a/bin/classes/com/upc/pbe/upcnews/HTMLParser.class b/bin/classes/com/upc/pbe/upcnews/HTMLParser.class new file mode 100644 index 0000000..6a8b2a8 Binary files /dev/null and b/bin/classes/com/upc/pbe/upcnews/HTMLParser.class differ diff --git a/bin/classes/com/upc/pbe/upcnews/Parser.class b/bin/classes/com/upc/pbe/upcnews/Parser.class new file mode 100644 index 0000000..1b81138 Binary files /dev/null and b/bin/classes/com/upc/pbe/upcnews/Parser.class differ diff --git a/bin/classes/com/upc/pbe/upcnews/Playlist.class b/bin/classes/com/upc/pbe/upcnews/Playlist.class new file mode 100644 index 0000000..a7b9d4b Binary files /dev/null and b/bin/classes/com/upc/pbe/upcnews/Playlist.class differ diff --git a/bin/jarlist.cache b/bin/jarlist.cache new file mode 100644 index 0000000..1b5ec3f --- /dev/null +++ b/bin/jarlist.cache @@ -0,0 +1,3 @@ +# cache for current jar dependecy. DO NOT EDIT. +# format is +# Encoding is UTF-8 diff --git a/bin/res/drawable-hdpi/ic_action_search.png b/bin/res/drawable-hdpi/ic_action_search.png new file mode 100644 index 0000000..ffec9be Binary files /dev/null and b/bin/res/drawable-hdpi/ic_action_search.png differ diff --git a/bin/res/drawable-hdpi/ic_launcher.png b/bin/res/drawable-hdpi/ic_launcher.png new file mode 100644 index 0000000..d42d873 Binary files /dev/null and b/bin/res/drawable-hdpi/ic_launcher.png differ diff --git a/bin/res/drawable-ldpi/ic_launcher.png b/bin/res/drawable-ldpi/ic_launcher.png new file mode 100644 index 0000000..e813987 Binary files /dev/null and b/bin/res/drawable-ldpi/ic_launcher.png differ diff --git a/bin/res/drawable-mdpi/ic_action_search.png b/bin/res/drawable-mdpi/ic_action_search.png new file mode 100644 index 0000000..ce9399c Binary files /dev/null and b/bin/res/drawable-mdpi/ic_action_search.png differ diff --git a/bin/res/drawable-mdpi/ic_launcher.png b/bin/res/drawable-mdpi/ic_launcher.png new file mode 100644 index 0000000..de5a408 Binary files /dev/null and b/bin/res/drawable-mdpi/ic_launcher.png differ diff --git a/bin/res/drawable-xhdpi/ic_action_search.png b/bin/res/drawable-xhdpi/ic_action_search.png new file mode 100644 index 0000000..b2d7b2d Binary files /dev/null and b/bin/res/drawable-xhdpi/ic_action_search.png differ diff --git a/bin/res/drawable-xhdpi/ic_launcher.png b/bin/res/drawable-xhdpi/ic_launcher.png new file mode 100644 index 0000000..b471ffb Binary files /dev/null and b/bin/res/drawable-xhdpi/ic_launcher.png differ diff --git a/bin/resources.ap_ b/bin/resources.ap_ new file mode 100644 index 0000000..045763e Binary files /dev/null and b/bin/resources.ap_ differ diff --git a/gen/com/upc/pbe/upcnews/R.java b/gen/com/upc/pbe/upcnews/R.java index a30263c..9138a3f 100644 --- a/gen/com/upc/pbe/upcnews/R.java +++ b/gen/com/upc/pbe/upcnews/R.java @@ -15,30 +15,34 @@ public final class R { public static final int ic_launcher=0x7f020001; } public static final class id { - public static final int AbsoluteLayout1=0x7f070000; - public static final int button=0x7f070003; - public static final int menu_settings=0x7f070004; - public static final int textViewRoute=0x7f070002; - public static final int textViewXml=0x7f070001; + public static final int AbsoluteLayout1=0x7f080000; + public static final int button=0x7f080003; + public static final int itemprefs=0x7f080005; + public static final int menu_settings=0x7f080004; + public static final int textViewRoute=0x7f080002; + public static final int textViewXml=0x7f080001; } public static final class layout { public static final int main_activity=0x7f030000; } public static final class menu { - public static final int activity_main=0x7f060000; + public static final int activity_main=0x7f070000; + public static final int menu=0x7f070001; } public static final class string { - public static final int app_name=0x7f040000; - public static final int descarregar=0x7f040004; - public static final int hello_world=0x7f040001; - public static final int hint=0x7f040005; - public static final int menu_settings=0x7f040002; - public static final int prefs=0x7f040008; - public static final int title_activity_main=0x7f040003; - public static final int url=0x7f040006; - public static final int urlhint=0x7f040007; + public static final int app_name=0x7f050000; + public static final int descarregar=0x7f050003; + public static final int hint=0x7f050004; + public static final int menu_settings=0x7f050001; + public static final int prefs=0x7f050007; + 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=0x7f050000; + public static final int AppTheme=0x7f060000; + } + public static final class xml { + public static final int prefs=0x7f040000; } } diff --git a/res/layout/main_activity.xml b/res/layout/main_activity.xml index 3fe67b6..8494f74 100644 --- a/res/layout/main_activity.xml +++ b/res/layout/main_activity.xml @@ -5,7 +5,7 @@ android:layout_width="wrap_content" android:layout_height="match_parent" tools:ignore="Deprecated" > - + - + UPC_NEWS_v0 - Hello world! Settings MainActivity - Start - Click to Start Button... + Refresh + Click to Start Button. URL server - Set the route from the server + Set the route from the server (without http://) Preferences \ No newline at end of file diff --git a/src/com/upc/pbe/upcnews/MainActivity.java b/src/com/upc/pbe/upcnews/MainActivity.java index 8ae86b1..c24ab54 100644 --- a/src/com/upc/pbe/upcnews/MainActivity.java +++ b/src/com/upc/pbe/upcnews/MainActivity.java @@ -17,7 +17,6 @@ public class MainActivity extends Activity implements OnClickListener { final static String TAG = "Main"; Button buttonDescarrega; - String url = "http://www.google.es"; String file = "ejemplo.xml"; String folder = "Environment.getExternalStorageDirectory.getPath()"; // hauria de ser /sdcard/downloads TextView showText, showRoute; @@ -31,27 +30,39 @@ public class MainActivity extends Activity implements OnClickListener { buttonDescarrega.setOnClickListener(this); showText = (TextView) findViewById(R.id.textViewXml); showRoute = (TextView) findViewById(R.id.textViewRoute); - showRoute.setText("Server: " + url); + + this.descarregarIMostrar(); } + public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu, menu); return true; } + + public String getUrl(){ + String u = ((UpcApp)getApplication()).getUrl(); + showRoute.setText("Server: " + u); + return u; + } public void onClick(View v) { Log.d(TAG, "onClicked"); - Descarrega d = new Descarrega(url, file, folder); - Toast.makeText(this, "Download succesfull", Toast.LENGTH_LONG).show(); - CharSequence html = (CharSequence) d.doInBackground(); - showText.setText(html); + this.descarregarIMostrar(); // HTMLParser pars = new HTMLParser((String) html); // ArrayList directoris = pars.parse(); // showText.setText((CharSequence) directoris); } + + public void descarregarIMostrar(){ + Descarrega d = new Descarrega(this.getUrl(), file, folder); + Toast.makeText(this, "Download succesfull", Toast.LENGTH_LONG).show(); + CharSequence html = (CharSequence) d.doInBackground(); + showText.setText(html); + } public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { -- libgit2 0.22.2