Touch/mouse event processing in Android's browser

by ...Max... » Wed, 22 Oct 2008 09:23:07 GMT


Sponsored Links
 Is there any way to process the messages generated by the touch events
in Android's version of WebKit? On iPhone, this is done with
additional events (ontouchstart, ontouchend, ontouchmove). I
understand these are not available in Android. I have tried (on the
emulator) monitoring the onmousedown, onmouseup and onmousemove which
are implemented in base WebKit and the results were not encouraging:

- Clicking and releasing the mouse without moving it generates
onmousedown followed by onmouseup but ONLY when the mouse button is
released
- Clicking, holding for a short period of time, moving and then
releasing generates a sequence of onmousemove, onmousedown, onmouseup
(in that order) again, ONLY when the button is released
- Clicking, moving immediately and releasing does not generate any
events

This is clearly not enough for any kind of touch-based UI. Is there
some provision in the DOM, or a <meta> tag for capturing the missing
events?

Thanks in advance,
...Max...

--~--~---------~--~----~------------~-------~--~----~



Touch/mouse event processing in Android's browser

by csvy » Sat, 29 Nov 2008 16:30:50 GMT


 Has anyone made any progress on this?  I skimmed through the Webkit
source used in Android, but I couldn't find any non-standard events
(although it is extraordinarily possible that I missed something).

I really need to be able to get touch events and this seems like a
huge omission...




--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. How to insert a menuitem?

Hi Guys,

Thanks for your help,

I can create menuitem dynmatically,

However, I have found another issue,

For example, when I added a menuitem at first place.

and since content of screen has been changed, so this menuitem has
been removed.

but things changed again, I will display this menuitem again, but I
want it show up at the same place
as it first showed instead of being displayed at the last place, which
current I implemented.

How to set menuitem position, like insert function?

Thanks



--~--~---------~--~----~------------~-------~--~----~

2. PopupWindow not showing.. getting a nullpointer need explanation

I am trying to get this popup window to pop up when it is called but
it keeps on getting a nullpointerexception error. it shows up at the
line whenever i try to use the setText method. When i debug it shows
that the popup window is not showable ever. the seeqpodtrack part is
working correctly for sure, so just ignore that part.

    public void popuptrack(View v, SeeqPodTrack currenttrack){
        int w = v.getWidth();
        int h = v.getHeight();
        final PopupWindow pw = new PopupWindow();
        pw.setWidth(w);
        pw.setHeight(h);
        pw.setContentView(findViewById(R.layout.trackinfo));

        pw.show(v);
        pw.update(v, -1, -1);
        TextView title = (TextView) findViewById(R.id.Title);
        TextView creator = (TextView) findViewById(R.id.Creator);
        TextView album = (TextView) findViewById(R.id.Album);
        TextView genre = (TextView) findViewById(R.id.Genre);
        TextView location = (TextView) findViewById(R.id.Location);
        title.setText(currenttrack.getTitle());
        creator.setText(currenttrack.getCreator());
        album.setText(currenttrack.getAlbum());
        genre.setText(currenttrack.getGenre());
        location.setText(currenttrack.getLocation());
        Button closebutton = (Button) findViewById(R.id.CloseButton);
        closebutton.setOnClickListener(new Button.OnClickListener(){
                public void onClick(View v){
                        pw.dismiss();
                }
        });





    }


// here is trackinfo.xml
<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:padding="10dip">

                <TextView android:id="@+id/TitleLabel"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Title:" />

                <TextView android:id="@+id/Title"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="" />

                <TextView android:id="@+id/CreatorLabel"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Artist:" />

                <TextView android:id="@+id/Creator"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="" />
                <TextView android:id="@+id/AlbumLabel"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Album:" />

                <TextView android:id="@+id/Album"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="" />
                <TextView android:id="@+id/GenreLabel"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Genre:" />

                <TextView android:id="@+id/Genre"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="" />
                <TextView android:id="@+id/LocationLabel"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Web Address:" />

                <TextView android:id="@+id/Location"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="" />

                <Button android:id="@+id/CloseButton"
                        android:paddingTop="15dip"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Close Window" />
                <Button android:id="@+id/DownloadButton"
                        android:paddingTop="15dip"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Download" />
</LinearLayout>
--~--~---------~--~----~------------~-------~--~----~

3. Is it safe to share a View among several layouts?

4. Why don't System.err and System.out point to the console?

5. ListView divider and padding

6. Any advantage using android.net.uri instead of java.net.url or uri?

7. How to blur a rectangular region of the screen