how to get authentication device token in android
<p>how can we generate authentication token from android device
I know how to recover the single token of a android smartphone for notification</p>

<p>I find example on the internet, but for the iphone development</p>

<p>i find this code </p>

<pre><code> def getAuthToken () { 

    StringBuilder builder = new StringBuilder();
        builder.append("Email=").append("developer email");
        builder.append("&amp;Passwd=").append("password");
        builder.append("&amp;accountType=GOOGLE");
        builder.append("&amp;source=Google-C2DM-Example");
        builder.append("&amp;service=ac2dm");

        // Setup the Http Post
        byte[] data = builder.toString().getBytes();
        URL url = new URL("https://www.google.com/accounts/ClientLogin");
        HttpURLConnection con = (HttpURLConnection) url.openConnection();
        con.setUseCaches(false);
        con.setDoOutput(true);
        con.setRequestMethod("POST");
        con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
        con.setRequestProperty("Content-Length", Integer.toString(data.length));

        // Issue the HTTP POST request
        OutputStream output = con.getOutputStream();
        output.write(data);
        output.close();
        // Read the response
        BufferedReader reader = new BufferedReader(new InputStreamReader(con.getInputStream()));
        String[] split1 = reader.readLine().split("=");
        String[] split2 = reader.readLine().split("=");
        String[] split3 = reader.readLine().split("=");
        // Finally get the authentication token
        String clientAuthToken = split3[1];
        return clientAuthToken;        
</code></pre>
