Eclipse cannot find MediaMetadataRetriever class

by Shubham » Wed, 10 Dec 2008 03:40:55 GMT


Sponsored Links
 Hi,

I am using Eclipse Ganymede with Android SDK 1.0 r1 on a WinXP.  I am
trying to import
android.media.MediaMetadataRetriever but it seems that this class is
not part of the SDK, even though other classes
such as MediaPlayer are there.  Any idea how do i fix it?

Thanks,
Shubham

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



Other Threads

1. Mulit-Touch Problems

Hi,

i'm currently investigating multi-touch support on >= 2.0 devices,
testing it on a motorola milestone. The multi-touch API seems to be
very well thought out and processing the respective MotionEvents is
really a piece of cake.

I want to use multi-touch as an optional input method for a small game
i'm developing. The requirement is to detect 2 fingers on screen with
their respective x/y coordinates. Fingers will be lifted and pressed
down randomly and rapidly (rapidly ~ 500ms intervals). As mentioned
earlier, getting the data is no problem at all, here's how i do it in
my test application:

@Override
        public boolean onTouch(View v, MotionEvent event)
        {
                int action = event.getAction();
            int ptrId = event.getPointerId(0);
            if(event.getPointerCount() > 1)
                ptrId = (action & MotionEvent.ACTION_POINTER_ID_MASK) >>
MotionEvent.ACTION_POINTER_ID_SHIFT;
            action = action & MotionEvent.ACTION_MASK;
            if(action < 7 && action > 4)
                action = action - 5;

                if( action == MotionEvent.ACTION_DOWN )
                {
                        for( int i = 0; i < event.getPointerCount(); i++ )
                        {
                                float x = event.getX(i);
                            float y = event.getY(i);

                                touchX[event.getPointerId(i)] = (int)x;
                                touchY[event.getPointerId(i)] = (int)y;
                        }

                        touched[ptrId] = true;
                }
                if( action == MotionEvent.ACTION_MOVE )
                {
                        for( int i = 0; i < event.getPointerCount(); i++ )
                        {
                                float x = event.getX(i);
                            float y = event.getY(i);

                                touchX[event.getPointerId(i)] = (int)x;
                                touchY[event.getPointerId(i)] = (int)y;
                        }
                }
                if( action == MotionEvent.ACTION_UP )
                {
                        touched[ptrId] = false;

                        if( event.getPointerCount() == 1 )
                                for( int i = 0; i < 10; i++ )
                                        touched[i] = false;
                }
                if( action == MotionEvent.ACTION_CANCEL )
                {
                        touched[ptrId] = false;
                        if( event.getPointerCount() == 1 )
                        for( int i = 0; i < 10; i++ )
                                touched[i] = false;
                }

                return true;
        }

touchX[], touchY[] and touch[] are fixed size arrays that store the
pointers coordinates and touch state. Later on i'm going to poll those
to react to player input.

Now, after some initial testing i noticed a problem when randomly
lifting and holding down 2 fingers in a random sequence. I arrived at
a small sequence that always let's me  reproduce the problem:

1) (in landscape mode) hold down finger 1 on the right side of the
screen
2) hold down finger 2 on the left side of the screen and leave both
fingers on the screen for a small amount of time
3) now lift finger 1 and let it go down on the screen again

What happens is that logcat get's filled with

01-30 13:06:45.702: INFO/InputDevice(1167): Dropping bad point #0:
newY=759 closestDy=420 maxDy=420

and the coordinates of the second finger are equal to the coordinate
of the other finger on a single axis.

I'm currently downloading the android source from git to maybe figure
out what's the problem but i'm afraid i'm not a kernel hacker enough
to arrive at a helpful conclusion.

Luke Hutchison posted on this list and on his web site (http://
lukehutch.wordpress.com/2010/01/06/my-multi-touch-code-ported-to-
eclair/) that he experienced similar results. The problem is also
reproduceable with his MTVisualizer application available in the
market as well as with all other multi touch games i could find on the
market. It seems that when the fingers are close on one axis the
hardware/driver/framework get's confused and sets one of the
coordinates of one of the fingers to the same value the coordinate of
the other finger has on this axis (Luke pointed that out in his posts,
i was hoping this would not be true for post G1 hardware). I wrote a
small sample application you can find at
http://code.google.com/p/android-gamedev/source/browse/trunk/src/com/badlogic/gamedev/samples/MultitouchSample.java
and prepared a video to show the problem:

http://www.youtube.com/watch?v=bvqX4EkpbNI

I'm not entirely sure wheter there's a bug in the code or wheter it is
hardware/driver related. I'd be very thankful for any comments on the
matter as the behaviour as shown in the video doesn't allow for multi-
touch controls of games as seen for example in iphone games as
minigore.

Thanks for reading,
Mario

-- 

2. Race condition using handler + thread.

Hi

I have an application that starts a background thread to load data. It
uses Handler to pass data back to the main thread. Now this works
perfectly most of the time, but not when I switch orientation.

What I found was this behavior:
- onCreate : Start main view, with background load thread
- Switch android direction
- onStop : Kill background loading thread, does thread.interrupt +
thread.join.
- onCreate
- Data queue'd in the handler is still being pushed through from the
previous data load.
This produces a bit of a race condition for me. I can shutdown the
thread cleanly, but the data that's in the handler, between the thread
and the main view isn't always cleared.


This would be solvable with something like:
thread.interrupt();
thread.join();
handler.clear();
Before returning to the onStop function, but there's no .clear to just
empty a handler out.

How can I clear a Handler of all messages?  I use this for posting:
                        handler.post(new Runnable() {
                                @Override
                                public void run() {
                                        handler.onData(sendData);
                                }
                        });

So doing a .removecallback (which requires me to store runnables)
isn't real practical.

-- 

3. How to save files?

4. Mapview scroll finished Listener

5. Using GPS in a widget hangs on lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, (float) 0.001, locationListener);

6. Using GPS in a widget hangs on lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, (float) 0.001, locationListener);

7. call one activity from Dialog Class