Dynamic line graph drawing issues - Updated

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Dynamic line graph drawing issues - Updated

Postby fawx » Mon Oct 12, 2009 7:53 am

Hi

I am trying to draw a dynamic sine wave which also makes a socket connection to a server and sends out the data of the sine wave.
also, the data is generated, stored and retrieved from a sq lite database.

Everything is fine except that the GUI does not plot the graph continuously, there is a lag in the GUI Update and
the emulator reboots after plotting for a few seconds.

Please help. I have been working on this for quite some time and am at the end of the road. Please HELP.

I have zipped the files since there are quite a few of them.
The server file just displays whatever data it receiver.

Thanks

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. import java.io.BufferedReader;
  3.  
  4. import java.io.InputStreamReader;
  5.  
  6. import java.net.ServerSocket;
  7.  
  8. import java.net.Socket;
  9.  
  10.  
  11.  
  12. public class Testing{
  13.  
  14.         private static Socket toClient;
  15.  
  16.         private static BufferedReader in;
  17.  
  18.  
  19.  
  20.         public static void connect() {
  21.  
  22.  
  23.  
  24.                 try {
  25.  
  26.                         System.out.println("S: Connecting...");
  27.  
  28.                         ServerSocket serverSocket = new ServerSocket(7300);
  29.  
  30.  
  31.  
  32.                         toClient = serverSocket.accept();
  33.  
  34.                         System.out.println("S: Connected");
  35.  
  36.  
  37.  
  38.                         Thread desktopServerThread = new Thread(){                     
  39.  
  40.                                 public void run(){                                     
  41.  
  42.                                         while(true){
  43.  
  44.                                                 try {
  45.  
  46.                                                         in= new BufferedReader(new InputStreamReader(toClient.getInputStream()));
  47.  
  48.                                                         String str;
  49.  
  50.                                                        
  51.  
  52.                                                         if (!(str=in.readLine()).equals("") | !str.equals(" "))
  53.  
  54.                                                                 System.out.println("C: '" + str);
  55.  
  56.  
  57.  
  58.                                                 } catch(Exception e) {
  59.  
  60.                                                         System.out.println("S: Error");
  61.  
  62.                                                         e.printStackTrace();
  63.  
  64.                                                         break;
  65.  
  66.                                                 }
  67.  
  68.                                         }
  69.  
  70.                                 }
  71.  
  72.                         };
  73.  
  74.                         desktopServerThread.start();
  75.  
  76.  
  77.  
  78.                 } catch (Exception e) {
  79.  
  80.                         System.out.println("S: Connection Error");
  81.  
  82.                         e.printStackTrace();
  83.  
  84.                 }      
  85.  
  86.         }
  87.  
  88.  
  89.  
  90.         public static void main (String a[]) {
  91.  
  92.                 connect();                             
  93.  
  94.         }
  95.  
  96. }
  97.  
  98.  
Parsed in 0.036 seconds, using GeSHi 1.0.8.4
Attachments
Example.zip
(69.03 KiB) Downloaded 98 times
fawx
Junior Developer
Junior Developer
 
Posts: 11
Joined: Tue Aug 18, 2009 4:34 am

Top

Postby fawx » Fri Oct 16, 2009 4:07 am

Hi

this is the log report. The code in the red seems to be the problem but i cant solve it
PLease help

DEBUG/StatusBar(567) updateResources
INFO/System.out(706) S: Connecting...
INFO/System.out(706) S: Connnected
WARN/InputManagerService(567) Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@4363d0b8 (uid=10003 pid=610)
WARN/IInputConnectionWrapper(610) showStatusIcon on inactive InputConnection
INFO/ActivityManager(567) Displayed activity com.example.client/.main.DataGuiController:1474ms
DEBUG/dalvikvm(567) GREF has increased to 301
DEBUG/dalvikvm(706) GC freed 7064 objects / 370344 bytes in 85ms
DEBUG/dalvikvm(567) GC freed 2756 objects / 181496 bytes in 119ms
DEBUG/dalvikvm(567) GC freed 588 objects / 25624 bytes in 113ms
DEBUG/dalvikvm(567) GREF has increased to 401
DEBUG/dalvikvm(706) GREF has increased to 201
DEBUG/dalvikvm(706) GC freed 9833 objects / 478208 bytes in 161ms
DEBUG/dalvikvm(567) GREF has increased to 501
DEBUG/dalvikvm(567) GC freed 3815 objects / 162072 bytes in 128ms
DEBUG/dalvikvm(567) GREF has increased to 601
DEBUG/dalvikvm(706) GC freed 9116 objects / 408968 bytes in 167ms
DEBUG/dalvikvm(706) GREF has increased to 301
DEBUG/dalvikvm(567) GC freed 3642 objects / 157520 bytes in 137ms
WARN/ActivityManager(567) Launch timeout has expired, giving up wake lock!
WARN/ActivityManager(567) Activity idle timeout for HistoryRecord{436607b0 {com.example.client/com.example.client.main.DataMonitor}}
WARN/ActivityManager(567) Activity idle timeout for HistoryRecord{43680e80 {com.example.client/com.example.client.main.DataGuiController}}
DEBUG/dalvikvm(567) GREF has increased to 701
DEBUG/dalvikvm(706) GC freed 9788 objects / 443704 bytes in 189ms
DEBUG/dalvikvm(567) GREF has increased to 801
DEBUG/dalvikvm(706) GREF has increased to 401
DEBUG/dalvikvm(567) GC freed 3642 objects / 155848 bytes in 139ms
DEBUG/dalvikvm(706) GC freed 10309 objects / 465384 bytes in 206ms
DEBUG/dalvikvm(567) GREF has increased to 901
DEBUG/dalvikvm(607) GC freed 1857 objects / 117056 bytes in 266ms
DEBUG/dalvikvm(567) GC freed 3905 objects / 165808 bytes in 129ms
DEBUG/dalvikvm(706) GC freed 9809 objects / 442024 bytes in 201ms
DEBUG/dalvikvm(567) GREF has increased to 1001
DEBUG/dalvikvm(706) GREF has increased to 501
DEBUG/dalvikvm(567) GREF has increased to 1101
DEBUG/dalvikvm(635) GC freed 2839 objects / 161640 bytes in 208ms
DEBUG/dalvikvm(567) GC freed 4697 objects / 197128 bytes in 243ms
DEBUG/dalvikvm(706) GC freed 10644 objects / 474280 bytes in 191ms
DEBUG/dalvikvm(567) GREF has increased to 1201
DEBUG/dalvikvm(706) GREF has increased to 601
DEBUG/dalvikvm(706) GC freed 10019 objects / 455440 bytes in 187ms
DEBUG/dalvikvm(567) GC freed 4262 objects / 181416 bytes in 126ms
DEBUG/dalvikvm(567) GREF has increased to 1301
DEBUG/dalvikvm(610) GC freed 3042 objects / 181736 bytes in 298ms
DEBUG/dalvikvm(706) GC freed 10552 objects / 479312 bytes in 211ms
DEBUG/dalvikvm(567) GREF has increased to 1401
DEBUG/dalvikvm(706) GREF has increased to 701
DEBUG/dalvikvm(567) GC freed 3708 objects / 155288 bytes in 108ms
DEBUG/dalvikvm(706) GC freed 10207 objects / 456880 bytes in 197ms
DEBUG/dalvikvm(567) GREF has increased to 1501
DEBUG/dalvikvm(567) GC freed 4604 objects / 204280 bytes in 131ms
DEBUG/dalvikvm(706) GC freed 10652 objects / 486456 bytes in 207ms
DEBUG/dalvikvm(567) GREF has increased to 1601
DEBUG/dalvikvm(706) GREF has increased to 801
DEBUG/dalvikvm(567) GREF has increased to 1701
DEBUG/dalvikvm(567) GC freed 3624 objects / 159632 bytes in 126ms
DEBUG/dalvikvm(706) GC freed 11465 objects / 517056 bytes in 237ms
DEBUG/dalvikvm(567) GREF has increased to 1801
DEBUG/dalvikvm(706) GREF has increased to 901
DEBUG/dalvikvm(567) GC freed 4677 objects / 195592 bytes in 110ms
DEBUG/dalvikvm(706) GC freed 11727 objects / 531536 bytes in 238ms
DEBUG/dalvikvm(567) GREF has increased to 1901
DEBUG/dalvikvm(567) GREF has increased to 2001
WARN/dalvikvm(567) Last 10 entries in JNI global reference table
WARN/dalvikvm(567) 1991:0x436b0228 cls=Ljava/lang/ref/WeakReference; (28 bytes)
WARN/dalvikvm(567) 1992:0x436c66c0 cls=Landroid/content/ContentService$ObserverNode$ObserverEntry; (20 bytes)
WARN/dalvikvm(567) 1993:0x436a1108 cls=Ljava/lang/ref/WeakReference; (28 bytes)
WARN/dalvikvm(567) 1994:0x436a1180 cls=Landroid/content/ContentService$ObserverNode$ObserverEntry; (20 bytes)
WARN/dalvikvm(567) 1995:0x4361b308 cls=Ljava/lang/ref/WeakReference; (28 bytes)
WARN/dalvikvm(567) 1996:0x43731380 cls=Landroid/content/ContentService$ObserverNode$ObserverEntry; (20 bytes)
WARN/dalvikvm(567) 1997:0x437313f8 cls=Ljava/lang/ref/WeakReference; (36 bytes)
WARN/dalvikvm(567) 1998:0x436b2060 cls=Landroid/content/ContentService$ObserverNode$ObserverEntry; (20 bytes)
WARN/dalvikvm(567) 1999:0x43698260 cls=Ljava/lang/ref/WeakReference; (36 bytes)
WARN/dalvikvm(567) 2000:0x4367a9a8 cls=Landroid/content/ContentService$ObserverNode$ObserverEntry; (20 bytes)
WARN/dalvikvm(567) JNI global reference table summary (2001 entries)
WARN/dalvikvm(567) 62 of Ljava/lang/Class; 164B (47 unique)
WARN/dalvikvm(567) 1 of Ljava/lang/String; 28B
WARN/dalvikvm(567) 1 of [B 116B
WARN/dalvikvm(567) 1 of [B 1044B
WARN/dalvikvm(567) 821 of Ljava/lang/ref/WeakReference; 28B (821 unique)
WARN/dalvikvm(567) 151 of Ljava/lang/ref/WeakReference; 36B (151 unique)
WARN/dalvikvm(567) 1 of Landroid/os/Binder; 20B
WARN/dalvikvm(567) 1 of Ldalvik/system/VMRuntime; 12B
WARN/dalvikvm(567) 1 of Landroid/content/ContentProvider$Transport; 28B
WARN/dalvikvm(567) 8 of Landroid/database/ContentObserver$Transport; 28B (8 unique)
WARN/dalvikvm(567) 2 of Landroid/database/CursorToBulkCursorAdaptor; 44B (2 unique)
WARN/dalvikvm(567) 1 of Lcom/android/server/HardwareService; 68B
WARN/dalvikvm(567) 1 of Lcom/android/server/AlarmManagerService; 100B
WARN/dalvikvm(567) 1 of Lcom/android/server/BatteryService; 124B
WARN/dalvikvm(567) 1 of Lcom/android/server/SensorService; 28B
WARN/dalvikvm(567) 1 of Lcom/android/server/am/ActivityManagerService; 404B
WARN/dalvikvm(567) 1 of Lcom/android/server/PowerManagerService; 300B
WARN/dalvikvm(567) 1 of Lcom/android/server/am/BatteryStatsService; 28B
WARN/dalvikvm(567) 1 of Lcom/android/server/am/UsageStatsService; 76B
WARN/dalvikvm(567) 1 of Lcom/android/server/TelephonyRegistry; 84B
WARN/dalvikvm(567) 1 of Lcom/android/server/PackageManagerService; 204B
WARN/dalvikvm(567) 839 of Landroid/content/ContentService$ObserverNode$ObserverEntry; 20B (839 unique)
WARN/dalvikvm(567) 52 of Landroid/content/ContentService$ObserverNode$ObserverEntry; 28B (52 unique)
WARN/dalvikvm(567) 1 of Lcom/android/server/am/PendingIntentRecord; 44B
WARN/dalvikvm(567) 1 of Lcom/android/server/status/StatusBarService; 276B
WARN/dalvikvm(567) 1 of Lcom/android/server/WindowManagerService; 356B
WARN/dalvikvm(567) 1 of Landroid/content/ContentService; 44B
WARN/dalvikvm(567) 1 of Lcom/android/server/am/ActivityManagerService$PermissionController; 28B
WARN/dalvikvm(567) 1 of Lcom/android/server/am/ActivityManagerService$ProvidersBinder; 28B
WARN/dalvikvm(567) 1 of Lcom/android/server/am/ActivityManagerService$SendersBinder; 28B
WARN/dalvikvm(567) 1 of Lcom/android/server/am/ActivityManagerService$ServicesBinder; 28B
WARN/dalvikvm(567) 1 of Lcom/android/server/am/ActivityManagerService$BroadcastsBinder; 28B
WARN/dalvikvm(567) 1 of Lcom/android/server/am/ActivityManagerService$CpuBinder; 28B
WARN/dalvikvm(567) 1 of Lcom/android/server/am/ActivityManagerService$MemBinder; 28B
WARN/dalvikvm(567) 1 of Lcom/android/server/ClipboardService; 28B
WARN/dalvikvm(567) 1 of Lcom/android/server/InputMethodManagerService; 172B
WARN/dalvikvm(567) 3 of Lcom/android/server/am/HistoryRecord; 252B (3 unique)
WARN/dalvikvm(567) 1 of Lcom/android/server/NetStatService; 20B
WARN/dalvikvm(567) 1 of Lcom/android/server/ConnectivityService; 60B
WARN/dalvikvm(567) 1 of Lcom/android/server/WifiService; 108B
WARN/dalvikvm(567) 1 of Lcom/android/server/NotificationManagerService; 100B
WARN/dalvikvm(567) 1 of Lcom/android/server/MountService; 60B
WARN/dalvikvm(567) 1 of Lcom/android/server/DeviceStorageMonitorService; 108B
WARN/dalvikvm(567) 1 of Lcom/android/server/LocationManagerService; 220B
WARN/dalvikvm(567) 1 of Landroid/server/search/SearchManagerService; 44B
WARN/dalvikvm(567) 1 of Lcom/android/server/FallbackCheckinService; 28B
WARN/dalvikvm(567) 1 of Lcom/android/server/WallpaperService; 44B
WARN/dalvikvm(567) 1 of Landroid/media/AudioService; 100B
WARN/dalvikvm(567) 1 of Lcom/android/server/AppWidgetService; 60B
WARN/dalvikvm(567) 7 of Lcom/android/server/am/ActivityManagerService$AppDeathRecipient; 28B (7 unique)
WARN/dalvikvm(567) 4 of Lcom/android/server/WindowManagerService$Session; 76B (2 unique)
WARN/dalvikvm(567) 3 of Lcom/android/server/WindowManagerService$WindowState$DeathRecipient; 12B (3 unique)
WARN/dalvikvm(567) 1 of Landroid/os/RemoteCallbackList$Callback; 20B
WARN/dalvikvm(567) 4 of Lcom/android/server/am/ServiceRecord; 172B (4 unique)
WARN/dalvikvm(567) 1 of Landroid/app/ActivityThread$PackageInfo$ServiceDispatcher$DeathMonitor; 20B
WARN/dalvikvm(567) 2 of Lcom/android/server/InputMethodManagerService$MethodCallback; 28B (2 unique)
WARN/dalvikvm(567) Memory held directly by native code is 61336 bytes
ERROR/dalvikvm(567) Excessive JNI global references (2001)

ERROR/dalvikvm(567) VM aborting
INFO/DEBUG(539) *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
INFO/DEBUG(539) Build fingerprint: 'generic/sdk/generic/:1.5/CUPCAKE/150240:eng/test-keys'
INFO/DEBUG(539) pid: 567, tid: 571 >>> system_server <<<
INFO/DEBUG(539) signal 11 (SIGSEGV), fault addr deadd00d
INFO/DEBUG(539) r0 00000328 r1 0000000c r2 0000000c r3 00000026
INFO/DEBUG(539) r4 deadd00d r5 00000001 r6 000007d1 r7 ad083e10
INFO/DEBUG(539) r8 44742bb0 r9 4103fe50 10 4103fe3c fp 00000001
INFO/DEBUG(539) ip ad083eec sp 44742af0 lr afe13e4d pc ad03b5c2 cpsr 20000030
INFO/DEBUG(539) #00 pc 0003b5c2 /system/lib/libdvm.so
INFO/DEBUG(539) #01 pc 0003e69a /system/lib/libdvm.so
INFO/DEBUG(539) #02 pc 0003e8ea /system/lib/libdvm.so
INFO/DEBUG(539) #03 pc 0003063c /system/lib/libdvm.so
INFO/DEBUG(539) #04 pc 00038678 /system/lib/libandroid_runtime.so
INFO/DEBUG(539) #05 pc 0003871a /system/lib/libandroid_runtime.so
INFO/DEBUG(539) #06 pc 0000e3b4 /system/lib/libdvm.so
INFO/DEBUG(539) #07 pc 00040a8a /system/lib/libdvm.so
INFO/DEBUG(539) #08 pc 00013118 /system/lib/libdvm.so
INFO/DEBUG(539) #09 pc 00017b1c /system/lib/libdvm.so
INFO/DEBUG(539) #10 pc 00017560 /system/lib/libdvm.so
INFO/DEBUG(539) #11 pc 000520ec /system/lib/libdvm.so
INFO/DEBUG(539) #12 pc 00040670 /system/lib/libdvm.so
INFO/DEBUG(539) #13 pc 0002fca4 /system/lib/libdvm.so
INFO/DEBUG(539) #14 pc 00037406 /system/lib/libandroid_runtime.so
INFO/DEBUG(539) #15 pc 00038bbc /system/lib/libandroid_runtime.so
INFO/DEBUG(539) #16 pc 0002acc4 /system/lib/libutils.so
INFO/DEBUG(539) #17 pc 0002e76c /system/lib/libutils.so
INFO/DEBUG(539) #18 pc 0002e942 /system/lib/libutils.so
INFO/DEBUG(539) #19 pc 00033600 /system/lib/libutils.so
INFO/DEBUG(539) #20 pc 000287f4 /system/lib/libutils.so
INFO/DEBUG(539) #21 pc 000280e6 /system/lib/libandroid_runtime.so
INFO/DEBUG(539) #22 pc 000285d4 /system/lib/libutils.so
INFO/DEBUG(539) #23 pc 0000f880 /system/lib/libc.so
INFO/DEBUG(539) #24 pc 0000f3f4 /system/lib/libc.so
INFO/DEBUG(539) stack
INFO/DEBUG(539) 44742ab0 00000014
INFO/DEBUG(539) 44742ab4 44742af8
INFO/DEBUG(539) 44742ab8 afe39f90
INFO/DEBUG(539) 44742abc afe39fe4
INFO/DEBUG(539) 44742ac0 00000000
INFO/DEBUG(539) 44742ac4 afe13e4d /system/lib/libc.so
INFO/DEBUG(539) 44742ac8 0029a3e0 [heap]
INFO/DEBUG(539) 44742acc afe12e69 /system/lib/libc.so
INFO/DEBUG(539) 44742ad0 00000000
INFO/DEBUG(539) 44742ad4 ad083e10
INFO/DEBUG(539) 44742ad8 00000001
INFO/DEBUG(539) 44742adc 000007d1
INFO/DEBUG(539) 44742ae0 ad083e10
INFO/DEBUG(539) 44742ae4 afe12ecd /system/lib/libc.so
INFO/DEBUG(539) 44742ae8 df002777
INFO/DEBUG(539) 44742aec e3a070ad
INFO/DEBUG(539) #00 44742af0 fffea834
INFO/DEBUG(539) 44742af4 ad03e69f /system/lib/libdvm.so
INFO/DEBUG(539) #01 44742af8 ad083e10
INFO/DEBUG(539) 44742afc ad069e58 /system/lib/libdvm.so
INFO/DEBUG(539) 44742b00 ad084d8c
INFO/DEBUG(539) 44742b04 4367a9a8
INFO/DEBUG(539) 44742b08 00000007
INFO/DEBUG(539) 44742b0c 4367a9a8
INFO/DEBUG(539) 44742b10 00101730 [heap]
INFO/DEBUG(539) 44742b14 00070088 [heap]
INFO/DEBUG(539) 44742b18 4367a9a8
INFO/DEBUG(539) 44742b1c ad03e8ef /system/lib/libdvm.so
DEBUG/dalvikvm(706) GC freed 12365 objects / 563608 bytes in 210ms
INFO/ActivityThread(687) Removing dead content provider : settings
INFO/ActivityThread(660) Removing dead content provider : settings
DEBUG/dalvikvm(706) GREF has decreased to 799
DEBUG/dalvikvm(706) GREF has decreased to 699
DEBUG/dalvikvm(706) GREF has decreased to 599
DEBUG/dalvikvm(706) GREF has decreased to 499
DEBUG/dalvikvm(706) GREF has decreased to 399
DEBUG/dalvikvm(706) GREF has decreased to 299
DEBUG/dalvikvm(706) GREF has decreased to 199
DEBUG/dalvikvm(706) GREF has decreased to 99
fawx
Junior Developer
Junior Developer
 
Posts: 11
Joined: Tue Aug 18, 2009 4:34 am

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 7 guests