[android-developers] How to remove left & right blank area of Gallery widget?

2009-07-15 Thread Oceanedge

I want to use   android.widget.Gallery as an horizontal image scroll
view. But the default behavior of Gallery widget display blank area
in  left & right side even if the width sum of items in it exceed its
width. How can I disable this behavior, so that there is no extra
blank area in Gallery?
Many thanks!
--~--~-~--~~~---~--~~
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 let soft keyboard cover on the activity view without pan & resize?

2009-07-03 Thread Oceanedge

Hi,

   I have an activity that shows an AlertDialog. The AlertDialog
contains a EditText. So when the soft keyboard is shown for the
EditText in the dialog. The background activity content view don't
have to be resized or paned.  I wonder how to implement this behavior?
Because I found, the first time the soft keyboard is shown for the
EditText in the dialog, the keyboard cover on the background activity
content without pan & resize it. But after I close the dialog & press
up & down D-pad key, then show the dialog again, tap on the EditText.
The soft keyboard will shown while pan the background activity content
view. I don't know how to solve this inconsistency. I've tried to add
android:windowSoftInputMode=adjustResize but it doesn't work.

Thanks!
--~--~-~--~~~---~--~~
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] IllegalArgumentException occur: parameter must be a descendant of this view in ViewGroup.java:2454

2009-07-02 Thread Oceanedge

Hi,
I am using Android SDK 1.5. I am developing an activity with multiple
content views. It will call setContentView() with different viewgroup
instance for different functionality. It contains a text input dialog
popped up by an option menu item. I didn't specify anything for IME in
mainfest.xml & EditText attributes. I found at first, the soft
keyboard for the text input dialog will overlap on the activity
content view. But after several content view switch (by calling
setContentView() with different ViewGroup instance), the soft keyboard
will resize the activity content view.
Why this inconsistent behavior happens?

And some times, the activity is also crashed when soft keyborad is
showing for the test input dialog. Here is the log:
07-01 07:30:18.606: WARN/InputManagerService(726): Window already
focused, ignoring focus gain of:
com.android.internal.view.iinputmethodclient$stub$pr...@43807360
07-01 07:30:19.575: WARN/KeyCharacterMap(941): No keyboard for id 0
07-01 07:30:19.585: WARN/KeyCharacterMap(941): Using default keymap: /
system/usr/keychars/qwerty.kcm.bin
07-01 07:30:21.896: WARN/InputManagerService(726): Window already
focused, ignoring focus gain of:
com.android.internal.view.iinputmethodclient$stub$pr...@4380ead8
07-01 07:30:28.106: DEBUG/AndroidRuntime(941): Shutting down VM
07-01 07:30:28.115: WARN/dalvikvm(941): threadid=3: thread exiting
with uncaught exception (group=0x4000fe70)
07-01 07:30:28.181: ERROR/AndroidRuntime(941): Uncaught handler:
thread main exiting due to uncaught exception
07-01 07:30:28.256: ERROR/AndroidRuntime(941):
java.lang.IllegalArgumentException: parameter must be a descendant of
this view
07-01 07:30:28.256: ERROR/AndroidRuntime(941): at
android.view.ViewGroup.offsetRectBetweenParentAndChild(ViewGroup.java:
2454)
07-01 07:30:28.256: ERROR/AndroidRuntime(941): at
android.view.ViewGroup.offsetDescendantRectToMyCoords(ViewGroup.java:
2391)
07-01 07:30:28.256: ERROR/AndroidRuntime(941): at
android.view.ViewRoot.scrollToRectOrFocus(ViewRoot.java:1301)
07-01 07:30:28.256: ERROR/AndroidRuntime(941): at
android.view.ViewRoot.draw(ViewRoot.java:1107)
07-01 07:30:28.256: ERROR/AndroidRuntime(941): at
android.view.ViewRoot.performTraversals(ViewRoot.java:1030)
07-01 07:30:28.256: ERROR/AndroidRuntime(941): at
android.view.ViewRoot.handleMessage(ViewRoot.java:1482)
07-01 07:30:28.256: ERROR/AndroidRuntime(941): at
android.os.Handler.dispatchMessage(Handler.java:99)
07-01 07:30:28.256: ERROR/AndroidRuntime(941): at
android.os.Looper.loop(Looper.java:123)
07-01 07:30:28.256: ERROR/AndroidRuntime(941): at
android.app.ActivityThread.main(ActivityThread.java:3948)
07-01 07:30:28.256: ERROR/AndroidRuntime(941): at
java.lang.reflect.Method.invokeNative(Native Method)
07-01 07:30:28.256: ERROR/AndroidRuntime(941): at
java.lang.reflect.Method.invoke(Method.java:521)
07-01 07:30:28.256: ERROR/AndroidRuntime(941): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
(ZygoteInit.java:782)
07-01 07:30:28.256: ERROR/AndroidRuntime(941): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
07-01 07:30:28.256: ERROR/AndroidRuntime(941): at
dalvik.system.NativeStart.main(Native Method)
07-01 07:30:28.267: INFO/Process(726): Sending signal. PID: 941 SIG: 3
07-01 07:30:28.267: INFO/dalvikvm(941): threadid=7: reacting to signal
3
07-01 07:30:28.386: INFO/dalvikvm(941): Wrote stack trace to '/data/
anr/traces.txt'
07-01 07:30:28.485: DEBUG/dalvikvm(726): GC freed 9705 objects /
540208 bytes in 178ms
07-01 07:35:28.289: INFO/Process(941): Sending signal. PID: 941 SIG: 9
07-01 07:35:28.325: INFO/ActivityManager(726): Process
com.android.mytest (pid 941) has died.

Please help. Thanks!
--~--~-~--~~~---~--~~
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] What is the valid file name in Android & how to check it?

2009-06-01 Thread Oceanedge

Hi,

  I am developing an application that allow users to input a file name
in Sava As dialog. I wonder what kind of characters can I allow users
to input.
Does Android support multi-launguage file name? What is the max length
of file name string?
How should I check if user's input is valid to be a file name?
Thanks!
--~--~-~--~~~---~--~~
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 let Android create my activity within the process which the launcher activity lies in?

2009-05-27 Thread Oceanedge

Thank your very much!

 BlablaManager actually handles the image editing session information.
One task shall have only one session.

 I understand your point. Now I quit using singleton & stead using a
static field of the main activity to reference the instance of
BlablaManager, and then any other activities within my application
share the instance with this static field.

Currently it works fine. But I don't know whether it's OK as design in
Android.

Please give your comments.
Thanks!

On May 27, 10:29 am, Dianne Hackborn  wrote:
> On Tue, May 26, 2009 at 7:11 PM, Oceanedge  wrote:
> > Yeah, but I think my singleton class can works well with the OS handle
> > Task as a single process. But in Android, Task can be cross linux
> > process.  So my two activity instances are created by two tasks.
>
> Because you have set up your app to behave this way.
>
> > But
> > they are all created within one Dalvik VM linux process, and Dalvik VM
> > didn't distinguishes the static field(mInstance) which reference the
> > singleton class instance for two activity instances belongs to two
> > different tasks. Then I encounter the problem.
>
> Yes, all instances of a particular activity run in a single process.  This
> for the most part a feature, and there are actually a lot of things that use
> singletons to take advantage of this.
>
> > So I think the problem occurs because Android define a Task can be
> > cross process, but Dalvik VM still handles static field based on
> > process. So do you think this is a little confused?
>
> It is working exactly as intended, which is fine.
>
> > Because if we
> > think Activity as a module in a Task, for other OS, normally a Task is
> > a single process, and that process can have modules(dynamic link
> > library). Static variable can also be defined in dynamic link library,
> > but that static variable will be map in the process which load the
> > library. That static variable won't be shared to different processes
> > (Tasks).
>
> I would suggest not thinking of Android tasks in any way like what you think
> tasks are on other platforms.  The -only- thing a task is on Android is a
> way to organize related activities.
>
>
>
> > My singleton class is implemented like this:
> > BlablaManager
> > {
>
> >    public static BlablaManager getInstance()
> >    {
> >        if (mInstance == null)
> >        {
> >            mInstance = new BlablaManager ();
> >        }
> >        return mInstance;
> >    }
> > private BlablaManager()
> >    {
>
> >    }
>
> >    private static BlablaManager mInstance = null;
> > }
>
> That's fine, and you get to share one instance of this with all things
> running in a process.
>
> > Matt suggested to use the Application context to synchronize access to
> > the singleton. But I still not very clear about how to implement.
> > Should I add a context parameter to getInstance() and maintain a list
> > of application context reference, so I can return different instance
> > of BlablaManager for different application context?
>
> Honestly, I think at this point you should stop doing whatever you are doing
> which is causing your activity to be used in multiple different tasks,
> because this sounds like it isn't the behavior you want.  But you haven't
> really clearly described how you are currently setting up your activity
> flow, nor exactly how you want it to work, so it is hard to provide more
> help here.
>
> And if you really do want your activity to be in separate tasks, then you do
> indeed need multiple instances of it, and it sounds like whatever this
> BlablaManager thing is should just not be a singleton.
>
> --
> 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: How to let Android create my activity within the process which the launcher activity lies in?

2009-05-26 Thread Oceanedge

Yeah, but I think my singleton class can works well with the OS handle
Task as a single process. But in Android, Task can be cross linux
process. So my two activity instances are created by two tasks. But
they are all created within one Dalvik VM linux process, and Dalvik VM
didn't distinguishes the static field(mInstance) which reference the
singleton class instance for two activity instances belongs to two
different tasks. Then I encounter the problem.

So I think the problem occurs because Android define a Task can be
cross process, but Dalvik VM still handles static field based on
process. So do you think this is a little confused? Because if we
think Activity as a module in a Task, for other OS, normally a Task is
a single process, and that process can have modules(dynamic link
library). Static variable can also be defined in dynamic link library,
but that static variable will be map in the process which load the
library. That static variable won't be shared to different processes
(Tasks).

My singleton class is implemented like this:
BlablaManager
{

public static BlablaManager getInstance()
{
if (mInstance == null)
{
mInstance = new BlablaManager ();
}
return mInstance;
}
private BlablaManager()
{

}

private static BlablaManager mInstance = null;
}

Matt suggested to use the Application context to synchronize access to
the singleton. But I still not very clear about how to implement.
Should I add a context parameter to getInstance() and maintain a list
of application context reference, so I can return different instance
of BlablaManager for different application context?

Please help, Thanks!


On May 26, 4:04 pm, Romain Guy  wrote:
> The singleton is a perfectly valid pattern withAndroid, but if you
> need to use two instances of your "singleton," then the problem is
> that you are using a singleton in the first place.
>
>
>
> On Tue, May 26, 2009 at 12:58 AM, Oceanedge  wrote:
>
> > Thanks, but I think singleton is a general pattern used generally. Why
> > should we stop using it inAndroid? :(
>
> > On May 26, 12:12 pm, Romain Guy  wrote:
> >> Hi,
>
> >> You cannot do this, if only for security reasons. Running arbitrary
> >> code in the Home process would be very bad :)
>
> >> Instead of creating two processes (which is really heavy and requires
> >> a lot more memory), why don't you stop using a singleton?
>
> >> On Mon, May 25, 2009 at 9:06 PM, Oceanedge  wrote:
>
> >> > I'm developing a photo editor application. It will launched by
> >> >android.intent.action.EDIT intent. I made two application to emit that
> >> > intent. I found that two instance ofmyphoto editoractivityis
> >> > created within the same process which is named asmyactivity. But
> >> > there is a singleton class used inmy photo editoractivityand that
> >> > two activities use the same singleton class instance which breakmy
> >> > application logic.
> >> > I wonder if there is any way toletAndroidcreatemyactivitywithin
> >> > the process which the launcheractivitylies in? So that the two
> >> > instance ofmyphoto editoractivitycan be separated into two
> >> > different process. And so they can reference to different instance of
> >> > that  singleton class.
> >> > Thanks!
>
> >> --
> >> Romain Guy
> >>Androidframework 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
>
> --
> Romain GuyAndroidframework 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 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 let Android create my activity within the process which the launcher activity lies in?

2009-05-26 Thread Oceanedge

Thanks, but I think singleton is a general pattern used generally. Why
should we stop using it in Android? :(

On May 26, 12:12 pm, Romain Guy  wrote:
> Hi,
>
> You cannot do this, if only for security reasons. Running arbitrary
> code in the Home process would be very bad :)
>
> Instead of creating two processes (which is really heavy and requires
> a lot more memory), why don't you stop using a singleton?
>
>
>
> On Mon, May 25, 2009 at 9:06 PM, Oceanedge  wrote:
>
> > I'm developing a photo editor application. It will launched by
> > android.intent.action.EDIT intent. I made two application to emit that
> > intent. I found that two instance of my photo editor activity is
> > created within the same process which is named as my activity. But
> > there is a singleton class used in my  photo editor activity and that
> > two activities use the same singleton class instance which break my
> > application logic.
> > I wonder if there is any way to let Android create my activity within
> > the process which the launcher activity lies in? So that the two
> > instance of my photo editor activity can be separated into two
> > different process. And so they can reference to different instance of
> > that  singleton class.
> > Thanks!
>
> --
> 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 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 let Android create my activity within the process which the launcher activity lies in?

2009-05-26 Thread Oceanedge

Sorry, there are three separate applications. One is my Photo Editor
application. The other two applications are the launcher applications,
they emit  android.intent.action.EDIT intent to launch my Photo Editor
application.

The Photo Editor application contains my photo editor activity which
uses a singleton class. And that singleton class instance is used by
the two instance of my photo editor activity due to  other two
applications both emit  android.intent.action.EDIT intent.

What do you mean use the Application context to synchronize access to
the singleton? How should I use it?

Thanks!

On May 26, 12:26 pm, Matt Williams  wrote:
> I was a bit confused by your question. Are they 2 applications, or 2
> activities within the same application?
> If they are activities within the same application, could you use the
> Application context to synchronize access to the singleton?
>
> On May 26, 5:06 am, Oceanedge  wrote:
>
> > I'm developing a photo editor application. It will launched by
> > android.intent.action.EDIT intent. I made two application to emit that
> > intent. I found that two instance of my photo editor activity is
> > created within the same process which is named as my activity. But
> > there is a singleton class used in my  photo editor activity and that
> > two activities use the same singleton class instance which break my
> > application logic.
> > I wonder if there is any way to let Android create my activity within
> > the process which the launcher activity lies in? So that the two
> > instance of my photo editor activity can be separated into two
> > different process. And so they can reference to different instance of
> > that  singleton class.
> > Thanks!
--~--~-~--~~~---~--~~
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 let Android create my activity within the process which the launcher activity lies in?

2009-05-25 Thread Oceanedge

I'm developing a photo editor application. It will launched by
android.intent.action.EDIT intent. I made two application to emit that
intent. I found that two instance of my photo editor activity is
created within the same process which is named as my activity. But
there is a singleton class used in my  photo editor activity and that
two activities use the same singleton class instance which break my
application logic.
I wonder if there is any way to let Android create my activity within
the process which the launcher activity lies in? So that the two
instance of my photo editor activity can be separated into two
different process. And so they can reference to different instance of
that  singleton class.
Thanks!
--~--~-~--~~~---~--~~
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 implement JNI which calls a time consuming native method

2009-05-09 Thread Oceanedge

I need to implement a JNI which render image with 3-party native
function.  This function call is time consuming, it cost about 1s to
return. I found during that time, even if I call the JNI within
another Java thread, the whole Dalvik VM is blocked. UI is frozen. I
guess that's because Dalvik doesn't implement Java thread with a
native thread, so any time consuming native function call will block
the whole VM.
I wonder how to solve this problem. My best guess is I should create a
pthread in JNI to call that 3-party native function. But I don't know
how to implement this kind of JNI.
Please help. Thanks!
--~--~-~--~~~---~--~~
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: dispatchTouchEvent works differently when finger hold on touch screen in G1 & emulator

2009-04-01 Thread Oceanedge


Thank you very much. It works fine.

On Mar 31, 10:14 am, Streets Of Boston 
wrote:
> Override you dispatchTouchEvent(...), as you do right now, and forward
> its MotionEvent to a GestureDetector you created.
>
> public class MyView {
>
>    GestureDetector mGD = new GestureDetector(this);
>
>    public MyView(...) {
>       ...
>       ...
>       mGD.setIsLongPressEnabled(true);
>       ...
>    }
>    public boolean dispatchTouchEvent(MotionEvent event) {
>       ... you may want to handle the MotionEvent.ACTION_UP yourself
> first. ...
>       ... but always call this at the end:
>       return mGD.onTouchEvent(event);
>    }
>
>    // Called by the GestureDetector mGD.
>    public void onLongPress(MotionEvent event) {
>       // do your stuff here.
>    }
>
> }
>
> On Mar 30, 9:51 pm, Oceanedge  wrote:
>
> > Thank you very much!
>
> > But my current usecase is not to detect motion, but hold. I have a
> > PhotoView which display an icon. It needs to respond to click and hold
> > event.
> > If user click on it, it will scroll other widget content in one step.
> > If user touch & hold on it, it will scroll the widget content one by
> > one continually in about 800ms interval.
>
> > Currently I implement the behavior by setOnClickListener() method for
> > the click event.
> > For touch & hold, I override dispatchTouchEvent() method and check for
> > the holding status by checking the move shall be less than 10 pixels
> > and event.getEventTime() - event.getDownTime() > 800ms for
> > MotionEvent.ACTION_MOVE event.
>
> > It works fine in G1 but not work in emulator.
> > Is there any better solution?
> > Thanks!
>
> > On Mar 30, 11:17 am, Romain Guy  wrote:
>
> > > They work the same.
>
> > > > I have a class inherited from RelativeLayout and override public
> > > > booleandispatchTouchEvent(MotionEvent event) method. After I touch &
> > > > hold on the touch screen, in emulator I got MotionEvent.ACTION_DOWN
> > > > event only. But in G1, I got MotionEvent.ACTION_DOWN first and then
> > > > MotionEvent.ACTION_MOVE continuously, even if I try my best to hold
> > > > still my finger tip.
>
> > > That's simply because you cannot hold your finger still. With a mouse
> > > cursor you have a 1px precision, with a finger, it's a lot more. The
> > > way to "work around" this is simply to use thresholds when you try to
> > > detect motion. For instance in a ScrollView or ListView a scroll
> > > happens only if the finger has moved by 16 pixels or more. You can use
> > > the same values as the framework by looking at the ViewConfiguration
> > > class.
>
> > > --
> > > 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- Hide quoted 
> > > text -
>
> > - Show quoted text -
--~--~-~--~~~---~--~~
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: dispatchTouchEvent works differently when finger hold on touch screen in G1 & emulator

2009-03-30 Thread Oceanedge

Thank you very much!

But my current usecase is not to detect motion, but hold. I have a
PhotoView which display an icon. It needs to respond to click and hold
event.
If user click on it, it will scroll other widget content in one step.
If user touch & hold on it, it will scroll the widget content one by
one continually in about 800ms interval.

Currently I implement the behavior by setOnClickListener() method for
the click event.
For touch & hold, I override dispatchTouchEvent() method and check for
the holding status by checking the move shall be less than 10 pixels
and event.getEventTime() - event.getDownTime() > 800ms for
MotionEvent.ACTION_MOVE event.

It works fine in G1 but not work in emulator.
Is there any better solution?
Thanks!

On Mar 30, 11:17 am, Romain Guy  wrote:
> They work the same.
>
> > I have a class inherited from RelativeLayout and override public
> > booleandispatchTouchEvent(MotionEvent event) method. After I touch &
> > hold on the touch screen, in emulator I got MotionEvent.ACTION_DOWN
> > event only. But in G1, I got MotionEvent.ACTION_DOWN first and then
> > MotionEvent.ACTION_MOVE continuously, even if I try my best to hold
> > still my finger tip.
>
> That's simply because you cannot hold your finger still. With a mouse
> cursor you have a 1px precision, with a finger, it's a lot more. The
> way to "work around" this is simply to use thresholds when you try to
> detect motion. For instance in a ScrollView or ListView a scroll
> happens only if the finger has moved by 16 pixels or more. You can use
> the same values as the framework by looking at the ViewConfiguration
> class.
>
> --
> 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 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] dispatchTouchEvent works differently when finger hold on touch screen in G1 & emulator

2009-03-29 Thread Oceanedge

Hi, All


I found event handler: dispatchTouchEvent(MotionEvent) works
differently between G1 & emulator when finger is holding on touch
screen.

I have a class inherited from RelativeLayout and override public
boolean dispatchTouchEvent(MotionEvent event) method. After I touch &
hold on the touch screen, in emulator I got MotionEvent.ACTION_DOWN
event only. But in G1, I got MotionEvent.ACTION_DOWN first and then
MotionEvent.ACTION_MOVE continuously, even if I try my best to hold
still my finger tip.

I wonder if this is because there is pressure field in the
MotionEvent. Because the blood pressure on finger tip changes
continuously with heart beat, so no matter how still my finger is, the
pressure value still changes. But I wonder if all kinds of touch
screen have pressure factor in their touch event? Will all touch
screen driver emit touch event continuously when finger is holding on
the screen?

Please help, Thanks!


--~--~-~--~~~---~--~~
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 a Color Picker widget in Android?

2009-03-19 Thread Oceanedge

Hi, Is there a Color Picker widget which developer can call in
Android?
Thanks!

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