How to use SearchManager

by anderson » Thu, 05 Mar 2009 21:21:48 GMT


Sponsored Links
 i read the  SearchManager
 http://developer.android.com/reference/android/app/SearchManager.html 

but i feel confused
could anyone give some example ?
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. android record video(3gp) to remote server

After several days of agonizing, ultimately did not solve the problem,
is hereby published issue and hoping to get friends to help.

Requirements: The android to record video and transmitted through the
socket means to save the file on the server (3gp file).

Question: 3gp files saved to the server, mobile player can't open, 3gp
file encoding is not correct.

Note: stored in the phone's local system, 3gp files encoded in the
correct format, mobile phone player to open.

android record code:

String hostname = "192.168.20.106";
                int port = 1234;
                try
                {
                        socket = new Socket(InetAddress.getByName(hostname), 
port);
                }
                catch (UnknownHostException e)
                {
                        e.printStackTrace();
                }
                catch (IOException e)
                {
                        e.printStackTrace();
                }
                ParcelFileDescriptor pfd = 
ParcelFileDescriptor.fromSocket(socket);
                mMediaRecorder = new MediaRecorder();

                // 
                mMediaRecorder.setOutputFile(pfd.getFileDescriptor());
                mMediaRecorder.setPreviewDisplay(mSurfaceHolder.getSurface());
                mMediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
                mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
                mMediaRecorder.setOutputFormat
(MediaRecorder.OutputFormat.THREE_GPP);
                mMediaRecorder.setVideoSize(176, 144);
                mMediaRecorder.setVideoFrameRate(15);
                mMediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.H263);
                
mMediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
                mMediaRecorder.setMaxDuration(10000);


Server receives the data  code:
public MultiThreadServer() throws IOException
        {
                serverSocket = new ServerSocket(port);
                // RuntimevailableProcessor()PU.
                executorService = 
Executors.newFixedThreadPool(Runtime.getRuntime
().availableProcessors() * POOL_SIZE);

                System.out.println("quot;);
        }

        public void service()
        {
                while (true)
                {
                        Socket socket = null;
                        try
                        {
                                // ,accept();€                                socket = serverSocket.accept();
                                //executorService.execute(new Handler(socket));
                                new Thread(new Handler(socket)).start();

                        }
                        catch (Exception e)
                        {
                                e.printStackTrace();
                        }
                }
        }

Handler class code:

public Handler(Socket socket)
        {
                this.socket = socket;
                d = new File("D:/ds");
                if (!d.exists())
                {
                        d.mkdirs();
                }

                try
                {
                        store = File.createTempFile("sdsd", ".3gp", d);
                        fos = new FileOutputStream(store);
                        socketIn = socket.getInputStream();
                }
                catch (IOException e)
                {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                }
        }

        public void run()
        {
                try
                {
                        System.out.println("New connection accepted " +
socket.getInetAddress() + ":" + socket.getPort());

                        while ((length = socketIn.read(buffer)) != -1)
                        {
                                fos.write(buffer, 0, length);
                                fos.flush();
                                System.out.println("€€€€quot; + length);
                        }

                        fos.flush();
                        store = null;
                        socketIn.close();
                }
                catch (IOException e)
                {
                        e.printStackTrace();
                }
                finally
                {
                        try
                        {
                                fos.close();
                                fos = null;
                                store = null;
                                if (socket != null)
                                        socket.close();
                        }
                        catch (IOException e)
                        {
                                e.printStackTrace();
                        }
                }
                System.out.println("-----------------------------");
        }



You help me find the cause of it, in this thank you. Given at the high
score! ! !

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

2. When I run getSize() on my text view it returns 0

When I run getSize() on my text view it returns 0? I put text inside
it by running setText() immediately preceeding the call to getSize()

What is going wrong?
--~--~---------~--~----~------------~-------~--~----~

3. Including pre-compiled 3rd party jar files to android application & building it with source code

4. Would you at least give us names

5. OnLocationChanged never called

6. Modular packaging - Queries

7. ContentResolver in a Service