Jay Tomten
Jay Tomten

Reputation: 1717

Android ICS Compatibility

I have a couple projects i am officially moving to ICS and having some odd compatibility issues. Both projects work well in Androdid 2.2 and 2.3. Both projects originally had the following in the manifest:

<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="10"  />

After I connect to my new ICS device and run I have errors with some Java APIs (included in the project as jar files) that use java.net.Socket and java.io.* among others. When I remove android:targetSdkVersion="10" from the manifest things start to work again in ICS. However, there is some performance issues and the following shows up quite a bit in the Eclipse DDMS LogCat:

threadid=3: reacting to signal 3
Wrote stack traces to '/data/anr/traces.txt'

Here is the traces.txt output:

----- pid 29070 at 2012-04-24 08:52:42 -----
Cmd line: com.COMPANY.MOBILEAPP

DALVIK THREADS:
(mutexes: tll=0 tsl=0 tscl=0 ghl=0)
"main" prio=5 tid=1 NATIVE
  | group="main" sCount=1 dsCount=0 obj=0x40a4f460 self=0x705830
  | sysTid=29070 nice=0 sched=0/0 cgrp=default handle=1075090568
  | schedstat=( 0 0 0 ) utm=657 stm=52 core=0
  at libcore.io.Posix.recvfromBytes(Native Method)
  at libcore.io.Posix.recvfrom(Posix.java:131)
  at libcore.io.BlockGuardOs.recvfrom(BlockGuardOs.java:164)
  at libcore.io.IoBridge.recvfrom(IoBridge.java:503)
  at java.net.PlainSocketImpl.read(PlainSocketImpl.java:488)
  at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:46)
  at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:240)
  at java.io.InputStream.read(InputStream.java:163)
  at java.io.BufferedInputStream.fillbuf(BufferedInputStream.java:142)
  at java.io.BufferedInputStream.read(BufferedInputStream.java:227)
  at com.COMPANY.tools.Response.receive(Response.java:592)
  at com.COMPANY.tools.Response.getResponse(Response.java:100)
  at com.COMPANY.tools.Response.<init>(Response.java:73)
  at com.COMPANY.PRODUCT.JAVAAPI.submit(JAVAAPI.java:267)
  at com.COMPANY.PRODUCT.JAVAAPI.Logon(JAVAAPI.java:602)
  at com.COMPANY.MOBILEAPP.PRODUCTAdapter.Connect(PRODUCTAdapter.java:50)
  at com.COMPANY.MOBILEAPP.Browse.onResume(Browse.java:105)
  at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1154)
  at android.app.Activity.performResume(Activity.java:4539)
  at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2434)
  at android.app.LocalActivityManager.moveToState(LocalActivityManager.java:169)
  at android.app.LocalActivityManager.dispatchResume(LocalActivityManager.java:523)
  at android.app.ActivityGroup.onResume(ActivityGroup.java:61)
  at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1154)
  at android.app.Activity.performResume(Activity.java:4539)
  at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2434)
  at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2472)
  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1173)
  at android.os.Handler.dispatchMessage(Handler.java:99)
  at android.os.Looper.loop(Looper.java:137)
  at android.app.ActivityThread.main(ActivityThread.java:4424)
  at java.lang.reflect.Method.invokeNative(Native Method)
  at java.lang.reflect.Method.invoke(Method.java:511)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:554)
  at dalvik.system.NativeStart.main(Native Method)

"Binder Thread #2" prio=5 tid=10 NATIVE
  | group="main" sCount=1 dsCount=0 obj=0x41346498 self=0x8dd648
  | sysTid=29082 nice=0 sched=0/0 cgrp=default handle=9335880
  | schedstat=( 0 0 0 ) utm=0 stm=0 core=0
  at dalvik.system.NativeStart.run(Native Method)

"Binder Thread #1" prio=5 tid=9 NATIVE
  | group="main" sCount=1 dsCount=0 obj=0x413406b0 self=0x8e7a80
  | sysTid=29081 nice=0 sched=0/0 cgrp=default handle=9062432
  | schedstat=( 0 0 0 ) utm=0 stm=0 core=0
  at dalvik.system.NativeStart.run(Native Method)

"FinalizerWatchdogDaemon" daemon prio=5 tid=8 TIMED_WAIT
  | group="main" sCount=1 dsCount=0 obj=0x4133bd60 self=0x8d50a8
  | sysTid=29080 nice=0 sched=0/0 cgrp=default handle=9302200
  | schedstat=( 0 0 0 ) utm=0 stm=0 core=0
  at java.lang.VMThread.sleep(Native Method)
  at java.lang.Thread.sleep(Thread.java:1031)
  at java.lang.Thread.sleep(Thread.java:1013)
  at java.lang.Daemons$FinalizerWatchdogDaemon.run(Daemons.java:213)
  at java.lang.Thread.run(Thread.java:856)

"FinalizerDaemon" daemon prio=5 tid=7 WAIT
  | group="main" sCount=1 dsCount=0 obj=0x4133bc08 self=0x8de4e0
  | sysTid=29079 nice=0 sched=0/0 cgrp=default handle=9329168
  | schedstat=( 0 0 0 ) utm=0 stm=0 core=0
  at java.lang.Object.wait(Native Method)
  - waiting on <0x40a455d0> (a java.lang.ref.ReferenceQueue)
  at java.lang.Object.wait(Object.java:401)
  at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:102)
  at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:73)
  at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:168)
  at java.lang.Thread.run(Thread.java:856)

"ReferenceQueueDaemon" daemon prio=5 tid=6 WAIT
  | group="main" sCount=1 dsCount=0 obj=0x4133baa0 self=0x7983d8
  | sysTid=29078 nice=0 sched=0/0 cgrp=default handle=9123568
  | schedstat=( 0 0 0 ) utm=0 stm=0 core=0
  at java.lang.Object.wait(Native Method)
  - waiting on <0x40a454f8> 
  at java.lang.Object.wait(Object.java:364)
  at java.lang.Daemons$ReferenceQueueDaemon.run(Daemons.java:128)
  at java.lang.Thread.run(Thread.java:856)

"Compiler" daemon prio=5 tid=5 VMWAIT
  | group="system" sCount=1 dsCount=0 obj=0x4133b9b0 self=0x8cc328
  | sysTid=29077 nice=0 sched=0/0 cgrp=default handle=9055824
  | schedstat=( 0 0 0 ) utm=32 stm=15 core=0
  at dalvik.system.NativeStart.run(Native Method)

"JDWP" daemon prio=5 tid=4 VMWAIT
  | group="system" sCount=1 dsCount=0 obj=0x4133b8c8 self=0x8d0a60
  | sysTid=29076 nice=0 sched=0/0 cgrp=default handle=9122016
  | schedstat=( 0 0 0 ) utm=0 stm=0 core=0
  at dalvik.system.NativeStart.run(Native Method)

"Signal Catcher" daemon prio=5 tid=3 RUNNABLE
  | group="system" sCount=0 dsCount=0 obj=0x4133b7d0 self=0x8ae310
  | sysTid=29074 nice=0 sched=0/0 cgrp=default handle=9346264
  | schedstat=( 0 0 0 ) utm=48 stm=37 core=0
  at dalvik.system.NativeStart.run(Native Method)

"GC" daemon prio=5 tid=2 VMWAIT
  | group="system" sCount=1 dsCount=0 obj=0x4133b6f0 self=0x890958
  | sysTid=29072 nice=0 sched=0/0 cgrp=default handle=8971592
  | schedstat=( 0 0 0 ) utm=14 stm=0 core=0
  at dalvik.system.NativeStart.run(Native Method)

----- end 29070 -----

Can anyone help point me in the right direction here?

Upvotes: 0

Views: 1852

Answers (2)

Kuffs
Kuffs

Reputation: 35661

Check out android.os.NetworkOnMainThreadException You may be performing network operations on the UI thread which was permitted pre-honeycomb but now throws an exception

Upvotes: 3

Tor P
Tor P

Reputation: 1361

connect the ADB logcat utility to see what happens... this is also part of the Eclipse plugin, if it doesn't show up in your workspace then just enable it through Window->Show view->other and find LogCat under the Android section

Upvotes: 0

Related Questions