[android-developers] Re: Is it possible to set minimum heap size for each application.?

2010-03-05 Thread James Wang
@mycall
#1.

The below code mean that every applications on VM start with 2Mb heap
size. correct.?
=>Yes
And If I want to change initial heap size for every application, I can
do it directly. correct.?
=>Yes
And according to comment, we can pass argument for heap size but in
fact there is no way to pass the parameter
because the VM is embedded in the Android runtime, not launched on the
command line.  correct.?
=>AFAIK, Yes.

#2.

I searched for CUSTOM_RUNTIME_HEAP_MAX in frameworks/base/core/jni/
AndroidRuntime.cpp but I can't find at all.  ( My platform code is
ecliar. )
Now I just found below code and then I think it means max heap size,
16MB. correct.?
=>Yes
16m -> mega byte or mega bit .??
=>B means byte

property_get("dalvik.vm.heapsize", heapsizeOptsBuf+4, "16m");

In my project, I also found below code in android make( *.mk ) file.

ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.heapsize=32m

Two codes cause same action.correct.? and 32m -> mega byte or mega
bit .?
=>Yes

#3. ( last )
Actually, I don't understand below sentence.
Is it possible to resize heap size in which case there is only one
tread running.?

The less-easy but better approach would be to resize the various heap
structures, which is a bit awkward but
probably doable since there's only thread running at that point where
the zygote forks.
=> I do not believe heap size has something to do with thread number.

-- 
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: Making sure activity is alive to receive Intent?

2010-03-05 Thread James Wang
Why you did not start your activity by intent with state data
directly?
IMHO, you can not find a way to make sure intent being received in
time.

-- 
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: Supress the native In Call Screen and replace with 3rd party?

2010-03-05 Thread James Wang
You can do nothing on this subject with sdk.
I think you should go for some help on android porting.

-- 
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: registerCallback leaks memory?! Help?

2010-03-05 Thread James Wang
Have you read this one 
http://developer.android.com/resources/articles/avoiding-memory-leaks.html?

-- 
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: About applying theme over application wide

2010-03-08 Thread James Wang
I think you should ask this one on android-porting.

-- 
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: "Scheduling restart of crashed service", but no call to onStart() follows

2010-03-08 Thread James Wang
No. It is depend on system.

-- 
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: registerCallback leaks memory?! Help?

2010-03-08 Thread James Wang
My suggestion is to use gclog.py to monitor vm heap and native heap.
Then analysis hprof with MAT to find the leak point.

-- 
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: How to display icon on the status bar?

2010-03-09 Thread James Wang
I do not think you can do it with SDK and you should ask this question
on android-porting

-- 
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: Unit Test Build Problems

2010-03-09 Thread James Wang
First, r u sure your Android project is runnable?
Second, r u sure you have add instrument permission in
AndroidManifest.xml?

-- 
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: registerCallback leaks memory?! Help?

2010-03-09 Thread James Wang
gclog.py (http://bigflake.com/gclog.py.txt) is recommended by
fadden( Google engineer) many times for android developers.
You can not find the same function in DDMS.

By gclog.py, you will know what exactly native heap size, vm heap size
and when memory leak happens.

Please read this thread
https://groups.google.com/group/android-developers/browse_thread/thread/52fd78125ae862a3/2a3eb8a6a993e71%3Fq%3Dandroid%2Bgclog%2302a3eb8a6a993e71&ei=3KxzS-OVAqP2sALJ2IGDAw&sa=t&ct=res&cd=1&source=groups&usg=AFQjCNF4o78oafegAzr-uc2FnyO4qp_1GQ

-- 
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: How do i check app close gracefully during shutdown scenario

2010-03-10 Thread James Wang
For what?

-- 
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: multiple user feature in android

2010-03-10 Thread James Wang
You mean supporting more than one user account like windows?

-- 
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: Customizing in Coming /Out going call screen

2010-03-10 Thread James Wang
AFAIK, you can not do it without making your own firmware. Because
Phone App has deep connection with framework.
You should ask this question on android-porting.

-- 
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: General question: Can't we have 2 projects(same) in 2 different locations and import them in eclipse?

2010-03-10 Thread James Wang
I believe you have to change the value of /projectDescription/name
of .project file to make your two projects have different names.

-- 
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: Query Loop!?

2010-03-10 Thread James Wang
You should take a look at SQLiteDatabase.execSQL.

-- 
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: registerCallback leaks memory?! Help?

2010-03-10 Thread James Wang
I am not much sure gclog.py is only available for linux.
Maybe you can try installing python on withows and playing with it.
However, linux is recommended.

-- 
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: Query Loop!?

2010-03-11 Thread James Wang
Sorry, how about SQLiteDatabase.rowQuery?

-- 
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: setting an icon in the application.

2010-03-11 Thread James Wang
Please download android source and study packages/apps/Launcher

-- 
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: Remove attention box while activating softkeyboard

2010-03-11 Thread James Wang
I this it is there on purpose. Because you have made one IME and it
can record user inputs.
However, I did not take look at the android source.

-- 
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: Call processing

2010-03-11 Thread James Wang
I do not believe Android  call BroadcastReceiver.onReceive
synchronously.

-- 
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: multiple user feature in android

2010-03-13 Thread James Wang
You should ask this question on android-porting because multiple user
is not supported by sdk.

-- 
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: How do i check app close gracefully during shutdown scenario

2010-03-13 Thread James Wang
I think Not unregisterReceiver is no harm to system because power
down.
I believe the foreground activity's onDestroy will be called. As for
others, there seems be no assurance.

-- 
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: including my .so files in sdk.

2010-04-01 Thread James Wang
add commands like below in build/target/product/sdk:
PRODUCT_COPY_FILES += \
   $(proprietary)/libaudioeq.so:system/lib/libaudioeq.so

-- 
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

To unsubscribe, reply using "remove me" as the subject.


[android-developers] How integrate my Settings Activity into Settings apk

2010-04-06 Thread James Wang
I know ime developer can create his own setting activity which will be
displayed in Settings apk.

I wonder whether there is a common way to interate any settings
activity into Settings apk.

Best Regards

James

-- 
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

To unsubscribe, reply using "remove me" as the subject.


[android-developers] Re: How integrate my Settings Activity into Settings apk

2010-04-06 Thread James Wang
3ks.

-- 
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

To unsubscribe, reply using "remove me" as the subject.


[android-developers] How to add activity rotation animation in 2.1 when orientation changed

2010-04-07 Thread James Wang
Hi,
I wonder whether developer can customize activity rotation animation
in 2.1 when orientation changed.
Can SDK do such thing?

Best Regards

James

-- 
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

To unsubscribe, reply using "remove me" as the subject.


[android-developers] How to monitor all notifications

2009-11-08 Thread James Wang
Hi,
Android supplies standard ways to monitor cell phone status. And is
there any way to monitor notifications from unknown softwares?

Best regards.

James

-- 
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] Advice Needed:Vertical Style Gallery Widget

2009-11-10 Thread James Wang
Hi,
Gallery in Android only supports horizontal scrolling. And we want one
with vertical scrolling support.

We got plans below but are not sure which one is right. Can anybody
give us some advice?
 * Linearlayout( we think it's bad!)
 * Make subclass of ListView
 * Make subclass of AbsSpinner like Gallery

Best Regards!

James

-- 
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] Advice Needed:Vertical Scrolling Style Gallery Widget

2009-11-11 Thread James Wang
Gallery in Android is only horizontal scrolling support. And we want
make one with vertical scrolling support.

We got plans below. Can anyone give us some advice about which one is
right?
1) Linearlayout ( We think it's bad)
2) ListView ( We think it's a good option and get a little worry about
performance--too many pictures!)
3) subclass of AbsSpinner like Gallery and do something like Gallery
source.

Which one is easy, time-saving and less performance or other problems.

Best Regards,

James

-- 
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] dmtracedump reports version error

2009-11-17 Thread James Wang
when I used dmtracedump to analyze traces.txt which generated by OOM,
I got below error:

$android-sdk-linux_x86-1.6_r1/tools/dmtracedump -h -g trace
traces.txt
ERROR: not at start of version (found '

- pi')

Can anyone help me?

BTW, who can share the experience about trace memory problem with heap
view of DDMS?
That will be appreciated!

James

-- 
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: dmtracedump reports version error

2009-11-17 Thread James Wang
fadden, Thank you for your reply.

I have been using ddms->VM Heap to monitor memory usage but I think it
is useless.
There is no much valuable information there. I doubt Google put such
useless tool in tab.
Maybe is my shallow!
I wonder  whether some people can tell me more about the usage of VM
Heap.

-- 
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] Does VM Heap in DDMS help?

2009-11-18 Thread James Wang
AFAIK, we have two ways to track memory usage with Android
1. VM Heap View in DDMS
2.dump hprof file and analyze it by Eclipse MAT

I wonder how VM Heap View is supposed to help developers?
1.About the first grid(ID,Heap Size,Allocated...), what pattern of
data smells bad?
2.I only saw one "Stats" item in the "Display"dropdown list. Is it
supposed to be more items there?
3.What data pattern smells bad in the second grid(Type,Count,Total
size...)
4.What graph pattern of allocation count per size smells bad?

Best Regards

James

-- 
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] Where is "dump HPROF file" button in DDMS

2009-11-18 Thread James Wang
Here,http://android.git.kernel.org/?p=platform/
dalvik.git;a=blob_plain;f=docs/heap-profiling.html;hb=HEAD is a
description about Dalvik Heap Profiling.

In "Android 1.6 ("Donut")" section, it says "Select your application
and click the "dump HPROF file" button. ".
I can find that button in DDMS.

I found there were three items in Device menu:
1.dump device state
2.dump app state(always disabed)
3.dump radio state

Is "dump app state" button the "dump HPROF file" button?

Best Regards.

James

-- 
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: Where is "dump HPROF file" button in DDMS

2009-11-19 Thread James Wang
fadden, Thank you!

I tried my ddms and did not see the buttons you mentioned.

In my ddms, there is only 4 buttons:
show heap updates
cause an immediate GC
show threads updates
halt the target VM

I checked out the version of DDMS:v0.8.1.

In fact, I got 1.5 and 1.6 SDK installed in my box. And whatever
version of ddms I ran(start from shell directly), and checked out the
version of DDMS, I got the same :v0.8.1. Is that supposed to be right?

-- 
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: Is there any way to display 8000 * 8000 jpeg file without OutOfMemoryException

2009-11-19 Thread James Wang
>
> > Step #2: Generate 10,000 tiles that are 80*80 instead (100 * 100 tiles).
>
> > Step #3: Render tiles on-screen by drawing them on the Canvas, and
> > support swipe gestures to move through the image by replacing tiles,
> > much like Google Maps works.
Hi Mark, AFAIK, the decoder of jpeg on android must support to read
random part of jpeg file if I want do step#2 as you said.
I checked out SDK reference and found out the default decoder of jpeg
seems not support it. Am I right?
Do I have to make another jpeg decoder?

BTW, I think google map does the same thing on server side, not on
mobile phone, does not it?

-- 
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: Where is "dump HPROF file" button in DDMS

2009-11-19 Thread James Wang
I have confirmed that these two buttons(dump HPROF file and start
method profiling) only appears since 2.0.
So what the document(http://android.git.kernel.org/?p=platform/ ) says
is wrong.

On Nov 20, 8:56 am, James Wang  wrote:
> fadden, Thank you!
>
> I tried my ddms and did not see the buttons you mentioned.
>
> In my ddms, there is only 4 buttons:
> show heap updates
> cause an immediate GC
> show threads updates
> halt the target VM
>
> I checked out the version of DDMS:v0.8.1.
>
> In fact, I got 1.5 and 1.6 SDK installed in my box. And whatever
> version of ddms I ran(start from shell directly), and checked out the
> version of DDMS, I got the same :v0.8.1. Is that supposed to be right?

-- 
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: How to build apk from multiple Eclipse projects?

2009-11-20 Thread James Wang
http://groups.google.com/group/android-developers/browse_thread/thread/911c0c5c5cd50abf/45f3cca8956182ae?lnk=gst&q=share+resource#45f3cca8956182ae

This one maybe help!

-- 
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 build apk for sharing resource like frame-res.apk

2009-11-20 Thread James Wang
Hi,
We are developing a middleware including some widgets for developer.
We want developer to use our widgets to build their apps.

We got stuck at sharing default resource for developers.
We noticed Android makes frame-res.apk to share system resrouces. And
anybody can shed light on how should we do to achieve the same thing?
How can we avoid resource IDs conflicts among system, middle ware and
app?

Best Regards

-- 
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 build apk for sharing resource like frame-res.apk

2009-11-22 Thread James Wang
We have been developing a middle-ware on Android and got stuck with
the problem about sharing resources.

We made some common widgets and want us app to use them and the
resource of those widgets should be shared in the way  how Android
framework do, packaging all resource into frame-res.apk and making it
public.

I found nothing about this topic and somebody shed the light on it?

Best Regards.

James

-- 
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: How to build apk for sharing resource like frame-res.apk

2009-11-24 Thread James Wang
Thanks, Dianne.

My colleague found this thread --what's the best way for OEM to
organize it's own resources? (http://groups.google.com/group/android-
framework/browse_thread/thread/e9974bd5a42af10a/1f7055086f5489a7?
q=product_package_overlays#1f7055086f5489a7)-- on android-framework.

I think your suggestion on this topic maybe the solution for us.

We will take a try.

-- 
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: Is there any way to display 8000 * 8000 jpeg file without OutOfMemoryException

2009-11-25 Thread James Wang
@PJ
Thanks for your interesting. We just want to display such picture, no
further edition on it.
In fact, we know sharp brought us with a phone-fax product-in-phone
(http://www.sharp.co.jp/in-phone/index.html) with 8000*8000 photo
displaying supports.
Although, in-phone is not an Android Box, but it is an embedded device
and they can do such thing. We just got curious about its implement.

@Robert, ko5tik, Streets Of Boston
Pre-processor is a good suggestion. But the side effect of it is too
many chunk files on SD Card or in flash. Maybe sharp has a smarter way
to achieve it and we just do not know.

@Mitch
Thanks for your message. I am reading it.

Thanks everyone. I did not suppose so many people got interesting in
this topic.

-- 
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: Android unnecessarily hard to unit test?

2009-11-25 Thread James Wang
Hi, Kennard.

I present my opinion on this topic(http://groups.google.com/group/
android-developers/browse_thread/thread/96cc0ca69c9c8c1b/
4fb8f7f009d19670), it maybe helpful.

-- 
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: Android unnecessarily hard to unit test?

2009-11-25 Thread James Wang

> I present my opinion on this topic(http://groups.google.com/group/
> android-developers/browse_thread/thread/96cc0ca69c9c8c1b/
> 4fb8f7f009d19670), it maybe helpful.
=>sorry, that topic is closed and I sent the reply to author directly.
Please check android-src/frameworks/base/tests/FrameworkTest/tests/src/
com/android/frameworktest/widget/ListViewTest.java
You will see google guys how to use MockContext.
I think we can do a little coding work to achieve the result as
easymock.

Good Luck.

James

-- 
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 enable different css in WebView

2009-11-27 Thread James Wang
Hi, we have a web page which include two different css:
portrait.css and landscape.css.

We want load this page only once and enable the right css according to
phone's orientation.

We have a plan to develop a chrome plugin by c++ to make it which got
us to have to change firmware.
I just wonder whether there is more elegant way to do it by java.

Anyone can shed light on it? That will be appreciated!

Best regards.

James

-- 
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: How to enable different css in WebView

2009-11-29 Thread James Wang
Nobody have any opinion?

-- 
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 does "@*android:type/name" work

2009-12-03 Thread James Wang
Dianne mentioned we can use "@*android:type/name" to reference
resource added to framework-res.apk at "what's the best way for OEM to
organize it's own resources?"(http://groups.google.com/group/android-
framework/browse_thread/thread/e9974bd5a42af10a/1f7055086f5489a7).

And I did see it is used in android source and looks like it is used
to refer to internal resource not public, am I right?

I wonder whether it is possible to refer to internal resource without
errors in Eclipse. I tried but adt reports error.

Best regards.

James

-- 
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: How does "@*android:type/name" work

2009-12-04 Thread James Wang
Thanks Romain.
I have to admit I have made wrong conclusion about build project
including @*android in Eclipse.
Just now, I tried it again with building success. Maybe I wrote it in
wrong way before.

However, we can not use com.android.internal.R to refer to resource
added by ourself in code since this R class is excluded from
android.jar.

Is there any way to get it included into android.jar?


-- 
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: How does "@*android:type/name" work

2009-12-05 Thread James Wang
Thanks Dianne.

I have noticed the problem you mentioned.

BTW, how do I move this topic to android-port?
delete and paste again at android-port?

-- 
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 change theme color of whole system

2009-09-23 Thread James Wang
Hi,
I have read through android reference, can't figure out the way to change
the theme color of whole system.
Is there any way to do it without hacking framework?

James

--~--~-~--~~~---~--~~
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: how to change theme color of whole system

2009-09-23 Thread James Wang

Thank you! I will put this question to porting

On Sep 24, 3:03 am, Dianne Hackborn  wrote:
> Sorry there is no way to do this without building a new system image.
>
> On Wed, Sep 23, 2009 at 12:37 AM, James Wang wrote:
>
> > Hi,
> > I have read through android reference, can't figure out the way to change
> > the theme color of whole system.
> > Is there any way to do it without hacking framework?
>
> > James
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  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 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: 关于eclipse和AD T的问题

2009-09-24 Thread James Wang
Hi,
I think you should ask question in English. This is a English Group.

我首先怀疑你的Eclipse的版本。你最好使用Galileo,或者比Galileo低一个版本的。

因为我在这两个版本上使用0.9.3都没有问题。

0.8的确实不能用在1.5r3上。

On Sep 24, 11:48 pm, ms99 ster  wrote:
> 各位:
>
> 今天解压了eclipse以后添加ADT0.9.1,结果却不能用,创建project的菜单里边不能创建android的project,只好又找到0.8.0的也放了进去才可以。
>还有,performance--> android众SDK
> Location选择android-sdk-windows-1.5_r3提示Could not find D:\Program
> Files\ec...dk-windows-1.5_r3\tools\aapt.exe!
>   是不是ADT和SDK升级时候都必须有老的版本才行?
>
> Thanks Muchly
--~--~-~--~~~---~--~~
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 control voice volume with VideoView

2009-10-09 Thread James Wang

I can use MediaPlayer.setVolume to control player's voice not phone
when I play with MediaPlayer. But I did not find similar method with
VideoView. I have to use AudioManager to change phone's voice volume
when playing VideoView.
Does anyone know if there is a way to change player's voice with
VideoView?

Best Regards!

James
--~--~-~--~~~---~--~~
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] Is there any way to display 8000 * 8000 jpeg file without OutOfMemoryException

2009-10-22 Thread James Wang

Hi,
We are going to develop an app supporting 8000 * 8000 jpeg file (over
hundreds of Megabytes).
Is there any way to achieve it in ADP1?

Best Regards.

James
--~--~-~--~~~---~--~~
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: Sharing code between activities

2009-10-24 Thread James Wang



On Oct 9, 7:04 am, jotobjects  wrote:
> Understood - addinig android.jar would hugely increase the size of
> your app (by about 3MB)!
I think you can elimit jar from your apk by ant.
I have done it before.

> I was just suggesting that you could place android.jar in your
> classpath for building your "coolfunctions.jar" as an alternative to
> creating an empty project.  You would build this coolfunctions.jar
> outside any of your android projects. The coolfunctions.jar is then
> placed in the lib directory of each android application where you want
> to use it (which might be a single app if you only want to share it
> among activities as the first poster in this thread did).
>
> On Oct 8, 3:36 pm, Agus  wrote:
>
>
>
> > Yes, but that will increase your APK size.
> > you don't need to include android.jar.
>
> > On Thu, Oct 8, 2009 at 10:49 AM, jotobjects  wrote:
>
> > > Does adding the platform android.jar to the build classpath for the
> > > jar also make all the Android APIs accessbile?
>
> > > On Oct 7, 7:58 am, "Mark Murphy"  wrote:
>
> > > > By using an Android project to hold your JAR development, you
> > > > automatically get access to the Android APIs to use from your common
> > > code.
--~--~-~--~~~---~--~~
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: Is there any way to display 8000 * 8000 jpeg file without OutOfMemoryException

2009-10-30 Thread James Wang

Thanks Mark! I will take a try.

On Oct 22, 8:23 pm, Mark Murphy  wrote:
> James Wang wrote:
> > Hi,
> > We are going to develop an app supporting 8000 * 8000 jpeg file (over
> > hundreds of Megabytes).
> > Is there any way to achieve it in ADP1?
>
> Step #1: Don't do that.
>
> Step #2: Generate 10,000 tiles that are 80*80 instead (100 * 100 tiles).
>
> Step #3: Render tiles on-screen by drawing them on the Canvas, and
> support swipe gestures to move through the image by replacing tiles,
> much like Google Maps works.
>
> You would need to do this on pretty much any platform (mobile, Web, even
> desktops if you don't want to mandate 64-bit and >16GB of RAM). Bear in
> mind that a JPEG of "over hundreds of Megabytes", when uncompressed for
> display, will require many GB of RAM.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Android Training in Germany, 18-22 January 2010:http://bignerdranch.com
--~--~-~--~~~---~--~~
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 return Typeface from Cursor

2009-10-30 Thread James Wang

I want to make a contentprovider for font file.
But I can not find any way to return a Typeface from Cursor. According
to SDK reference, MatrixCursor sounds like a solution, but it doesn't
support any object except String,Long,Double,Short,Flow.

Can anybody help me?

Best Regards
--~--~-~--~~~---~--~~
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: How to return Typeface from Cursor

2009-10-30 Thread James Wang
Thanks. So developers can return any user-defined-object by Cursor, am
I right?

Can I create a Typeface from Stream? I notice Typeface.createFromFile
got supported since 1.6.


On Oct 30, 8:15 pm, Mark Murphy  wrote:
> James Wang wrote:
> > I want to make a contentprovider for font file.
> > But I can not find any way to return a Typeface from Cursor. According
> > to SDK reference, MatrixCursor sounds like a solution, but it doesn't
> > support any object except String,Long,Double,Short,Flow.
>
> You cannot return a Typeface from a Cursor.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Android Development Wiki:http://wiki.andmob.org

-- 
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] Why setting TextView.Ellipsize as Marquee cause its sibling view in linearlayout redraw

2010-02-03 Thread James Wang
Hi
We are using TextView's Ellipsize function to scrolling text in it and
there many other controls in our window.
We noticed CPU would go up to 50% if text started scrolling. After
digging deeper, we found all controls in our layout kept drawing when
texts scrolling. We wonder why? And how to avoid all controls
redrawing?

Best Regards

James

-- 
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: Why setting TextView.Ellipsize as Marquee cause its sibling view in linearlayout redraw

2010-02-03 Thread James Wang
Below is our test project:

public class AndroidTest extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

LinearLayout ll = new LinearLayout(this);
final TextView tv = new TextView(this);
 
tv.setText("XXXkl;dfjasjkldfjksdhfjksdfhasdasdasdasdasdasdasdasdksjdf");
tv.setFocusable(true);
tv.setClickable(true);
tv.setSingleLine();
tv.setEllipsize(TruncateAt.MARQUEE);
tv.setTextColor(Color.WHITE);
tv.setOnClickListener(new OnClickListener() {

public void onClick(View v) {
tv.setSelected(true);
}

});
ll.addView(tv, new
LinearLayout.LayoutParams(100,LayoutParams.WRAP_CONTENT));
ll.addView(new TempView(this));
setContentView(ll);
}



private class TempView extends ImageView {

public TempView(Context context) {
super(context);
setBackgroundResource(R.drawable.icon);
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
Log.i("ImageView",
"ImageViewImageViewImageViewImageViewImageView");
}

}

}

It's very strait and when clicking textview to start scrolling text,
TempView's onDrawing is keeping to be called!
However, we used Dev Tool ->show screen update to check redraw area
and saw only textview flashing!

Who can tell me why!

-- 
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: how to use com.android.internal.telephony

2010-02-04 Thread James Wang
I recommend you develop your app in Eclipse and build it under android
source.

-- 
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: try to see hprof dump from ddms

2010-02-04 Thread James Wang

> but i find out
> if my app(a simple HelloWorld) is built by mydroid (i.e. using
> Android.mk)
> it always complains permission denied
=>what's mean "built by mydroid"? you mean build under android source?
can you paste some logcat?

-- 
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: Why setting TextView.Ellipsize as Marquee cause its sibling view in linearlayout redraw

2010-02-08 Thread James Wang
Hi, Dianne

Can you shed some light on this topic?

Any words will be appreciated.

James

-- 
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 deal complex sql in ContentProvider

2010-02-08 Thread James Wang
Hi,
We want to add below update sql into our contentprovider:
update tableName
   set column1 = column1 + 1
   where column1 >= 50

We found current update of contentprovider does not support it, which
would not recognize the "column1" of "column1 + 1" as column name.

So we have to add execSQL method into ContentProvider and I think it
is dirt.

So I wonder if anyone know how to do such thing with ContentProvider
or any more elegant way to achieve it.

Best Regards

James

-- 
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: how to deal complex sql in ContentProvider

2010-02-09 Thread James Wang
Thanks Murphy, Jens!
We are using one contentprovider two share all data amount many apps.
In fact, we are developing contentprovider as the bridge between apps
and database, sound like JDBC. Switching to a remote service sounds
like a option but we don't think it is good design that exposing one
service and one contentprovider to other apps which need process with
database.

I have to agree with Jens. In real world, content provider seems not
enough for every one.

Now we think about another option - to refactor our db design. Hope we
can get something at the end of this road.

James

-- 
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: Why setting TextView.Ellipsize as Marquee cause its sibling view in linearlayout redraw

2010-02-09 Thread James Wang
Thanks Romain!
We are developing apps on Donut.
Next time, I will search android's bugs before asking here.

-- 
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: Why setting TextView.Ellipsize as Marquee cause its sibling view in linearlayout redraw

2010-02-09 Thread James Wang
Hi, Romain.

I searched http://code.google.com/p/android and found nothing about
this bug. So I guess this bug is not reported by external people.

BTW, Dev Tool ->show screen update should be not reliable if what we
found is a bug. And Dev Tool->show screen has been fixed, too?
If not, I guess I need fire a bug for it.

James

-- 
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] SQLiteDiskIOException happens when querying 4000 rows data with order by japanese kanji

2010-02-09 Thread James Wang
This topic is moved from plateform.

Below is stack trace:

E/DatabaseUtils(  260): Writing exception to parcel
E/DatabaseUtils(  260): android.database.sqlite.SQLiteDiskIOException:
disk I/O error
E/DatabaseUtils(  260): at
android.database.sqlite.SQLiteQuery.native_fill_window(Native Method)
E/DatabaseUtils(  260): at
android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java:75)
E/DatabaseUtils(  260): at
android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:288)
E/DatabaseUtils(  260): at
android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:269)
E/DatabaseUtils(  260): at
android.database.CursorToBulkCursorAdaptor.count(CursorToBulkCursorAdaptor.java:
132)
E/DatabaseUtils(  260): at
android.database.BulkCursorNative.onTransact(BulkCursorNative.java:79)
E/DatabaseUtils(  260): at android.os.Binder.execTransact(Binder.java:
287)
E/DatabaseUtils(  260): at dalvik.system.NativeStart.run(Native
Method)
D/AndroidRuntime(  253): Shutting down VM
W/dalvikvm(  253): threadid=3: thread exiting with uncaught exception
(group=0x4001aa38)
E/AndroidRuntime(  253): Uncaught handler: thread main exiting due to
uncaught exception
E/AndroidRuntime(  253):
android.database.sqlite.SQLiteDiskIOException: disk I/O error
E/AndroidRuntime(  253):at
android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:
141)
E/AndroidRuntime(  253):at
android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:
111)
E/AndroidRuntime(  253):at
android.database.BulkCursorProxy.count(BulkCursorNative.java:255)
E/AndroidRuntime(  253):at
android.database.BulkCursorToCursorAdaptor.set(BulkCursorToCursorAdaptor.java:
44)
E/AndroidRuntime(  253):at
android.content.ContentProviderProxy.query(ContentProviderNative.java:
304)
E/AndroidRuntime(  253):at
android.content.ContentResolver.query(ContentResolver.java:152)
E/AndroidRuntime(  253):at com.mycompany.test.MainActivity
$1.onClick(MainActivity.java:39)
E/AndroidRuntime(  253):at android.view.View.performClick(View.java:
2344)
E/AndroidRuntime(  253):at android.view.View.onTouchEvent(View.java:
4133)
E/AndroidRuntime(  253):at
android.widget.TextView.onTouchEvent(TextView.java:6504)
E/AndroidRuntime(  253):at
android.view.View.dispatchTouchEvent(View.java:3672)
E/AndroidRuntime(  253):at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)
E/AndroidRuntime(  253):at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)
E/AndroidRuntime(  253):at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)
E/AndroidRuntime(  253):at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)
E/AndroidRuntime(  253):at
com.android.internal.policy.impl.PhoneWindow
$DecorView.superDispatchTouchEvent(PhoneWindow.java:1712)
E/AndroidRuntime(  253):at
com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:
1202)
E/AndroidRuntime(  253):at
android.app.Activity.dispatchTouchEvent(Activity.java:2018)
E/AndroidRuntime(  253):at
com.android.internal.policy.impl.PhoneWindow
$DecorView.dispatchTouchEvent(PhoneWindow.java:1696)
E/AndroidRuntime(  253):at
android.view.ViewRoot.handleMessage(ViewRoot.java:1658)
E/AndroidRuntime(  253):at
android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(  253):at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime(  253):at
android.app.ActivityThread.main(ActivityThread.java:4203)
E/AndroidRuntime(  253):at
java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(  253):at
java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime(  253):at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:791)
E/AndroidRuntime(  253):at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
E/AndroidRuntime(  253):at dalvik.system.NativeStart.main(Native
Method)

we are using such sql "select column1,column2 from table order by
kanji asc" to select 4000 rows data from our table and got above
error.

we did reproduce this error by executing above sql by command "adb
shell sqlite3".

If we select only one column, no error happens.

I guess android imposes size limit on sqlite3's cache or something
else.

I have two question:
1. Is this a android's bug?
2. How can we avoid it?

-- 
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 hangs while giving Android build

2010-02-10 Thread James Wang
I did have the same experience before. I think 1G is not enough and
your disk should be good enough.

-- 
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: Why setting TextView.Ellipsize as Marquee cause its sibling view in linearlayout redraw

2010-02-10 Thread James Wang
Thanks Romain!

-- 
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: SQLiteDiskIOException happens when querying 4000 rows data with order by japanese kanji

2010-02-11 Thread James Wang
After digging further, I got it.

This disk I/O error is caused because the default size(4m) of
sqlite_stmt_journals partition is too small for our query.
If I changed init.rc to make big size partition(8m), 4000 rows data
can be selected without any error.

So I wonder what is the best solution for such problem. we can not
modify user's device's firmware and impose any limition on our app,
neither.
Here is what I have thought:
1) Not get all 4000 rows data out of sqllite at one time. Do it little
by little.

Is there any other resolution?

-- 
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: SQLiteDiskIOException happens when querying 4000 rows data with order by japanese kanji

2010-02-21 Thread James Wang
I found another resolution for my problem.

If I create an index for orderbyed column, my problem will get gone.

After reading some docs about sqlite, it seems that using index to
order by will remove the necessary of creating journal file.

So I think creating index is a better solution.

-- 
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] about setting WindowManager.LayoutParams.screenBrightness

2010-02-21 Thread James Wang
We noticed some devices(not android's) support such feature:black out
screen and turn bright when someone touches it.
Our custom want us to simulate such function with android.
We trid to set WindowManager.LayoutParams.screenBrightness to make
screen dark enough but still knowing touch motion but failed.

 lp.screenBrightness = 0.039f;  //dark enough and looks dead

 lp.screenBrightness = 0.04f;  //not dark enough but knowing touch
motion

It turns out that there is no way to make our customer happy.

I think Android has nothing to do with our problem and it should be
the problem of LED screen maker. If they can make such LED, Android
will support it also. Am I right?

Best Regards.

James

-- 
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: Setting Application-wide Themes

2010-02-21 Thread James Wang
According to http://developer.android.com/intl/fr/guide/topics/ui/themes.html
you should do it after super.onCreate.

 protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
...
setTheme(android.R.style.Theme_Light);
setContentView(R.layout.linear_layout_3);
}

-- 
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: Confused about activity lifecycle usage in the notepad example

2010-02-21 Thread James Wang
I think your design can not deal with phone rotation.
When phone got rotated, the input can not be reserved.

-- 
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] Timer cause memory leak

2010-02-26 Thread James Wang
I have three activities:MyFirstActivity(click)->MyActivity(timer)-
>MyNextActivity.
And I noticed Timer cause MyActivity memory leak when digging through
hprof in Eclipse.
Below is my codes:
public class MyActivity extends Activity {

private Timer timer = new Timer();

protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TimerTask task = new TimerTask() {
public void run() {
Intent intent = new Intent();

intent.setClassName(getPackageName(),
MyNextActivity.class.getName());
startActivity(intent);
finish();
}
};
timer.schedule(task, INTERVAL_TIME);
}

public void onDestroy() {
super.onDestroy();
//memory leaking happens if there is not below.
//timer = null;
}
}

If I did set timer to null in onDestroy, MyActivity will always exist
in heap. I did the flow four times and found four timers and four
MyActivity instances in heap.

Who can tell me why?

-- 
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: Layout problems: AbsoluteLayout deprecated, how to do it now?

2010-02-26 Thread James Wang
I think you can do anything with Framelayout like absolutelayout.

-- 
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: anyDensity - bitmap not resized

2010-02-26 Thread James Wang
Pre-scale resource should be depend on density of screen, not
resolution.

-- 
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: Database management

2010-02-26 Thread James Wang
My suggestion is create your own content provider for this and open db
in onCreate and hold it as static.

-- 
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: anyDensity - bitmap not resized

2010-02-28 Thread James Wang
My suggestion is to do as what "Supporting multiple screens ->
Resource directory qualifiers for screen size and density" of dev
guards says.
If you sure to support WQVGA400, you should make specific layout and
drawable resource for it.

-- 
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: How to install fresh Android OS in my HTC MAGIC?

2010-03-03 Thread James Wang
you can find all kinds android os rom and install reference on
forum.xda-developers.com.
Or you can read this http://developer.htc.com/google-io-device.html.
Be careful about your magic, it is very easy to be bricked if you do
not know much about burn rom!

-- 
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: Is it possible to set minimum heap size for each application.?

2010-03-03 Thread James Wang
What r u going to do?
To limit your app's heap size?
if so, I think you can not get it done without building android
source.
You can find what you want on android-porting.

-- 
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: Update Activity from BroadcastReceiver

2010-03-03 Thread James Wang
What kind of BroadcastReceiver?

I think you have to do it by creating, registering and unregister your
broadcastreceiver in your activity. And define your activity as member
of broadcastreceiver.

-- 
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: how to do hide and activity when there is an activity on top redirecting me to home screen

2010-03-03 Thread James Wang

startActivity(HOME) when clicking hide button.

-- 
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: Is it possible to set minimum heap size for each application.?

2010-03-04 Thread James Wang
Please read
https://groups.google.com/group/android-porting/browse_thread/thread/a22a9bf2d67013ac/6ffc46ab049a45a4?lnk=gst&q=heap+limit#6ffc46ab049a45a4

-- 
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: My posts are not displayed

2010-03-04 Thread James Wang
how did you do?

-- 
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: colud i join Android Developers group?

2010-03-04 Thread James Wang
you have been here!

-- 
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: How to implement answer function programmetically?

2010-03-04 Thread James Wang
I do not think you can make it with SDK, even Hint2.

-- 
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: How to set Z order to the child View

2010-03-04 Thread James Wang
use ViewGroup.bringChildToFront and invalide please.

-- 
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] core tests coverage report 0%

2009-12-12 Thread James Wang
We ran core tests by the command "/development/testrunner/runtest.py  -
v --coverage core" and got coverage report successfully. But the
reports says all are 0%.
We ran apidemos and got coverage report which looks good.

Below is the console output for core tests:
-
No private recovery resources for TARGET_DEVICE dream-open
make: ディレクトリ `/usr/forCurl/android1.6r1' に入ります
make: `files' に対して行うべき事はありません.
make: ディレクトリ `/usr/forCurl/android1.6r1' から出ます
Syncing to device...
about to run adb  sync
syncing /system...
0 files pushed. 377 files skipped.
syncing /data...
0 files pushed. 8 files skipped.

Waiting for device package manager...
about to run adb  wait-for-device
about to run adb  shell pm path android
about to run adb  shell cat init.rc | grep BOOTCLASSPATH | grep
emma.jar
Waiting for instrumentation to be present
about to run adb  shell pm list instrumentation | grep android.core/
android.test.InstrumentationTestRunner
Running in coverage mode, suppressing test output
am instrument -e class 'android.core.CoreTests' -e coverage 'true' -r -
w android.core/android.test.InstrumentationTestRunner
about to run adb  shell am instrument -e class
'android.core.CoreTests' -e coverage 'true' -r -w android.core/
android.test.InstrumentationTestRunner
Failure in android.webkit.CookieTest:testPath:
junit.framework.AssertionFailedError
at android.webkit.CookieTest.testPath(CookieTest.java:191)
at java.lang.reflect.Method.invokeNative(Native Method)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:164)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:151)
at android.test.InstrumentationTestRunner.onStart
(InstrumentationTestRunner.java:425)
at android.app.Instrumentation$InstrumentationThread.run
(Instrumentation.java:1520)


Tests run: 312, Failures: 1, Errors: 0
about to run adb  shell ls /data/data/android.core/files/coverage.ec
about to run adb  pull /data/data/android.core/files/coverage.ec /usr/
forCurl/android1.6r1/out/emma/framework/core/core.ec
EMMA: processing input files ...
EMMA: 2 file(s) read and merged in 503 ms
EMMA: writing [html] report to [/usr/forCurl/android1.6r1/out/emma/
framework/core/core.html] ...
Coverage report generated at /usr/forCurl/android1.6r1/out/emma/
framework/core/core.html


So I wonder why core tests's coverage report says 0% and how can I
make the report make sense.

Thanks in advance.

James

-- 
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: core tests coverage report 0%

2009-12-13 Thread James Wang
Hello, nobody had run core tests? Anybody can help me? Please!

-- 
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 know the caller of ContentProvider

2009-12-17 Thread James Wang
We are developing a ContentProvider which is supposed to serve for
specified packages. So we want to get the caller package name. Is
there any way to achieve that?

Thanks in advanced.

James

-- 
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: How to know the caller of ContentProvider

2009-12-17 Thread James Wang
We got a solution here:
int pid = Binder.getCallingPid();

And pass the pid to getProcessNameFromPid below:

private String getProcessNameFromPid(int givenPid) {
ActivityManager am = (ActivityManager)
getContext().getSystemService(Activity.ACTIVITY_SERVICE);

List lstAppInfo =
am.getRunningAppProcesses();

for(ActivityManager.RunningAppProcessInfo ai : lstAppInfo) {
if (ai.pid == givenPid) {

return ai.processName;
}
}
return null;
}

I wonder whether there is any other way to do it.

-- 
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] Why RIL.java implements CommandInterface twice

2009-12-17 Thread James Wang
Maybe this group is not the right one to ask this question.

I am studying RIL and noticed RIL.java inplements CommandInterface
twice( extend BaseCommand implement CommandInterface). What is it
for?
Any design pattern here?

Best Regards
James

-- 
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: Why RIL.java implements CommandInterface twice

2009-12-18 Thread James Wang
Maybe I should post it to porting group.

-- 
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 change window z-order on-the-fly

2009-12-23 Thread James Wang
How can we change the created z-order on-the-fly?
setting WindowManager.LayoutParams.type works when creating window but
not works after creating.

James

-- 
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] android:stateNotNeeded not work

2009-12-28 Thread James Wang
Hi,
SDK reference says "If this attribute is set to "true",
onSaveInstanceState() may not be called and onCreate() will be passed
null instead of the Bundle — just as it was when the activity started
for the first time."
I verified it is not true. No matter what value I set stateNotNeeded,
onSaveInstanceState() always gets called!

Is this a bug?

James

-- 
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: How to Load Asset PDF in Browser or Webview ?

2009-12-28 Thread James Wang
install it and you also need a file browser app.

Open pdf in file browser app and apdfviewer will be brought out.

-- 
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: android:stateNotNeeded not work

2009-12-28 Thread James Wang
we wonder when this **may** will happen?

-- 
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 exclude R class from emma coverage report

2010-01-08 Thread James Wang
Hi

We do junit test with emma coverage report successfully but with only
one annoying problem.
R file was included in coverage report and make the report statics
less than our expected.
I find out that emmrun of emma seems be the solution but do not know
how to be used with Android.
So can anybody help me?

Best Regards

James
-- 
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 change application not STOPPED in 3.1

2011-06-29 Thread James Wang
Android 3.1 introduced two new Intent flag
FLAG_EXCLUDE_STOPPED_PACKAGES&FLAG_INCLUDE_STOPPED_PACKAGES.

If user stopped my app by settings app and my app was expected to be
started by BOOT_COMPLETED Intent. BOOM!
My app will not start untill user click my app's shortcut.

So if my app include only services and there is no shortcut for it in
launcher, user have no way to let it back, right?
How can I to resolve such problem?




-- 
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


  1   2   >