[logcatudp] 2 new revisions pushed by jmad...@gmail.com on 2012-03-12 23:47 GMT

0 views
Skip to first unread message

logc...@googlecode.com

unread,
Mar 12, 2012, 7:48:51 PM3/12/12
to logcatud...@googlegroups.com
2 new revisions:

Revision: f18a30eb385c
Author: chemik@starky
Date: Mon Mar 12 16:45:02 2012
Log: Added function to share log to menu (choose app which you want).
http://code.google.com/p/logcatudp/source/detail?r=f18a30eb385c

Revision: 235851c34938
Author: chemik@starky
Date: Mon Mar 12 16:46:35 2012
Log: Increased version.
http://code.google.com/p/logcatudp/source/detail?r=235851c34938

==============================================================================
Revision: f18a30eb385c
Author: chemik@starky
Date: Mon Mar 12 16:45:02 2012
Log: Added function to share log to menu (choose app which you want).
http://code.google.com/p/logcatudp/source/detail?r=f18a30eb385c

Added:
/project.properties
Deleted:
/default.properties
Modified:
/.classpath
/gen/sk/madzik/android/logcatudp/R.java
/res/values/strings.xml
/src/sk/madzik/android/logcatudp/LogcatUdpCfg.java

=======================================
--- /dev/null
+++ /project.properties Mon Mar 12 16:45:02 2012
@@ -0,0 +1,11 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system use,
+# "ant.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=android-4
=======================================
--- /default.properties Tue Nov 23 11:17:41 2010
+++ /dev/null
@@ -1,11 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system use,
-# "build.properties", and override values to adapt the script to your
-# project structure.
-
-# Project target.
-target=android-4
=======================================
--- /.classpath Tue Oct 26 14:27:21 2010
+++ /.classpath Mon Mar 12 16:45:02 2012
@@ -3,5 +3,5 @@
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con"
path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
- <classpathentry kind="output" path="bin"/>
+ <classpathentry kind="output" path="bin/classes"/>
</classpath>
=======================================
--- /gen/sk/madzik/android/logcatudp/R.java Fri Jun 3 05:56:14 2011
+++ /gen/sk/madzik/android/logcatudp/R.java Mon Mar 12 16:45:02 2012
@@ -38,15 +38,16 @@
public static final int app_name=0x7f040000;
public static final int autostart=0x7f040004;
public static final int deactivate_service=0x7f040006;
- public static final int filter=0x7f04000d;
+ public static final int filter=0x7f04000e;
public static final int id=0x7f040002;
public static final int mnuClear=0x7f040009;
public static final int mnuClose=0x7f040008;
public static final int mnuSave=0x7f040007;
- public static final int notif_message=0x7f04000b;
- public static final int notif_text=0x7f04000a;
+ public static final int mnuShare=0x7f04000a;
+ public static final int notif_message=0x7f04000c;
+ public static final int notif_text=0x7f04000b;
public static final int send_ids=0x7f040001;
public static final int server_port=0x7f040003;
- public static final int usefilter=0x7f04000c;
+ public static final int usefilter=0x7f04000d;
}
}
=======================================
--- /res/values/strings.xml Fri Jun 3 05:56:14 2011
+++ /res/values/strings.xml Mon Mar 12 16:45:02 2012
@@ -11,6 +11,7 @@
<string name="mnuSave">Save</string>
<string name="mnuClose">Cancel/Close</string>
<string name="mnuClear">Clear log</string>
+<string name="mnuShare">Share log</string>
<string name="notif_text">LogcatUDP service running</string>
<string name="notif_message">Configure Logcat to UDP, restart or stop
sending.</string>
<string name="usefilter">Filter log messages</string>
=======================================
--- /src/sk/madzik/android/logcatudp/LogcatUdpCfg.java Fri Jun 3 05:56:14
2011
+++ /src/sk/madzik/android/logcatudp/LogcatUdpCfg.java Mon Mar 12 16:45:02
2012
@@ -1,11 +1,17 @@
package sk.madzik.android.logcatudp;

+import java.io.BufferedReader;
+import java.io.DataInputStream;
import java.io.IOException;
+import java.io.InputStreamReader;

import android.app.Activity;
+import android.app.ProgressDialog;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
import android.provider.Settings.Secure;
import android.text.TextUtils;
import android.util.Log;
@@ -25,6 +31,7 @@
private static final int MENU_SAVE = Menu.FIRST + 1;
private static final int MENU_CANCEL = Menu.FIRST + 2;
private static final int MENU_CLR_LOG = Menu.FIRST + 3;
+ private static final int MENU_SHARE = Menu.FIRST + 4;

static final String DEF_SERVER = "192.168.1.10";
static final int DEF_PORT = 10009;
@@ -44,6 +51,8 @@
private Button btnActivateService;
private Button btnDeactivateService;

+ ProgressDialog prgDialog;
+
public class Preferences
{
public static final String PREFS_NAME = "LogcatUdp";
@@ -158,6 +167,9 @@
MenuItem mnuClear = menu.add(0, MENU_CLR_LOG, 0,
getString(R.string.mnuClear) );
mnuClear.setIcon(android.R.drawable.ic_menu_delete);

+ MenuItem mnuShare = menu.add(0, MENU_SHARE, 0,
getString(R.string.mnuShare) );
+ mnuShare.setIcon(android.R.drawable.ic_menu_share);
+
return super.onCreateOptionsMenu(menu);
}

@@ -180,12 +192,46 @@
Log.e( TAG, "Clearing log failed!" );
e.printStackTrace();
}
+ break;
+ case MENU_SHARE:
+ prgDialog = ProgressDialog.show(this, "", "Loading log. Please
wait...", true);
+ Thread checkUpdate = new Thread() {
+ public void run() {
+ Intent intent=new Intent(android.content.Intent.ACTION_SEND);
+ intent.setType("text/plain");
+ intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
+ String androidID =
Secure.getString(LogcatUdpCfg.this.getContentResolver(), Secure.ANDROID_ID);
+ intent.putExtra(Intent.EXTRA_SUBJECT, "Logcat from phone: " +
androidID);
+ try {
+ Process process = Runtime.getRuntime().exec( "logcat -d" );
+ DataInputStream reader = new
DataInputStream(process.getInputStream());
+ String extraText = "";
+ String ln_str;
+ while ((ln_str = reader.readLine()) != null) {
+ extraText += ln_str + System.getProperty("line.separator");
+ }
+ intent.putExtra(Intent.EXTRA_TEXT, extraText);
+ startActivity(Intent.createChooser(intent, "How do you want to
share?"));
+ } catch (IOException e) {
+ Log.e( TAG, "Sharing log failed!" );
+ e.printStackTrace();
+ }
+ handler.sendEmptyMessage(0);
+ }
+ };
+ checkUpdate.start();
break;
}

return super.onOptionsItemSelected(item);
}

+ final Handler handler = new Handler() {
+ public void handleMessage(Message msg) {
+ prgDialog.dismiss();
+ }
+ };
+
private void startService() {
Intent serviceIntent = new Intent(LogcatUdpCfg.this,
LogcatUdpService.class);
Log.d(TAG, "Start service");

==============================================================================
Revision: 235851c34938
Author: chemik@starky
Date: Mon Mar 12 16:46:35 2012
Log: Increased version.
http://code.google.com/p/logcatudp/source/detail?r=235851c34938

Modified:
/AndroidManifest.xml

=======================================
--- /AndroidManifest.xml Tue Oct 4 05:53:03 2011
+++ /AndroidManifest.xml Mon Mar 12 16:46:35 2012
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="sk.madzik.android.logcatudp"
- android:versionCode="4"
- android:versionName="0.4">
+ android:versionCode="5"
+ android:versionName="0.5">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_LOGS" />
<uses-permission
android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

Reply all
Reply to author
Forward
0 new messages