Commit b0bf2c5b8b8d9a552ca7da4fa5f5523522d95619

Authored by Imanol-Mikel Barba Sabariego
1 parent fc8980ed

--no commit message

src/com/upc/pbe/upcnews/BandwidthMeasurer.java
@@ -6,7 +6,7 @@ import android.util.Log; @@ -6,7 +6,7 @@ import android.util.Log;
6 //Mesura la velocitat (Bandwidth) d'Internet 6 //Mesura la velocitat (Bandwidth) d'Internet
7 public class BandwidthMeasurer 7 public class BandwidthMeasurer
8 { 8 {
9 - private final static String TAG = "Measurer"; 9 + private final static String TAG = "Mesurador";
10 public double Measure(long rxBytes, long Time) 10 public double Measure(long rxBytes, long Time)
11 { 11 {
12 long AfterTime = System.currentTimeMillis(); 12 long AfterTime = System.currentTimeMillis();
@@ -14,13 +14,13 @@ public class BandwidthMeasurer @@ -14,13 +14,13 @@ public class BandwidthMeasurer
14 long TotalRxAfterTest = TrafficStats.getTotalRxBytes(); 14 long TotalRxAfterTest = TrafficStats.getTotalRxBytes();
15 double TimeDifference = AfterTime - Time; 15 double TimeDifference = AfterTime - Time;
16 double rxDiff = TotalRxAfterTest - rxBytes; 16 double rxDiff = TotalRxAfterTest - rxBytes;
17 - Log.d(TAG,"Time difference = " + TimeDifference/1000);  
18 - Log.d(TAG, "Bytes difference = " + rxDiff); 17 + Log.d(TAG,"Diferencia de temps = " + TimeDifference/1000);
  18 + Log.d(TAG, "Diferencia de bytes = " + rxDiff);
19 if(rxDiff != 0){ 19 if(rxDiff != 0){
20 - bps = ((rxDiff*8) / (TimeDifference/1000)); // total rx bits per second. 20 + bps = ((rxDiff*8) / (TimeDifference/1000)); // total de rx en bits per second.
21 } 21 }
22 else{ 22 else{
23 - bps = -1; //No transmitted data 23 + bps = -1; //No s'han trasmes dades
24 } 24 }
25 return bps; 25 return bps;
26 } 26 }
src/com/upc/pbe/upcnews/Directoris.java
@@ -84,7 +84,7 @@ public class Directoris extends Activity implements OnItemClickListener { @@ -84,7 +84,7 @@ public class Directoris extends Activity implements OnItemClickListener {
84 startActivity(mIntent); 84 startActivity(mIntent);
85 } 85 }
86 else { 86 else {
87 - Toast.makeText(this, "HLS engine error", Toast.LENGTH_LONG).show(); 87 + Toast.makeText(this, "Error en gestor HLS", Toast.LENGTH_LONG).show();
88 } 88 }
89 } 89 }
90 catch (ErrorException e){ 90 catch (ErrorException e){
src/com/upc/pbe/upcnews/HLS.java
@@ -28,10 +28,9 @@ public class HLS @@ -28,10 +28,9 @@ public class HLS
28 String[] files = dir.list(); 28 String[] files = dir.list();
29 for (int i = 0; i < files.length; i++) { 29 for (int i = 0; i < files.length; i++) {
30 File deleteme = new File(dir, files[i]); 30 File deleteme = new File(dir, files[i]);
31 - Log.d(TAG, "Deleted " + files[i].toString()); 31 + Log.d(TAG, "Esborrat " + files[i].toString());
32 deleteme.delete(); 32 deleteme.delete();
33 } 33 }
34 -  
35 currentQuality = 0; 34 currentQuality = 0;
36 currentVideo = currentQuality = currentSegment = 0; 35 currentVideo = currentQuality = currentSegment = 0;
37 this.videos = parsed; 36 this.videos = parsed;
@@ -64,7 +63,7 @@ public class HLS @@ -64,7 +63,7 @@ public class HLS
64 long segmentBytes = TrafficStats.getTotalRxBytes(); 63 long segmentBytes = TrafficStats.getTotalRxBytes();
65 d.descarregarguardar(seg.getURL(),localFolder); 64 d.descarregarguardar(seg.getURL(),localFolder);
66 double bps = bm.Measure(segmentBytes,startTime); 65 double bps = bm.Measure(segmentBytes,startTime);
67 - Log.d(TAG, "Current KB/s: " + (bps/8e3)); 66 + Log.d(TAG, "Velocitat actual (KB/s): " + (bps/8e3));
68 if((bps < qualities.get(currentQuality).getQuality()) && (bps != -1)) { 67 if((bps < qualities.get(currentQuality).getQuality()) && (bps != -1)) {
69 currentQuality++; 68 currentQuality++;
70 } 69 }
src/com/upc/pbe/upcnews/HTMLParser.java
@@ -52,7 +52,7 @@ public class HTMLParser { @@ -52,7 +52,7 @@ public class HTMLParser {
52 if(!resources.contains(dirpath)) { //No siguem repetitius 52 if(!resources.contains(dirpath)) { //No siguem repetitius
53 resources.add(dirpath); 53 resources.add(dirpath);
54 } 54 }
55 - Log.d(TAG, "DIRECTORY FOUND: " + dirpath); 55 + Log.d(TAG, "DIRECTORI TROBAT: " + dirpath);
56 } 56 }
57 } 57 }
58 } 58 }
@@ -88,7 +88,7 @@ public class HTMLParser { @@ -88,7 +88,7 @@ public class HTMLParser {
88 { 88 {
89 resources.add(filepath); 89 resources.add(filepath);
90 } 90 }
91 - Log.d(TAG, "PLAYLIST FOUND: " + filepath); 91 + Log.d(TAG, "PLAYLIST TROBADA: " + filepath);
92 } 92 }
93 } 93 }
94 } 94 }
src/com/upc/pbe/upcnews/Help.java
@@ -15,7 +15,7 @@ public class Help extends Activity{ @@ -15,7 +15,7 @@ public class Help extends Activity{
15 setContentView(R.layout.help); 15 setContentView(R.layout.help);
16 } 16 }
17 public void onStop(){ 17 public void onStop(){
18 - Log.d(TAG, "onStoped"); 18 + Log.d(TAG, "onStopped");
19 super.onStop(); 19 super.onStop();
20 } 20 }
21 } 21 }
src/com/upc/pbe/upcnews/MainActivity.java
@@ -33,7 +33,7 @@ public class MainActivity extends Activity implements OnClickListener { @@ -33,7 +33,7 @@ public class MainActivity extends Activity implements OnClickListener {
33 //Especifiquem la ruta de descarrega 33 //Especifiquem la ruta de descarrega
34 File tempFolder = new File(((UpcApp)getApplication()).getLocalPath()); 34 File tempFolder = new File(((UpcApp)getApplication()).getLocalPath());
35 if(tempFolder.mkdirs()) { 35 if(tempFolder.mkdirs()) {
36 - Log.d(TAG,"Directory " + tempFolder.toString() + " created"); 36 + Log.d(TAG,"Directori " + tempFolder.toString() + " creat");
37 } 37 }
38 //Creem els botons i text 38 //Creem els botons i text
39 URLText = (TextView) findViewById(R.id.textViewUrl); 39 URLText = (TextView) findViewById(R.id.textViewUrl);
@@ -61,10 +61,10 @@ public class MainActivity extends Activity implements OnClickListener { @@ -61,10 +61,10 @@ public class MainActivity extends Activity implements OnClickListener {
61 html = (String) d.doInBackground(((UpcApp)getApplication()).getUrl()); 61 html = (String) d.doInBackground(((UpcApp)getApplication()).getUrl());
62 } 62 }
63 catch(MalformedURLException e) { 63 catch(MalformedURLException e) {
64 - Toast.makeText(this, "Invalid URL", Toast.LENGTH_LONG).show(); 64 + Toast.makeText(this, "URL invalida", Toast.LENGTH_LONG).show();
65 } 65 }
66 catch(IOException e) { 66 catch(IOException e) {
67 - Toast.makeText(this, "Can't find URL", Toast.LENGTH_LONG).show(); 67 + Toast.makeText(this, "No s'ha pogut trobar la URL", Toast.LENGTH_LONG).show();
68 } 68 }
69 } 69 }
70 70
@@ -89,7 +89,7 @@ public class MainActivity extends Activity implements OnClickListener { @@ -89,7 +89,7 @@ public class MainActivity extends Activity implements OnClickListener {
89 switch (item.getItemId()) { 89 switch (item.getItemId()) {
90 case R.id.itemprefs: 90 case R.id.itemprefs:
91 startActivity(new Intent(this, Prefs.class)); 91 startActivity(new Intent(this, Prefs.class));
92 - Log.d(TAG, "Preferences"); 92 + Log.d(TAG, "Preferencies");
93 return true; 93 return true;
94 case R.id.itemhelp: 94 case R.id.itemhelp:
95 startActivity(new Intent(this, Help.class)); 95 startActivity(new Intent(this, Help.class));
src/com/upc/pbe/upcnews/Prefs.java
@@ -8,7 +8,7 @@ import android.view.Menu; @@ -8,7 +8,7 @@ import android.view.Menu;
8 //Menu de preferencies 8 //Menu de preferencies
9 public class Prefs extends PreferenceActivity { 9 public class Prefs extends PreferenceActivity {
10 10
11 - final static String TAG = "Preferences"; 11 + final static String TAG = "Preferencies";
12 12
13 @Override 13 @Override
14 protected void onCreate(Bundle savedInstanceState) { 14 protected void onCreate(Bundle savedInstanceState) {
src/com/upc/pbe/upcnews/UpcApp.java
@@ -11,7 +11,7 @@ import android.util.Log; @@ -11,7 +11,7 @@ import android.util.Log;
11 public class UpcApp extends Application implements 11 public class UpcApp extends Application implements
12 OnSharedPreferenceChangeListener { 12 OnSharedPreferenceChangeListener {
13 13
14 - final static String TAG = "Application"; 14 + final static String TAG = "Aplicacio";
15 private SharedPreferences prefs; // Conjunt de preferencies de l'aplicacio 15 private SharedPreferences prefs; // Conjunt de preferencies de l'aplicacio
16 private String url = null; 16 private String url = null;
17 private String desc; 17 private String desc;