Eclipse + cupcake + other android projects in build path = VerifyError

by Evan JIANG » Wed, 29 Apr 2009 18:22:19 GMT


Sponsored Links
 Well, I met the same issue.
Does anyone have any idea about this?

Best regards,
On Tue, Apr 28, 2009 at 11:14 PM, Guillaume Perrot



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



Other Threads

1. video capture doesn't seem to work

CODEpackage com.example.android.camerarec3;

import java.io.IOException;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.SurfaceView;
import android.view.SurfaceHolder;
import android.media.MediaRecorder;
import android.content.Context;
import android.content.pm.ActivityInfo;

import android.hardware.Camera;

public class CameraRec3 extends Activity implements
SurfaceHolder.Callback {
    /** Called when the activity is first created. */

        SurfaceHolder holder;
        private static final int MAX_RECORDING_DURATION_MS = 10 * 60 * 1000;
    @Override

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        //sv for preview the camera video
        SurfaceView sv = (SurfaceView) findViewById
(R.id.mySurfaceView);
        holder = sv.getHolder();
        holder.addCallback(this);

        holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);

        MediaRecorder recorder = new MediaRecorder();

        String filePath=("/sdcard/test.3gpp");
       // recorder.setCamera(Camera.open());
        recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
        recorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT);
        recorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT);

        recorder.setVideoEncoder
(MediaRecorder.VideoEncoder.MPEG_4_SP);
        recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
        recorder.setMaxDuration(MAX_RECORDING_DURATION_MS);
        recorder.setVideoSize(352,288);
        recorder.setVideoFrameRate(15);

        //we can use the getPath function to create file path
        recorder.setOutputFile(filePath);
        this.setRequestedOrientation
(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);


        try
        {
                recorder.setPreviewDisplay(holder.getSurface());
                recorder.prepare();
        }
        catch (IllegalStateException e)
        {
            Log.i(this.getClass().toString(),e.getMessage());
        }
        catch (IOException e)
        {
            Log.i(this.getClass().toString(),e.getMessage());
        }
        recorder.start();
    }
        @Override
        public void surfaceChanged(SurfaceHolder arg0, int arg1, int arg2,
int arg3) {
                // TODO Auto-generated method stub

        }
        @Override
        public void surfaceCreated(SurfaceHolder mholder) {
                // TODO Auto-generated method stub
                holder = mholder;
        }
        @Override
        public void surfaceDestroyed(SurfaceHolder mholder) {
                // TODO Auto-generated method stub
                holder=null;
        }

}









No error in LOGCAT...

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

2. GestureListener events

i'm using the GestureDetector and GestureListener in a program. i want
to have separate actions for the onFling and onScroll events. for a
"scroll" event there is no problem - only the onScroll event is
called. however for a "fling" event BOTH the onFling and onScroll
events are being called. i tried returning "true" in the onFling
method to prevent further propagation of the event but that didnt
help. following is the code excerpt from the onTouchEvent and the
related gesture events:

        private static boolean fling, scroll; //two boolean values to detect
whether the performed action is a fling or scroll
        private GestureDetector scanner; //this is the gesture detector

        public boolean onTouchEvent(MotionEvent me){

                fling = false;
                scroll = false;

                scanner.onTouchEvent(me);

                if (fling) {
                        scroll = false;
                        return true;
                } else if (scroll){

                        return true;
                }


                return super.onTouchEvent(me);
        }

        public boolean onFling(MotionEvent e1, MotionEvent e2, float
velocityX,
                        float velocityY) {

                fling = true;

                return false; //changing this to return true at this point 
makes no
difference
        }


        public boolean onScroll(MotionEvent e1, MotionEvent e2, float
distanceX,
                        float distanceY) {

                scroll = true;

                return false;
        }


what i tried in the onTouchEvent method above is to put a kind of a
"lock" so that if a "fling" is detected then the appropriate action is
taken and the event is not propagated further. however despite trying
every combination of returning true / false in each of the above
methods, i am unable to separate out the "fling" event from the
"scroll" event.

as i said - there is no problem in the conventional scroll - in this
case only the action for scroll is being performed.

for the gesture events, is there any particular sequence in which the
event is propagated? i.e. does it first go to the onClick, then the
onFling, then the onScroll ... etc?

any inputs will be greatly appreciated

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

3. can ListActivity and Tab widget can use in one activity?

4. TextView.setMaxLines(10) is not working as what I wanted; I wanted the latest 10 lines instead of the oldest ones.

5. GridView example

6. Center an element

7. Android general question