将我的GCM代码添加到现有应用程序中

I am using the code http://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/ It is running well for multicast too.I want to remove the user registration activity from the app and integrate it into my existing app.How to do that? The GCM is taking email id and name from the users.I don't want this to happen.

Looking at the app you linked to, the RegisterActivity is the first activity started when the app is launched, and it doesn't do anthing beside asking for email and name, and starting the MainActivity.

You can simply remove this activity and start the app from the MainActivity. That means you should add the following intent-filter to the declaration of MainActivity in the manifest, and remove the declaration of RegisterActivity.

        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>

In the code of MainActivity.onCreate you should remove any reference to email and name (which are currently passed to it from the RegisterActivity). The registration to GCM is already done in the MainActivity, so you don't have to change anything there.

That said, you are basing your app on an old tutorial (from 2012) which uses a deprecated class (GCMRegistrar) to register to GCM. You should look at the current official GCM Demo app to see how the current way of registration looks like. It's simpler.