Android Screen Shot

by Sansiro » Fri, 17 Jul 2009 01:53:40 GMT


Sponsored Links
 Hi,guys:
I'm writing an application running on PC. I want to get the android
device's screen which is connected to PC.
Now I use the method provider by SDK to get the screen image, just
like DDMS, and  transport the Image to PC via socket. But it's too
inefficient.
Is there a hook which can snapshot the screen change by system layer,
just like Windows Mobile?
Or any other suggestion?
BRs

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



Other Threads

1. GTalk Sender unable to make session

Hi

I'm trying the sample code packed in the SDK for GTalk activities.
The API demo of GTalk Service works fine but when i try to build and
execute the same code,

It is unable create the session object and hence, throws
NullPointerException.

I have tried debugging but it seems that it doesnt event comes to the
ServiceComponent

My Code is:

/*
 * Copyright (C) 2007 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.android.samples.app;

import android.os.Bundle;
import android.os.IBinder;
import android.os.DeadObjectException;
import android.widget.Button;
import android.widget.EditText;
import android.content.ServiceConnection;
import android.content.ComponentName;
import android.content.Intent;
import android.content.Context;
import android.app.Activity;
import android.view.View;
import android.text.TextUtils;
import android.util.Log;
import android.widget.Toast;

import com.google.android.gtalkservice.IGTalkService;
import com.google.android.gtalkservice.IGTalkSession;

// Need the following import to get access to the app resources, since
this
// class is in a sub-package.



public class GTalkDataMessageSender extends Activity {
    private static final String LOG_TAG = "GTalkServiceSample";

    IGTalkSession mGTalkSession = null;
    EditText mUsernameField;
    Button mSendButton;

    @Override
    protected void onCreate(Bundle icicle) {
        super.onCreate(icicle);

        bindGTalkService();
        testMsg();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        unbindService(mConnection);
    }

    private void bindGTalkService() {
        bindService((new Intent()).setComponent(
 
com.google.android.gtalkservice.GTalkServiceConstants.GTALK_SERVICE_COMPONENT),
                mConnection, 0);
    }


    private Intent getIntentToSend() {
        Intent intent = new Intent(GTalkDataMessageReceiver.ACTION);
        intent.putExtra("poke", "Hi, I am Sam.");
        intent.putExtra("question", "would you like to eat green eggs
and ham?");

        return intent;
    }

    private void showMessage(CharSequence msg) {
        Toast.makeText(this, msg, Toast.LENGTH_LONG).show();
    }

    private ServiceConnection mConnection = new ServiceConnection() {
        public void onServiceConnected(ComponentName className,
IBinder service) {
            // This is called when the connection with the
GTalkService has been
            // established, giving us the service object we can use to
            // interact with the service.  We are communicating with
our
            // service through an IDL interface, so get a client-side
            // representation of that from the raw service object.
            IGTalkService GTalkService =
IGTalkService.Stub.asInterface(service);

            try {
                mGTalkSession = GTalkService.getDefaultSession();

                if (mGTalkSession == null) {
                    // this should not happen.

                    return;
                }
            } catch (DeadObjectException ex) {
                Log.e(LOG_TAG, "caught " + ex);

            }

            mSendButton.setEnabled(true);
        }

        public void onServiceDisconnected(ComponentName className) {
            // This is called when the connection with the service has
been
            // unexpectedly disconnected -- that is, its process
crashed.
            mGTalkSession = null;
            mSendButton.setEnabled(false);
        }
    };
private void testMsg(){
    try {
        mGTalkSession.sendDataMessage("[EMAIL PROTECTED]",
getIntentToSend());
    } catch (DeadObjectException ex) {
        Log.e(LOG_TAG, "caught " + ex);

        mGTalkSession = null;
        bindGTalkService();
    }

}


}



Please help !!
--~--~---------~--~----~------------~-------~--~----~

2. getting Media File metadata?

Does anyone know what classes or libraries the MediaScanner uses to
get the metadata about media files.

It gets fields such as the length, title, number, album and artist
name (and much more) from the files.  I know that there are other java
libraries I could use to do this but if there is something already
built into android then I would like to use that.

I know I could get the information from the database that android
creates with all the media in it, but because of certain restrictions
I can not use that method.


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

3. Console error message

4. Android Developer Registry

5. Bug :: Spinner + arrays of numbers in array.xml

6. Bouncy Castle version included in android, plans for future

7. importing java 6 libs