[android-developers] Fwd: sometimes CTS cannot detect the device connection after reboot

2011-06-30 Thread waterblood



-- Forwarded message --
From: waterblood guoyin.c...@gmail.com
Date: Jun 30, 10:44 am
Subject: sometimes CTS cannot detect the device connection after
reboot
To: android-platform


CTS will try to reboot device every 200 case. And sometimes, CTS
cannot detect the device connection after reboot.
it should be a common issue. The CTS reboot the device as below:
1. CTS issue a command “adb shell reboot” to reboot device.
2. CTS will wait for around 5 seconds, then disconnect the
AndroidDebugBridge and exec the command “adb kill-server”.
3. CTS start the adb server, and keep query whether the device’s adb
usb device present in host Linux pc directory “/dev/bus/usb”.
4. Once the adb server in host side detect the device’s adb, it will
create a usb transport for this device and update CTS with transport.
At this time the usb transport’s connection_state is “CS_OFFLINE”
5. Adb server will issue the command “SYNC” and “CNXN” to device
through adb usb connection. After adb server receive the reponse
“CNXN” from device’s adb usb connection, it will set the usb
transport’s connection_state to “CS_DEVICE” state.
6. CTS will send a msg “host:transport:serialnumber” to adb server.
And adb server will reponse this msg with “OK” if the usb transport’s
connection_state in “CS_DEVICE” state, or with “FAIL” if the usb
transport’s connection_state in “CS_OFFLINE” state.
7. If the adb server return “OK” in step 6, the CTS can go forward the
test case.
8. If the adb server return “FAIL” in step 6, It will cause a
AdbCommandRejectedException exception in DeviceServiceMonitor::run().
This will block the CTS to connect with device adb.

The root cause is once the step 4 has been finished,  the step 6(msg
“host:transport:serialnumber”) may be occurred before the step
5(commandreponse “SYNC””CNXN”) finished. So adb server will return
“FAIL” msg to the command “host:transport:serialnumber”, which will
make CTS failed to finish the reboot function.

The fix should be in host side adb or CTS code to make sure the
command “host:transport:serialnumber” only issue when “SYNC” and
“CNXN” response has been proceed. I guess this should be in all
android device.

i dont know does anyone notice this, or maybe my analyse is not right.
I wonder

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] AndroidHttpTransport.call() blocking too much time when using KSOAP in Android

2010-07-23 Thread waterblood
Hi All,

 I am trying to use the KSOAP in Android, i have the function as
below. Sometimes the calling of androidHttp.call(GETVERSION_ACTION,
envelope); will return the reponse very fast. But some times it take
me almost one minutes for this AndroidHttpTransport.call get return.
That means AndroidHttpTransport.call() may block for almost one
minutes. I have checked the http package deliver between my client and
server. The HTTP post package send almost one minutes after the time
AndroidHttpTransport.call() be scheduled. So the block time should be
no relationship with network or http server. It blocks the most part
of time before it start to sent the HTTP post package.
 Also getVersion() will be called in multi-thread. Does this will
effect the AndroidHttpTransport.call() function a lot?

Any one comment will be very appreciated.


public static String getVersion(){
String version;
Log.i(TAG,getVersion);
AndroidHttpTransport androidHttp = new 
AndroidHttpTransport(URL);
//androidHttp.debug = true;
androidHttp.setXmlVersionTag(?xml version=\1.0\ encoding=
\UTF-8\?);
Log.i(TAG,new SoapObject());
SoapObject request = new SoapObject(NAMESPACE, 
GETVERSION_METHOD);
Log.i(TAG,addProperty);
request.addProperty(v, 1,2);
SoapSerializationEnvelope envelope = new
SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.implicitTypes = true;

envelope.setOutputSoapObject(request);

try {
Log.i(TAG,androidHttp.call());
androidHttp.call(GETVERSION_ACTION, envelope);
SoapPrimitive result = (SoapPrimitive)envelope.getResponse();
//Log.i(TAG,Reponse dump:+androidHttp.responseDump);
//to get the data
version = result.toString();
Log.i(TAG,***envelope.getResponse():+version);
}catch (Exception e) {
e.printStackTrace();
return null;
}
return version;
}

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] How to run the VoiceSearch.apk

2010-05-24 Thread waterblood
Hi All,

 I just download a VoiceSearch.apk, and put it to my eclair version
rootfs of android. It has below exception. Does anything still need to
be configed?

I/ActivityManager( 2083): Start proc com.google.android.voicesearch
for activity com.google.android.voicesearch/.RecognitionActivity:
pid=2348 uid=10025 gids={3003, 1015}
D/dalvikvm( 2083): DexOpt: incorrect opt magic number (0xff ff ff ff)
D/installd( 2063): DexInv: --- BEGIN '/system/app/VoiceSearch.apk' ---
D/dalvikvm( 2356): DexOpt: load 46ms, verify 205ms, opt 8ms
D/installd( 2063): DexInv: --- END '/system/app/
VoiceSearch.apk' (success) ---
D/dalvikvm( 2348): Total arena pages for JIT: 2
W/ApplicationContext( 2348): getSharedPreferences
W/ApplicationContext( 2348): org.xmlpull.v1.XmlPullParserException:
Error parsing document. (position:line -1, column -1) caused by:
org.apache.harmony.xml.ExpatParser$ParseException: At line 1, column
0: not well-formed (invalid token)
W/ApplicationContext( 2348):at
org.apache.harmony.xml.ExpatPullParser
$ByteDocument.flush(ExpatPullParser.java:959)
W/ApplicationContext( 2348):at
org.apache.harmony.xml.ExpatPullParser
$Document.pump(ExpatPullParser.java:770)
W/ApplicationContext( 2348):at
org.apache.harmony.xml.ExpatPullParser
$Document.dequeue(ExpatPullParser.java:814)
W/ApplicationContext( 2348):at
org.apache.harmony.xml.ExpatPullParser.next(ExpatPullParser.java:303)
W/ApplicationContext( 2348):at
com.android.internal.util.XmlUtils.readValueXml(XmlUtils.java:674)
W/ApplicationContext( 2348):at
com.android.internal.util.XmlUtils.readMapXml(XmlUtils.java:469)
W/ApplicationContext( 2348):at
android.app.ApplicationContext.getSharedPreferences(ApplicationContext.java:
340)
W/ApplicationContext( 2348):at
android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:
146)
W/ApplicationContext( 2348):at
android.preference.PreferenceManager.setDefaultValues(PreferenceManager.java:
440)
W/ApplicationContext( 2348):at
android.preference.PreferenceManager.setDefaultValues(PreferenceManager.java:
425)
W/ApplicationContext( 2348):at
com.google.android.voicesearch.RecognitionActivity.onCreate(RecognitionActivity.java:
415)
W/ApplicationContext( 2348):at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
1047)
W/ApplicationContext( 2348):at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2459)
W/ApplicationContext( 2348):at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2512)
W/ApplicationContext( 2348):at android.app.ActivityThread.access
$2200(ActivityThread.java:119)
W/ApplicationContext( 2348):at android.app.ActivityThread
$H.handleMessage(ActivityThread.java:1863)
W/ApplicationContext( 2348):at
android.os.Handler.dispatchMessage(Handler.java:99)
W/ApplicationContext( 2348):at android.os.Looper.loop(Looper.java:
123)
W/ApplicationContext( 2348):at
android.app.ActivityThread.main(ActivityThread.java:4363)
W/ApplicationContext( 2348):at
java.lang.reflect.Method.invokeNative(Native Method)
W/ApplicationContext( 2348):at
java.lang.reflect.Method.invoke(Method.java:521)
W/ApplicationContext( 2348):at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:860)
W/ApplicationContext( 2348):at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
W/ApplicationContext( 2348):at
dalvik.system.NativeStart.main(Native Method)
W/ApplicationContext( 2348): getSharedPreferences
W/ApplicationContext( 2348): org.xmlpull.v1.XmlPullParserException:
Error parsing document. (position:line -1, column -1) caused by:
org.apache.harmony.xml.ExpatParser$ParseException: At line 1, column
0: not well-formed (invalid token)
W/ApplicationContext( 2348):at
org.apache.harmony.xml.ExpatPullParser
$ByteDocument.flush(ExpatPullParser.java:959)
W/ApplicationContext( 2348):at
org.apache.harmony.xml.ExpatPullParser
$Document.pump(ExpatPullParser.java:770)
W/ApplicationContext( 2348):at
org.apache.harmony.xml.ExpatPullParser
$Document.dequeue(ExpatPullParser.java:814)
W/ApplicationContext( 2348):at
org.apache.harmony.xml.ExpatPullParser.next(ExpatPullParser.java:303)
W/ApplicationContext( 2348):at
com.android.internal.util.XmlUtils.readValueXml(XmlUtils.java:674)
W/ApplicationContext( 2348):at
com.android.internal.util.XmlUtils.readMapXml(XmlUtils.java:469)
W/ApplicationContext( 2348):at
android.app.ApplicationContext.getSharedPreferences(ApplicationContext.java:
340)
W/ApplicationContext( 2348):at
android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:
146)
W/ApplicationContext( 2348):at
android.preference.PreferenceManager.getSharedPreferences(PreferenceManager.java:
335)
W/ApplicationContext( 2348):at
android.preference.Preference.getSharedPreferences(Preference.java:
867)
W/ApplicationContext( 2348):at
android.preference.Preference.dispatchSetInitialValue(Preference.java:
1168)

[android-developers] How to overwrite the default background of List Item in A ListView when the List Item has focus

2010-04-16 Thread waterblood
Hi All,

 I am trying to overwrite the default backgroud color of List item
which is holding the focus in the ListView. As you can see, in Android
Setting Menu, when you scroll through the ListView, the focused
ListItem has a red backgroud to highlight its focus. Does any way to
change the default behavior by highlighting it with other color or
just a bottom red line under this Item.

Any comments are welcome.

BRs
Guoyin Chen

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] System.getProperty() cannot get the prop setting in init.rc

2009-07-29 Thread waterblood

Hi All,

 I am trying to get property which I set in init.rc in Java app.
But it always return null.
Java code:
 String value= System.getProperty(ro.MY_PROPERTY);
 Log.i(TAG, ro.MY_PROPERTY get+value);

init.rc:
 setprop ro.MY_PROPERTY 1

   I have check getprop ro.MY_PROPERTY in console, it do return 1.
But not know why cannot get it in Java app.

  Thanks for your replay.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: System.getProperty() cannot get the prop setting in init.rc

2009-07-29 Thread waterblood

It works, thanks

On Jul 30, 11:20 am, Sahil Arora sahilz...@gmail.com wrote:
 use:
 SystemProperties.get(ro.MY_PROPERTY);

 On Wed, Jul 29, 2009 at 8:15 PM, waterblood guoyin.c...@gmail.com wrote:

  Hi All,

      I am trying to get property which I set in init.rc in Java app.
  But it always return null.
  Java code:
          String value= System.getProperty(ro.MY_PROPERTY);
          Log.i(TAG, ro.MY_PROPERTY get+value);

  init.rc:
          setprop ro.MY_PROPERTY 1

    I have check getprop ro.MY_PROPERTY in console, it do return 1.
  But not know why cannot get it in Java app.

   Thanks for your replay.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: postInvalidate not work in non-UI thread

2009-06-16 Thread waterblood

I do not paste all my code. The thread start is in OnClick on some
button as below:

public void onClick(View v) {
if(!thumbnailThread.isAlive()){
thumbnailThread.start();
}

Also has other code to change the jpg file for different image.

But now after check the link 
http://android-developers.blogspot.com/2009/05/painless-threading.html,
which i guess is written by you. I use AsyncTask instead. And it works
fine. Thanks for your great blog.

Best Regards
Guoyin Chen

On Jun 16, 11:34 pm, Romain Guy romain...@google.com wrote:
 You MUST NOT touch Views from a background thread. This means calls to
 findViewById() and setImageBitmap() should not be running on the backgorund
 thread in your case.




 Also, you do not start() the thread and you always set the *same* image on
 the ImageView. I doubt you will see much difference :)





 On Tue, Jun 16, 2009 at 1:38 AM, waterblood guoyin.c...@gmail.com wrote:

  Dear all,

    I cannot make postInvalidate() work in non-UI thread in sdk1.5.
  Below are my code, let me know if i am wrong in some place. It is
  supposed to update imageview every seconds. But it never be updated
  from the bitmap.

  public class ThumbnailActivity extends Activity  implements
  OnClickListener{
         private static final String TAG = FSL MM Thumbnail TEST;
         private Thread thumbnailThread;
         private boolean thumbnailStoped = false;

     /** Called when the activity is first created. */
    �...@override
     public void onCreate(Bundle savedInstanceState) {
         Log.i(TAG,ThumbnailActivity onCreate);
         super.onCreate(savedInstanceState);
         setContentView(R.layout.thumbnail);

         thumbnailStoped = false;
         thumbnailThread = new Thread(new Runnable() {
             public void run() {
                         Log.i(TAG,***thumbnailThread run***);
                         while(! thumbnailStoped ) {
                                  Bitmap bitmap;
                                  ImageView thumbimage;
                                  thumbimage = (ImageView)findViewById
  (R.id.thumbnail_image);
                                  bitmap = BitmapFactory.decodeFile(/sdcard/
  some.jpeg);
                                  if(bitmap == null)
                                          Log.i(TAG,Error!not get bitmap
  from .jpg);
                                  thumbimage.setImageBitmap(bitmap);
                                  thumbimage.postInvalidate();

                                 Log.i(TAG, ***thumbnailThread
  continue running***);
                                 SystemClock.sleep
  (1000);
                               }
                        });

     }

  }

  the xml of layout as below:

  ?xml version=1.0 encoding=utf-8?
  RelativeLayout xmlns:android=http://schemas.android.com/apk/res/
  android
     android:layout_width=fill_parent
     android:layout_height=fill_parent

     Button
         android:id=@+id/thumbnail_autopreview_button
         android:layout_width=wrap_content
         android:layout_height=wrap_content
         android:layout_alignParentLeft=true
         android:layout_marginTop=8dip
         android:layout_marginLeft=10dip
         android:text=Auto
     /

     Button
         android:id=@+id/thumbnail_nextimage_button
         android:layout_width=wrap_content
         android:layout_height=wrap_content
         android:layout_toRightOf=@id/thumbnail_autopreview_button
         android:layout_alignTop=@id/thumbnail_autopreview_button
         android:layout_marginLeft=10dip
         android:text=Next
     /

     Button
         android:id=@+id/thumbnail_stoppreview_button
         android:layout_width=wrap_content
         android:layout_height=wrap_content
         android:layout_toRightOf=@id/thumbnail_nextimage_button
         android:layout_alignTop=@id/thumbnail_nextimage_button
         android:layout_marginLeft=10dip
         android:text=Stop
     /

     TextView
         android:id=@+id/filename_label
         android:layout_width=fill_parent
         android:layout_height=wrap_content
         android:text=File: /sdcard/hello.mp4
         android:layout_below=@id/thumbnail_stoppreview_button
     /

     ImageView
         android:id=@+id/thumbnail_image
         android:layout_width=fill_parent
         android:layout_height=fill_parent
         android:layout_marginLeft=4dip
         android:layout_marginRight=2dip
         android:layout_marginTop=8dip
         android:layout_below=@id/filename_label
     /
  /RelativeLayout

  Best Regards
  Guoyin Chen

 --
 Romain Guy
 Android framework engineer
 romain...@android.com

 Note: please don't send private questions to me, as I don't have time to
 provide private support.  All such questions should be posted on public
 forums, where I and others can see and answer them
--~--~-~--~~~---~--~~
You received this message because you are subscribed

[android-developers] How Java App interact with console?

2009-06-10 Thread waterblood

Hello All,

  I just want to write a Java APP which need get instruction from a
console, and output information to console. I just found Log.v() can
output msg to console. But not known how to get input? If you know
that, please let me know how to do it. Thanks a lot.

Best Regards
Guoyin Chen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: the android's built in video player, supports which file format

2009-02-11 Thread waterblood

Does Google has any plan for other format support , as avi, rm?

On 1月15日, 下午1时27分, rktb yend...@pv.com wrote:
 Did you really mean pm4 or mp4?

 pm4 -- I don't know what this is
 avi -- To the best of my knowledge, we don't have support for this
 currently.

 Audio -- AAC (AAC-LC, AAC+, Enhanced AAC+), AMR (narrowband and
 wideband), mp3, wav, midi, ogg-vorbis.

 On Jan 15, 10:19 am, jalandar jagtap...@gmail.com wrote:



  thank u for reply
  will you clear little more, how to play pm4 or avi with android built
  in player, is there any converter.
  And for audio, is it only support mp3 format.- 隐藏被引用文字 -

 - 显示引用的文字 -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] dlopen error Cannot find library when trying to load a c library

2008-12-26 Thread waterblood

Hi All,

   I have countered a error Cannot find library when with dlopen in
android arm device.

   Blow is my android.mk
   android.mk for dynamic lib
---
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

LOCAL_SRC_FILES := \
c_src/mydll.c

LOCAL_CFLAGS += -DANDROID
LOCAL_C_INCLUDES += \
$(LOCAL_PATH)/hdr


LOCAL_PRELINK_MODULE := false
LOCAL_SHARED_LIBRARIES := libc

LOCAL_LDLIBS += -lpthread


LOCAL_MODULE:= libmydll

include $(BUILD_SHARED_LIBRARY)


   android.mk for test app
-
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

LOCAL_SRC_FILES := \
c_src/mymain.c


LOCAL_CFLAGS += -DANDROID
LOCAL_C_INCLUDES += \
$(LOCAL_PATH)/hdr

LOCAL_PRELINK_MODULE := false

LOCAL_SHARED_LIBRARIES := libc

LOCAL_MODULE:= mytest

include $(BUILD_EXECUTABLE)

and in mymainc.c
it just simply call dlopen() as below:

 pLibHandle = dlopen(libmydll.so, RTLD_NOW);

But get the error Cannot find library. I have checked the
libmydll.so already in system/lib.
Could anyone help me out? Thanks

Best Regards
Guoyin Chen



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---