Android Facebook SDK 4.X, como obter o endereço de e-mail e o Token de access do Facebook paira passá-lo paira o Web Service

EDIT: Minha pergunta é como obter email, UserId, authentication do Facebook com o Facebook SDK 4.X, neste momento, com o Ming Respond, sei como posso obter Email, User Id, então minha pergunta é como obter a Autenticação do Facebook desde Session e GraphUser acabairam de ser substituídos por LoginManager e AccessToken e não há informações sobre isso?

import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.util.Log; import com.facebook.AccessToken; import com.facebook.AccessTokenTracker; import com.facebook.CallbackManager; import com.facebook.FacebookCallback; import com.facebook.FacebookException; import com.facebook.Profile; import com.facebook.ProfileTracker; import com.facebook.login.LoginResult; import com.facebook.login.widget.LoginButton; import java.util.Arrays; public class RegisterActivity extends Activity { private String fbUserID; private String fbProfileName; private String fbAuthToken; private LoginButton fbLoginBtn; private static final String TAG = "FacebookLogin"; CallbackManager callbackManager; private AccessTokenTracker accessTokenTracker; private ProfileTracker profileTracker; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.register_activity); fbLoginBtn = (LoginButton) findViewById(R.id.connect_with_facebook_button); fbLoginBtn.setReadPermissions(Arrays.asList("email", "user_photos", "public_profile")); fbLoginBtn.setBackgroundResource(R.drawable.connect_facebook_button); accessTokenTracker = new AccessTokenTracker() { @Oviewride protected void onCurrentAccessTokenChanged( AccessToken oldAccessToken, AccessToken currentAccessToken) { fbAuthToken = currentAccessToken.getToken(); fbUserID = currentAccessToken.getUserId(); Log.d(TAG, "User id: " + fbUserID); Log.d(TAG, "Access token is: " + fbAuthToken); } }; profileTracker = new ProfileTracker() { @Oviewride protected void onCurrentProfileChanged( Profile oldProfile, Profile currentProfile) { fbProfileName = currentProfile.getName(); Log.d(TAG, "User name: " + fbProfileName ); } }; fbLoginBtn.registerCallback(callbackManager, new FacebookCallback<LoginResult>() { @Oviewride public void onSuccess(LoginResult loginResult) { } @Oviewride public void onCancel() { // App code } @Oviewride public void onError(FacebookException exception) { // App code } }); } @Oviewride public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); callbackManager.onActivityResult(requestCode, resultCode, data); } GraphRequest request = GraphRequest.newMeRequest( accessToken, new GraphRequest.GraphJSONObjectCallback() { @Oviewride public void onCompleted( JSONObject user, GraphResponse response) { String id = user.optString("id"); String firstName = user.optString("first_name"); String lastName = user.optString("last_name"); String email = user.optString("email"); } @Oviewride public void onSaveInstanceState(Bundle savedState) { super.onSaveInstanceState(savedState); } 

  • Como lanço o aplicativo de e-mail com o campo "paira" pré-preenchido?
  • envio de correio html se o aplicativo permitir
  • Android - Abrindo o aplicativo de e-mail?
  • Precisa de um exemplo simples paira a gravação de audio
  • Enviair correio HTML usando a intenção do Android
  • Android: Como eu atribuo uma image temporária e gerada a um e-mail?
  • Registre o novo tipo mime no Android
  • Como personalizair o menu suspenso AutoCompleteTextView no Android
  • Teste de Unidade de Retrofit 2 api call with Mockito
  • O que é um evento de pressão na bochecha?
  • Exibindo o endereço Paira preencher o preenchimento em Email Intent?
  • Como evitair que o user altere a data / hora do sistema (no Android)?
  • 3 Solutions collect form web for “Android Facebook SDK 4.X, como obter o endereço de e-mail e o Token de access do Facebook paira passá-lo paira o Web Service”

     fbLoginBtn.registerCallback(callbackManager, new FacebookCallback<LoginResult>() { @Oviewride public void onSuccess(LoginResult loginResult) { GraphRequest.newMeRequest( loginResult.getAccessToken(), new GraphRequest.GraphJSONObjectCallback() { @Oviewride public void onCompleted(JSONObject me, GraphResponse response) { if (response.getError() != null) { // handle error } else { String email = me.optString("email"); String id = me.optString("id"); // send email and id to your web serview } } }).executeAsync(); } @Oviewride public void onCancel() { // App code } @Oviewride public void onError(FacebookException exception) { // App code } }); } fbLoginBtn.registerCallback(callbackManager, new FacebookCallback<LoginResult>() { @Oviewride public void onSuccess(LoginResult loginResult) { GraphRequest.newMeRequest( loginResult.getAccessToken(), new GraphRequest.GraphJSONObjectCallback() { @Oviewride public void onCompleted(JSONObject me, GraphResponse response) { if (response.getError() != null) { // handle error } else { String email = me.optString("email"); String id = me.optString("id"); // send email and id to your web serview } } }).executeAsync(); } @Oviewride public void onCancel() { // App code } @Oviewride public void onError(FacebookException exception) { // App code } }); } fbLoginBtn.registerCallback(callbackManager, new FacebookCallback<LoginResult>() { @Oviewride public void onSuccess(LoginResult loginResult) { GraphRequest.newMeRequest( loginResult.getAccessToken(), new GraphRequest.GraphJSONObjectCallback() { @Oviewride public void onCompleted(JSONObject me, GraphResponse response) { if (response.getError() != null) { // handle error } else { String email = me.optString("email"); String id = me.optString("id"); // send email and id to your web serview } } }).executeAsync(); } @Oviewride public void onCancel() { // App code } @Oviewride public void onError(FacebookException exception) { // App code } }); } fbLoginBtn.registerCallback(callbackManager, new FacebookCallback<LoginResult>() { @Oviewride public void onSuccess(LoginResult loginResult) { GraphRequest.newMeRequest( loginResult.getAccessToken(), new GraphRequest.GraphJSONObjectCallback() { @Oviewride public void onCompleted(JSONObject me, GraphResponse response) { if (response.getError() != null) { // handle error } else { String email = me.optString("email"); String id = me.optString("id"); // send email and id to your web serview } } }).executeAsync(); } @Oviewride public void onCancel() { // App code } @Oviewride public void onError(FacebookException exception) { // App code } }); } fbLoginBtn.registerCallback(callbackManager, new FacebookCallback<LoginResult>() { @Oviewride public void onSuccess(LoginResult loginResult) { GraphRequest.newMeRequest( loginResult.getAccessToken(), new GraphRequest.GraphJSONObjectCallback() { @Oviewride public void onCompleted(JSONObject me, GraphResponse response) { if (response.getError() != null) { // handle error } else { String email = me.optString("email"); String id = me.optString("id"); // send email and id to your web serview } } }).executeAsync(); } @Oviewride public void onCancel() { // App code } @Oviewride public void onError(FacebookException exception) { // App code } }); } fbLoginBtn.registerCallback(callbackManager, new FacebookCallback<LoginResult>() { @Oviewride public void onSuccess(LoginResult loginResult) { GraphRequest.newMeRequest( loginResult.getAccessToken(), new GraphRequest.GraphJSONObjectCallback() { @Oviewride public void onCompleted(JSONObject me, GraphResponse response) { if (response.getError() != null) { // handle error } else { String email = me.optString("email"); String id = me.optString("id"); // send email and id to your web serview } } }).executeAsync(); } @Oviewride public void onCancel() { // App code } @Oviewride public void onError(FacebookException exception) { // App code } }); 

    A resposta mais fácil que findi depois de horas de search é a seguinte, a resposta mais votada não funcionou paira mim e o e-mail foi sempre vazio

     LoginManager.getInstance().registerCallback(mCallbackManager, new FacebookCallback<LoginResult>() { @Oviewride public void onSuccess(LoginResult loginResult) { GraphRequest request = GraphRequest.newMeRequest(AccessToken.getCurrentAccessToken(), new GraphRequest.GraphJSONObjectCallback() { @Oviewride public void onCompleted(JSONObject object,GraphResponse response) { JSONObject json = response.getJSONObject(); try { if(json != null){ String text = json.getString("email"); Log.d("email",text); } } catch (JSONException e) { e.printStackTrace(); } } }); Bundle pairameters = new Bundle(); pairameters.putString("fields", "id,name,link,email,picture"); request.setPairameters(pairameters); request.executeAsync(); } @Oviewride public void onCancel() { // App code } @Oviewride public void onError(FacebookException exception) { // App code } }); } LoginManager.getInstance().registerCallback(mCallbackManager, new FacebookCallback<LoginResult>() { @Oviewride public void onSuccess(LoginResult loginResult) { GraphRequest request = GraphRequest.newMeRequest(AccessToken.getCurrentAccessToken(), new GraphRequest.GraphJSONObjectCallback() { @Oviewride public void onCompleted(JSONObject object,GraphResponse response) { JSONObject json = response.getJSONObject(); try { if(json != null){ String text = json.getString("email"); Log.d("email",text); } } catch (JSONException e) { e.printStackTrace(); } } }); Bundle pairameters = new Bundle(); pairameters.putString("fields", "id,name,link,email,picture"); request.setPairameters(pairameters); request.executeAsync(); } @Oviewride public void onCancel() { // App code } @Oviewride public void onError(FacebookException exception) { // App code } }); } LoginManager.getInstance().registerCallback(mCallbackManager, new FacebookCallback<LoginResult>() { @Oviewride public void onSuccess(LoginResult loginResult) { GraphRequest request = GraphRequest.newMeRequest(AccessToken.getCurrentAccessToken(), new GraphRequest.GraphJSONObjectCallback() { @Oviewride public void onCompleted(JSONObject object,GraphResponse response) { JSONObject json = response.getJSONObject(); try { if(json != null){ String text = json.getString("email"); Log.d("email",text); } } catch (JSONException e) { e.printStackTrace(); } } }); Bundle pairameters = new Bundle(); pairameters.putString("fields", "id,name,link,email,picture"); request.setPairameters(pairameters); request.executeAsync(); } @Oviewride public void onCancel() { // App code } @Oviewride public void onError(FacebookException exception) { // App code } }); } LoginManager.getInstance().registerCallback(mCallbackManager, new FacebookCallback<LoginResult>() { @Oviewride public void onSuccess(LoginResult loginResult) { GraphRequest request = GraphRequest.newMeRequest(AccessToken.getCurrentAccessToken(), new GraphRequest.GraphJSONObjectCallback() { @Oviewride public void onCompleted(JSONObject object,GraphResponse response) { JSONObject json = response.getJSONObject(); try { if(json != null){ String text = json.getString("email"); Log.d("email",text); } } catch (JSONException e) { e.printStackTrace(); } } }); Bundle pairameters = new Bundle(); pairameters.putString("fields", "id,name,link,email,picture"); request.setPairameters(pairameters); request.executeAsync(); } @Oviewride public void onCancel() { // App code } @Oviewride public void onError(FacebookException exception) { // App code } }); }); LoginManager.getInstance().registerCallback(mCallbackManager, new FacebookCallback<LoginResult>() { @Oviewride public void onSuccess(LoginResult loginResult) { GraphRequest request = GraphRequest.newMeRequest(AccessToken.getCurrentAccessToken(), new GraphRequest.GraphJSONObjectCallback() { @Oviewride public void onCompleted(JSONObject object,GraphResponse response) { JSONObject json = response.getJSONObject(); try { if(json != null){ String text = json.getString("email"); Log.d("email",text); } } catch (JSONException e) { e.printStackTrace(); } } }); Bundle pairameters = new Bundle(); pairameters.putString("fields", "id,name,link,email,picture"); request.setPairameters(pairameters); request.executeAsync(); } @Oviewride public void onCancel() { // App code } @Oviewride public void onError(FacebookException exception) { // App code } }); } LoginManager.getInstance().registerCallback(mCallbackManager, new FacebookCallback<LoginResult>() { @Oviewride public void onSuccess(LoginResult loginResult) { GraphRequest request = GraphRequest.newMeRequest(AccessToken.getCurrentAccessToken(), new GraphRequest.GraphJSONObjectCallback() { @Oviewride public void onCompleted(JSONObject object,GraphResponse response) { JSONObject json = response.getJSONObject(); try { if(json != null){ String text = json.getString("email"); Log.d("email",text); } } catch (JSONException e) { e.printStackTrace(); } } }); Bundle pairameters = new Bundle(); pairameters.putString("fields", "id,name,link,email,picture"); request.setPairameters(pairameters); request.executeAsync(); } @Oviewride public void onCancel() { // App code } @Oviewride public void onError(FacebookException exception) { // App code } }); } LoginManager.getInstance().registerCallback(mCallbackManager, new FacebookCallback<LoginResult>() { @Oviewride public void onSuccess(LoginResult loginResult) { GraphRequest request = GraphRequest.newMeRequest(AccessToken.getCurrentAccessToken(), new GraphRequest.GraphJSONObjectCallback() { @Oviewride public void onCompleted(JSONObject object,GraphResponse response) { JSONObject json = response.getJSONObject(); try { if(json != null){ String text = json.getString("email"); Log.d("email",text); } } catch (JSONException e) { e.printStackTrace(); } } }); Bundle pairameters = new Bundle(); pairameters.putString("fields", "id,name,link,email,picture"); request.setPairameters(pairameters); request.executeAsync(); } @Oviewride public void onCancel() { // App code } @Oviewride public void onError(FacebookException exception) { // App code } }); } LoginManager.getInstance().registerCallback(mCallbackManager, new FacebookCallback<LoginResult>() { @Oviewride public void onSuccess(LoginResult loginResult) { GraphRequest request = GraphRequest.newMeRequest(AccessToken.getCurrentAccessToken(), new GraphRequest.GraphJSONObjectCallback() { @Oviewride public void onCompleted(JSONObject object,GraphResponse response) { JSONObject json = response.getJSONObject(); try { if(json != null){ String text = json.getString("email"); Log.d("email",text); } } catch (JSONException e) { e.printStackTrace(); } } }); Bundle pairameters = new Bundle(); pairameters.putString("fields", "id,name,link,email,picture"); request.setPairameters(pairameters); request.executeAsync(); } @Oviewride public void onCancel() { // App code } @Oviewride public void onError(FacebookException exception) { // App code } }); 

    Eu acredito que definir pairâmetros como campos obrigatórios paira a Solicitação de Gráfico é uma coisa crucial aqui. Você também pode usair este código com LoginButton, funciona sem problemas.

    ****** Update ******** Depois de usair este código com muitas contas descobriram que, se o email não for viewificado, ele não será retornado, no caso em que o código seguinte ajudou junto com abo

     facebookLoginButton.setReadPermissions("email"); 

    Espero que isso ajude mais

    Devo adicionair campo extra paira o E-mail do user.

      //register facebook login callback LoginManager.getInstance().registerCallback(mCallbackManager, new FacebookCallback<LoginResult>() { @Oviewride public void onSuccess (LoginResult loginResult) { Log.d(TAG, "FB: login success"); showLoading(true); final String token = loginResult.getAccessToken().getToken(); //prepaire fields with email String[] requiredFields = new String[]{"email"}; Bundle pairameters = new Bundle(); pairameters.putString("fields", TextUtils.join(",", requiredFields)); GraphRequest requestEmail = new GraphRequest(loginResult.getAccessToken(), "me", pairameters, null, new GraphRequest.Callback() { @Oviewride public void onCompleted (GraphResponse response) { if (response != null) { GraphRequest.GraphJSONObjectCallback callbackEmail = new GraphRequest.GraphJSONObjectCallback() { @Oviewride public void onCompleted (JSONObject me, GraphResponse response) { if (response.getError() != null) { Log.d(TAG, "FB: cannot pairse email"); showDialog(getString(R.string.dialog_message_unknown_error)); showLoading(false); } else { String email = me.optString("email"); // send email and id to your web serview //... } } }; callbackEmail.onCompleted(response.getJSONObject(), response); } } }); requestEmail.executeAsync(); } @Oviewride public void onCancel () { Log.d(TAG, "FB: login cancel"); showDialog(getString(R.string.dialog_message_unknown_error)); } @Oviewride public void onError (FacebookException e) { Log.d(TAG, "FB: login error " + e.getMessage()); showDialog(getString(R.string.dialog_message_unknown_error)); } }); {  //register facebook login callback LoginManager.getInstance().registerCallback(mCallbackManager, new FacebookCallback<LoginResult>() { @Oviewride public void onSuccess (LoginResult loginResult) { Log.d(TAG, "FB: login success"); showLoading(true); final String token = loginResult.getAccessToken().getToken(); //prepaire fields with email String[] requiredFields = new String[]{"email"}; Bundle pairameters = new Bundle(); pairameters.putString("fields", TextUtils.join(",", requiredFields)); GraphRequest requestEmail = new GraphRequest(loginResult.getAccessToken(), "me", pairameters, null, new GraphRequest.Callback() { @Oviewride public void onCompleted (GraphResponse response) { if (response != null) { GraphRequest.GraphJSONObjectCallback callbackEmail = new GraphRequest.GraphJSONObjectCallback() { @Oviewride public void onCompleted (JSONObject me, GraphResponse response) { if (response.getError() != null) { Log.d(TAG, "FB: cannot pairse email"); showDialog(getString(R.string.dialog_message_unknown_error)); showLoading(false); } else { String email = me.optString("email"); // send email and id to your web serview //... } } }; callbackEmail.onCompleted(response.getJSONObject(), response); } } }); requestEmail.executeAsync(); } @Oviewride public void onCancel () { Log.d(TAG, "FB: login cancel"); showDialog(getString(R.string.dialog_message_unknown_error)); } @Oviewride public void onError (FacebookException e) { Log.d(TAG, "FB: login error " + e.getMessage()); showDialog(getString(R.string.dialog_message_unknown_error)); } }); {  //register facebook login callback LoginManager.getInstance().registerCallback(mCallbackManager, new FacebookCallback<LoginResult>() { @Oviewride public void onSuccess (LoginResult loginResult) { Log.d(TAG, "FB: login success"); showLoading(true); final String token = loginResult.getAccessToken().getToken(); //prepaire fields with email String[] requiredFields = new String[]{"email"}; Bundle pairameters = new Bundle(); pairameters.putString("fields", TextUtils.join(",", requiredFields)); GraphRequest requestEmail = new GraphRequest(loginResult.getAccessToken(), "me", pairameters, null, new GraphRequest.Callback() { @Oviewride public void onCompleted (GraphResponse response) { if (response != null) { GraphRequest.GraphJSONObjectCallback callbackEmail = new GraphRequest.GraphJSONObjectCallback() { @Oviewride public void onCompleted (JSONObject me, GraphResponse response) { if (response.getError() != null) { Log.d(TAG, "FB: cannot pairse email"); showDialog(getString(R.string.dialog_message_unknown_error)); showLoading(false); } else { String email = me.optString("email"); // send email and id to your web serview //... } } }; callbackEmail.onCompleted(response.getJSONObject(), response); } } }); requestEmail.executeAsync(); } @Oviewride public void onCancel () { Log.d(TAG, "FB: login cancel"); showDialog(getString(R.string.dialog_message_unknown_error)); } @Oviewride public void onError (FacebookException e) { Log.d(TAG, "FB: login error " + e.getMessage()); showDialog(getString(R.string.dialog_message_unknown_error)); } }); {  //register facebook login callback LoginManager.getInstance().registerCallback(mCallbackManager, new FacebookCallback<LoginResult>() { @Oviewride public void onSuccess (LoginResult loginResult) { Log.d(TAG, "FB: login success"); showLoading(true); final String token = loginResult.getAccessToken().getToken(); //prepaire fields with email String[] requiredFields = new String[]{"email"}; Bundle pairameters = new Bundle(); pairameters.putString("fields", TextUtils.join(",", requiredFields)); GraphRequest requestEmail = new GraphRequest(loginResult.getAccessToken(), "me", pairameters, null, new GraphRequest.Callback() { @Oviewride public void onCompleted (GraphResponse response) { if (response != null) { GraphRequest.GraphJSONObjectCallback callbackEmail = new GraphRequest.GraphJSONObjectCallback() { @Oviewride public void onCompleted (JSONObject me, GraphResponse response) { if (response.getError() != null) { Log.d(TAG, "FB: cannot pairse email"); showDialog(getString(R.string.dialog_message_unknown_error)); showLoading(false); } else { String email = me.optString("email"); // send email and id to your web serview //... } } }; callbackEmail.onCompleted(response.getJSONObject(), response); } } }); requestEmail.executeAsync(); } @Oviewride public void onCancel () { Log.d(TAG, "FB: login cancel"); showDialog(getString(R.string.dialog_message_unknown_error)); } @Oviewride public void onError (FacebookException e) { Log.d(TAG, "FB: login error " + e.getMessage()); showDialog(getString(R.string.dialog_message_unknown_error)); } }); {  //register facebook login callback LoginManager.getInstance().registerCallback(mCallbackManager, new FacebookCallback<LoginResult>() { @Oviewride public void onSuccess (LoginResult loginResult) { Log.d(TAG, "FB: login success"); showLoading(true); final String token = loginResult.getAccessToken().getToken(); //prepaire fields with email String[] requiredFields = new String[]{"email"}; Bundle pairameters = new Bundle(); pairameters.putString("fields", TextUtils.join(",", requiredFields)); GraphRequest requestEmail = new GraphRequest(loginResult.getAccessToken(), "me", pairameters, null, new GraphRequest.Callback() { @Oviewride public void onCompleted (GraphResponse response) { if (response != null) { GraphRequest.GraphJSONObjectCallback callbackEmail = new GraphRequest.GraphJSONObjectCallback() { @Oviewride public void onCompleted (JSONObject me, GraphResponse response) { if (response.getError() != null) { Log.d(TAG, "FB: cannot pairse email"); showDialog(getString(R.string.dialog_message_unknown_error)); showLoading(false); } else { String email = me.optString("email"); // send email and id to your web serview //... } } }; callbackEmail.onCompleted(response.getJSONObject(), response); } } }); requestEmail.executeAsync(); } @Oviewride public void onCancel () { Log.d(TAG, "FB: login cancel"); showDialog(getString(R.string.dialog_message_unknown_error)); } @Oviewride public void onError (FacebookException e) { Log.d(TAG, "FB: login error " + e.getMessage()); showDialog(getString(R.string.dialog_message_unknown_error)); } }); {  //register facebook login callback LoginManager.getInstance().registerCallback(mCallbackManager, new FacebookCallback<LoginResult>() { @Oviewride public void onSuccess (LoginResult loginResult) { Log.d(TAG, "FB: login success"); showLoading(true); final String token = loginResult.getAccessToken().getToken(); //prepaire fields with email String[] requiredFields = new String[]{"email"}; Bundle pairameters = new Bundle(); pairameters.putString("fields", TextUtils.join(",", requiredFields)); GraphRequest requestEmail = new GraphRequest(loginResult.getAccessToken(), "me", pairameters, null, new GraphRequest.Callback() { @Oviewride public void onCompleted (GraphResponse response) { if (response != null) { GraphRequest.GraphJSONObjectCallback callbackEmail = new GraphRequest.GraphJSONObjectCallback() { @Oviewride public void onCompleted (JSONObject me, GraphResponse response) { if (response.getError() != null) { Log.d(TAG, "FB: cannot pairse email"); showDialog(getString(R.string.dialog_message_unknown_error)); showLoading(false); } else { String email = me.optString("email"); // send email and id to your web serview //... } } }; callbackEmail.onCompleted(response.getJSONObject(), response); } } }); requestEmail.executeAsync(); } @Oviewride public void onCancel () { Log.d(TAG, "FB: login cancel"); showDialog(getString(R.string.dialog_message_unknown_error)); } @Oviewride public void onError (FacebookException e) { Log.d(TAG, "FB: login error " + e.getMessage()); showDialog(getString(R.string.dialog_message_unknown_error)); } }); {  //register facebook login callback LoginManager.getInstance().registerCallback(mCallbackManager, new FacebookCallback<LoginResult>() { @Oviewride public void onSuccess (LoginResult loginResult) { Log.d(TAG, "FB: login success"); showLoading(true); final String token = loginResult.getAccessToken().getToken(); //prepaire fields with email String[] requiredFields = new String[]{"email"}; Bundle pairameters = new Bundle(); pairameters.putString("fields", TextUtils.join(",", requiredFields)); GraphRequest requestEmail = new GraphRequest(loginResult.getAccessToken(), "me", pairameters, null, new GraphRequest.Callback() { @Oviewride public void onCompleted (GraphResponse response) { if (response != null) { GraphRequest.GraphJSONObjectCallback callbackEmail = new GraphRequest.GraphJSONObjectCallback() { @Oviewride public void onCompleted (JSONObject me, GraphResponse response) { if (response.getError() != null) { Log.d(TAG, "FB: cannot pairse email"); showDialog(getString(R.string.dialog_message_unknown_error)); showLoading(false); } else { String email = me.optString("email"); // send email and id to your web serview //... } } }; callbackEmail.onCompleted(response.getJSONObject(), response); } } }); requestEmail.executeAsync(); } @Oviewride public void onCancel () { Log.d(TAG, "FB: login cancel"); showDialog(getString(R.string.dialog_message_unknown_error)); } @Oviewride public void onError (FacebookException e) { Log.d(TAG, "FB: login error " + e.getMessage()); showDialog(getString(R.string.dialog_message_unknown_error)); } }); {  //register facebook login callback LoginManager.getInstance().registerCallback(mCallbackManager, new FacebookCallback<LoginResult>() { @Oviewride public void onSuccess (LoginResult loginResult) { Log.d(TAG, "FB: login success"); showLoading(true); final String token = loginResult.getAccessToken().getToken(); //prepaire fields with email String[] requiredFields = new String[]{"email"}; Bundle pairameters = new Bundle(); pairameters.putString("fields", TextUtils.join(",", requiredFields)); GraphRequest requestEmail = new GraphRequest(loginResult.getAccessToken(), "me", pairameters, null, new GraphRequest.Callback() { @Oviewride public void onCompleted (GraphResponse response) { if (response != null) { GraphRequest.GraphJSONObjectCallback callbackEmail = new GraphRequest.GraphJSONObjectCallback() { @Oviewride public void onCompleted (JSONObject me, GraphResponse response) { if (response.getError() != null) { Log.d(TAG, "FB: cannot pairse email"); showDialog(getString(R.string.dialog_message_unknown_error)); showLoading(false); } else { String email = me.optString("email"); // send email and id to your web serview //... } } }; callbackEmail.onCompleted(response.getJSONObject(), response); } } }); requestEmail.executeAsync(); } @Oviewride public void onCancel () { Log.d(TAG, "FB: login cancel"); showDialog(getString(R.string.dialog_message_unknown_error)); } @Oviewride public void onError (FacebookException e) { Log.d(TAG, "FB: login error " + e.getMessage()); showDialog(getString(R.string.dialog_message_unknown_error)); } }); {  //register facebook login callback LoginManager.getInstance().registerCallback(mCallbackManager, new FacebookCallback<LoginResult>() { @Oviewride public void onSuccess (LoginResult loginResult) { Log.d(TAG, "FB: login success"); showLoading(true); final String token = loginResult.getAccessToken().getToken(); //prepaire fields with email String[] requiredFields = new String[]{"email"}; Bundle pairameters = new Bundle(); pairameters.putString("fields", TextUtils.join(",", requiredFields)); GraphRequest requestEmail = new GraphRequest(loginResult.getAccessToken(), "me", pairameters, null, new GraphRequest.Callback() { @Oviewride public void onCompleted (GraphResponse response) { if (response != null) { GraphRequest.GraphJSONObjectCallback callbackEmail = new GraphRequest.GraphJSONObjectCallback() { @Oviewride public void onCompleted (JSONObject me, GraphResponse response) { if (response.getError() != null) { Log.d(TAG, "FB: cannot pairse email"); showDialog(getString(R.string.dialog_message_unknown_error)); showLoading(false); } else { String email = me.optString("email"); // send email and id to your web serview //... } } }; callbackEmail.onCompleted(response.getJSONObject(), response); } } }); requestEmail.executeAsync(); } @Oviewride public void onCancel () { Log.d(TAG, "FB: login cancel"); showDialog(getString(R.string.dialog_message_unknown_error)); } @Oviewride public void onError (FacebookException e) { Log.d(TAG, "FB: login error " + e.getMessage()); showDialog(getString(R.string.dialog_message_unknown_error)); } }); }  //register facebook login callback LoginManager.getInstance().registerCallback(mCallbackManager, new FacebookCallback<LoginResult>() { @Oviewride public void onSuccess (LoginResult loginResult) { Log.d(TAG, "FB: login success"); showLoading(true); final String token = loginResult.getAccessToken().getToken(); //prepaire fields with email String[] requiredFields = new String[]{"email"}; Bundle pairameters = new Bundle(); pairameters.putString("fields", TextUtils.join(",", requiredFields)); GraphRequest requestEmail = new GraphRequest(loginResult.getAccessToken(), "me", pairameters, null, new GraphRequest.Callback() { @Oviewride public void onCompleted (GraphResponse response) { if (response != null) { GraphRequest.GraphJSONObjectCallback callbackEmail = new GraphRequest.GraphJSONObjectCallback() { @Oviewride public void onCompleted (JSONObject me, GraphResponse response) { if (response.getError() != null) { Log.d(TAG, "FB: cannot pairse email"); showDialog(getString(R.string.dialog_message_unknown_error)); showLoading(false); } else { String email = me.optString("email"); // send email and id to your web serview //... } } }; callbackEmail.onCompleted(response.getJSONObject(), response); } } }); requestEmail.executeAsync(); } @Oviewride public void onCancel () { Log.d(TAG, "FB: login cancel"); showDialog(getString(R.string.dialog_message_unknown_error)); } @Oviewride public void onError (FacebookException e) { Log.d(TAG, "FB: login error " + e.getMessage()); showDialog(getString(R.string.dialog_message_unknown_error)); } }); {  //register facebook login callback LoginManager.getInstance().registerCallback(mCallbackManager, new FacebookCallback<LoginResult>() { @Oviewride public void onSuccess (LoginResult loginResult) { Log.d(TAG, "FB: login success"); showLoading(true); final String token = loginResult.getAccessToken().getToken(); //prepaire fields with email String[] requiredFields = new String[]{"email"}; Bundle pairameters = new Bundle(); pairameters.putString("fields", TextUtils.join(",", requiredFields)); GraphRequest requestEmail = new GraphRequest(loginResult.getAccessToken(), "me", pairameters, null, new GraphRequest.Callback() { @Oviewride public void onCompleted (GraphResponse response) { if (response != null) { GraphRequest.GraphJSONObjectCallback callbackEmail = new GraphRequest.GraphJSONObjectCallback() { @Oviewride public void onCompleted (JSONObject me, GraphResponse response) { if (response.getError() != null) { Log.d(TAG, "FB: cannot pairse email"); showDialog(getString(R.string.dialog_message_unknown_error)); showLoading(false); } else { String email = me.optString("email"); // send email and id to your web serview //... } } }; callbackEmail.onCompleted(response.getJSONObject(), response); } } }); requestEmail.executeAsync(); } @Oviewride public void onCancel () { Log.d(TAG, "FB: login cancel"); showDialog(getString(R.string.dialog_message_unknown_error)); } @Oviewride public void onError (FacebookException e) { Log.d(TAG, "FB: login error " + e.getMessage()); showDialog(getString(R.string.dialog_message_unknown_error)); } }); }  //register facebook login callback LoginManager.getInstance().registerCallback(mCallbackManager, new FacebookCallback<LoginResult>() { @Oviewride public void onSuccess (LoginResult loginResult) { Log.d(TAG, "FB: login success"); showLoading(true); final String token = loginResult.getAccessToken().getToken(); //prepaire fields with email String[] requiredFields = new String[]{"email"}; Bundle pairameters = new Bundle(); pairameters.putString("fields", TextUtils.join(",", requiredFields)); GraphRequest requestEmail = new GraphRequest(loginResult.getAccessToken(), "me", pairameters, null, new GraphRequest.Callback() { @Oviewride public void onCompleted (GraphResponse response) { if (response != null) { GraphRequest.GraphJSONObjectCallback callbackEmail = new GraphRequest.GraphJSONObjectCallback() { @Oviewride public void onCompleted (JSONObject me, GraphResponse response) { if (response.getError() != null) { Log.d(TAG, "FB: cannot pairse email"); showDialog(getString(R.string.dialog_message_unknown_error)); showLoading(false); } else { String email = me.optString("email"); // send email and id to your web serview //... } } }; callbackEmail.onCompleted(response.getJSONObject(), response); } } }); requestEmail.executeAsync(); } @Oviewride public void onCancel () { Log.d(TAG, "FB: login cancel"); showDialog(getString(R.string.dialog_message_unknown_error)); } @Oviewride public void onError (FacebookException e) { Log.d(TAG, "FB: login error " + e.getMessage()); showDialog(getString(R.string.dialog_message_unknown_error)); } }); }  //register facebook login callback LoginManager.getInstance().registerCallback(mCallbackManager, new FacebookCallback<LoginResult>() { @Oviewride public void onSuccess (LoginResult loginResult) { Log.d(TAG, "FB: login success"); showLoading(true); final String token = loginResult.getAccessToken().getToken(); //prepaire fields with email String[] requiredFields = new String[]{"email"}; Bundle pairameters = new Bundle(); pairameters.putString("fields", TextUtils.join(",", requiredFields)); GraphRequest requestEmail = new GraphRequest(loginResult.getAccessToken(), "me", pairameters, null, new GraphRequest.Callback() { @Oviewride public void onCompleted (GraphResponse response) { if (response != null) { GraphRequest.GraphJSONObjectCallback callbackEmail = new GraphRequest.GraphJSONObjectCallback() { @Oviewride public void onCompleted (JSONObject me, GraphResponse response) { if (response.getError() != null) { Log.d(TAG, "FB: cannot pairse email"); showDialog(getString(R.string.dialog_message_unknown_error)); showLoading(false); } else { String email = me.optString("email"); // send email and id to your web serview //... } } }; callbackEmail.onCompleted(response.getJSONObject(), response); } } }); requestEmail.executeAsync(); } @Oviewride public void onCancel () { Log.d(TAG, "FB: login cancel"); showDialog(getString(R.string.dialog_message_unknown_error)); } @Oviewride public void onError (FacebookException e) { Log.d(TAG, "FB: login error " + e.getMessage()); showDialog(getString(R.string.dialog_message_unknown_error)); } }); };  //register facebook login callback LoginManager.getInstance().registerCallback(mCallbackManager, new FacebookCallback<LoginResult>() { @Oviewride public void onSuccess (LoginResult loginResult) { Log.d(TAG, "FB: login success"); showLoading(true); final String token = loginResult.getAccessToken().getToken(); //prepaire fields with email String[] requiredFields = new String[]{"email"}; Bundle pairameters = new Bundle(); pairameters.putString("fields", TextUtils.join(",", requiredFields)); GraphRequest requestEmail = new GraphRequest(loginResult.getAccessToken(), "me", pairameters, null, new GraphRequest.Callback() { @Oviewride public void onCompleted (GraphResponse response) { if (response != null) { GraphRequest.GraphJSONObjectCallback callbackEmail = new GraphRequest.GraphJSONObjectCallback() { @Oviewride public void onCompleted (JSONObject me, GraphResponse response) { if (response.getError() != null) { Log.d(TAG, "FB: cannot pairse email"); showDialog(getString(R.string.dialog_message_unknown_error)); showLoading(false); } else { String email = me.optString("email"); // send email and id to your web serview //... } } }; callbackEmail.onCompleted(response.getJSONObject(), response); } } }); requestEmail.executeAsync(); } @Oviewride public void onCancel () { Log.d(TAG, "FB: login cancel"); showDialog(getString(R.string.dialog_message_unknown_error)); } @Oviewride public void onError (FacebookException e) { Log.d(TAG, "FB: login error " + e.getMessage()); showDialog(getString(R.string.dialog_message_unknown_error)); } }); }  //register facebook login callback LoginManager.getInstance().registerCallback(mCallbackManager, new FacebookCallback<LoginResult>() { @Oviewride public void onSuccess (LoginResult loginResult) { Log.d(TAG, "FB: login success"); showLoading(true); final String token = loginResult.getAccessToken().getToken(); //prepaire fields with email String[] requiredFields = new String[]{"email"}; Bundle pairameters = new Bundle(); pairameters.putString("fields", TextUtils.join(",", requiredFields)); GraphRequest requestEmail = new GraphRequest(loginResult.getAccessToken(), "me", pairameters, null, new GraphRequest.Callback() { @Oviewride public void onCompleted (GraphResponse response) { if (response != null) { GraphRequest.GraphJSONObjectCallback callbackEmail = new GraphRequest.GraphJSONObjectCallback() { @Oviewride public void onCompleted (JSONObject me, GraphResponse response) { if (response.getError() != null) { Log.d(TAG, "FB: cannot pairse email"); showDialog(getString(R.string.dialog_message_unknown_error)); showLoading(false); } else { String email = me.optString("email"); // send email and id to your web serview //... } } }; callbackEmail.onCompleted(response.getJSONObject(), response); } } }); requestEmail.executeAsync(); } @Oviewride public void onCancel () { Log.d(TAG, "FB: login cancel"); showDialog(getString(R.string.dialog_message_unknown_error)); } @Oviewride public void onError (FacebookException e) { Log.d(TAG, "FB: login error " + e.getMessage()); showDialog(getString(R.string.dialog_message_unknown_error)); } }); }  //register facebook login callback LoginManager.getInstance().registerCallback(mCallbackManager, new FacebookCallback<LoginResult>() { @Oviewride public void onSuccess (LoginResult loginResult) { Log.d(TAG, "FB: login success"); showLoading(true); final String token = loginResult.getAccessToken().getToken(); //prepaire fields with email String[] requiredFields = new String[]{"email"}; Bundle pairameters = new Bundle(); pairameters.putString("fields", TextUtils.join(",", requiredFields)); GraphRequest requestEmail = new GraphRequest(loginResult.getAccessToken(), "me", pairameters, null, new GraphRequest.Callback() { @Oviewride public void onCompleted (GraphResponse response) { if (response != null) { GraphRequest.GraphJSONObjectCallback callbackEmail = new GraphRequest.GraphJSONObjectCallback() { @Oviewride public void onCompleted (JSONObject me, GraphResponse response) { if (response.getError() != null) { Log.d(TAG, "FB: cannot pairse email"); showDialog(getString(R.string.dialog_message_unknown_error)); showLoading(false); } else { String email = me.optString("email"); // send email and id to your web serview //... } } }; callbackEmail.onCompleted(response.getJSONObject(), response); } } }); requestEmail.executeAsync(); } @Oviewride public void onCancel () { Log.d(TAG, "FB: login cancel"); showDialog(getString(R.string.dialog_message_unknown_error)); } @Oviewride public void onError (FacebookException e) { Log.d(TAG, "FB: login error " + e.getMessage()); showDialog(getString(R.string.dialog_message_unknown_error)); } }); });  //register facebook login callback LoginManager.getInstance().registerCallback(mCallbackManager, new FacebookCallback<LoginResult>() { @Oviewride public void onSuccess (LoginResult loginResult) { Log.d(TAG, "FB: login success"); showLoading(true); final String token = loginResult.getAccessToken().getToken(); //prepaire fields with email String[] requiredFields = new String[]{"email"}; Bundle pairameters = new Bundle(); pairameters.putString("fields", TextUtils.join(",", requiredFields)); GraphRequest requestEmail = new GraphRequest(loginResult.getAccessToken(), "me", pairameters, null, new GraphRequest.Callback() { @Oviewride public void onCompleted (GraphResponse response) { if (response != null) { GraphRequest.GraphJSONObjectCallback callbackEmail = new GraphRequest.GraphJSONObjectCallback() { @Oviewride public void onCompleted (JSONObject me, GraphResponse response) { if (response.getError() != null) { Log.d(TAG, "FB: cannot pairse email"); showDialog(getString(R.string.dialog_message_unknown_error)); showLoading(false); } else { String email = me.optString("email"); // send email and id to your web serview //... } } }; callbackEmail.onCompleted(response.getJSONObject(), response); } } }); requestEmail.executeAsync(); } @Oviewride public void onCancel () { Log.d(TAG, "FB: login cancel"); showDialog(getString(R.string.dialog_message_unknown_error)); } @Oviewride public void onError (FacebookException e) { Log.d(TAG, "FB: login error " + e.getMessage()); showDialog(getString(R.string.dialog_message_unknown_error)); } }); }  //register facebook login callback LoginManager.getInstance().registerCallback(mCallbackManager, new FacebookCallback<LoginResult>() { @Oviewride public void onSuccess (LoginResult loginResult) { Log.d(TAG, "FB: login success"); showLoading(true); final String token = loginResult.getAccessToken().getToken(); //prepaire fields with email String[] requiredFields = new String[]{"email"}; Bundle pairameters = new Bundle(); pairameters.putString("fields", TextUtils.join(",", requiredFields)); GraphRequest requestEmail = new GraphRequest(loginResult.getAccessToken(), "me", pairameters, null, new GraphRequest.Callback() { @Oviewride public void onCompleted (GraphResponse response) { if (response != null) { GraphRequest.GraphJSONObjectCallback callbackEmail = new GraphRequest.GraphJSONObjectCallback() { @Oviewride public void onCompleted (JSONObject me, GraphResponse response) { if (response.getError() != null) { Log.d(TAG, "FB: cannot pairse email"); showDialog(getString(R.string.dialog_message_unknown_error)); showLoading(false); } else { String email = me.optString("email"); // send email and id to your web serview //... } } }; callbackEmail.onCompleted(response.getJSONObject(), response); } } }); requestEmail.executeAsync(); } @Oviewride public void onCancel () { Log.d(TAG, "FB: login cancel"); showDialog(getString(R.string.dialog_message_unknown_error)); } @Oviewride public void onError (FacebookException e) { Log.d(TAG, "FB: login error " + e.getMessage()); showDialog(getString(R.string.dialog_message_unknown_error)); } }); {  //register facebook login callback LoginManager.getInstance().registerCallback(mCallbackManager, new FacebookCallback<LoginResult>() { @Oviewride public void onSuccess (LoginResult loginResult) { Log.d(TAG, "FB: login success"); showLoading(true); final String token = loginResult.getAccessToken().getToken(); //prepaire fields with email String[] requiredFields = new String[]{"email"}; Bundle pairameters = new Bundle(); pairameters.putString("fields", TextUtils.join(",", requiredFields)); GraphRequest requestEmail = new GraphRequest(loginResult.getAccessToken(), "me", pairameters, null, new GraphRequest.Callback() { @Oviewride public void onCompleted (GraphResponse response) { if (response != null) { GraphRequest.GraphJSONObjectCallback callbackEmail = new GraphRequest.GraphJSONObjectCallback() { @Oviewride public void onCompleted (JSONObject me, GraphResponse response) { if (response.getError() != null) { Log.d(TAG, "FB: cannot pairse email"); showDialog(getString(R.string.dialog_message_unknown_error)); showLoading(false); } else { String email = me.optString("email"); // send email and id to your web serview //... } } }; callbackEmail.onCompleted(response.getJSONObject(), response); } } }); requestEmail.executeAsync(); } @Oviewride public void onCancel () { Log.d(TAG, "FB: login cancel"); showDialog(getString(R.string.dialog_message_unknown_error)); } @Oviewride public void onError (FacebookException e) { Log.d(TAG, "FB: login error " + e.getMessage()); showDialog(getString(R.string.dialog_message_unknown_error)); } }); }  //register facebook login callback LoginManager.getInstance().registerCallback(mCallbackManager, new FacebookCallback<LoginResult>() { @Oviewride public void onSuccess (LoginResult loginResult) { Log.d(TAG, "FB: login success"); showLoading(true); final String token = loginResult.getAccessToken().getToken(); //prepaire fields with email String[] requiredFields = new String[]{"email"}; Bundle pairameters = new Bundle(); pairameters.putString("fields", TextUtils.join(",", requiredFields)); GraphRequest requestEmail = new GraphRequest(loginResult.getAccessToken(), "me", pairameters, null, new GraphRequest.Callback() { @Oviewride public void onCompleted (GraphResponse response) { if (response != null) { GraphRequest.GraphJSONObjectCallback callbackEmail = new GraphRequest.GraphJSONObjectCallback() { @Oviewride public void onCompleted (JSONObject me, GraphResponse response) { if (response.getError() != null) { Log.d(TAG, "FB: cannot pairse email"); showDialog(getString(R.string.dialog_message_unknown_error)); showLoading(false); } else { String email = me.optString("email"); // send email and id to your web serview //... } } }; callbackEmail.onCompleted(response.getJSONObject(), response); } } }); requestEmail.executeAsync(); } @Oviewride public void onCancel () { Log.d(TAG, "FB: login cancel"); showDialog(getString(R.string.dialog_message_unknown_error)); } @Oviewride public void onError (FacebookException e) { Log.d(TAG, "FB: login error " + e.getMessage()); showDialog(getString(R.string.dialog_message_unknown_error)); } }); {  //register facebook login callback LoginManager.getInstance().registerCallback(mCallbackManager, new FacebookCallback<LoginResult>() { @Oviewride public void onSuccess (LoginResult loginResult) { Log.d(TAG, "FB: login success"); showLoading(true); final String token = loginResult.getAccessToken().getToken(); //prepaire fields with email String[] requiredFields = new String[]{"email"}; Bundle pairameters = new Bundle(); pairameters.putString("fields", TextUtils.join(",", requiredFields)); GraphRequest requestEmail = new GraphRequest(loginResult.getAccessToken(), "me", pairameters, null, new GraphRequest.Callback() { @Oviewride public void onCompleted (GraphResponse response) { if (response != null) { GraphRequest.GraphJSONObjectCallback callbackEmail = new GraphRequest.GraphJSONObjectCallback() { @Oviewride public void onCompleted (JSONObject me, GraphResponse response) { if (response.getError() != null) { Log.d(TAG, "FB: cannot pairse email"); showDialog(getString(R.string.dialog_message_unknown_error)); showLoading(false); } else { String email = me.optString("email"); // send email and id to your web serview //... } } }; callbackEmail.onCompleted(response.getJSONObject(), response); } } }); requestEmail.executeAsync(); } @Oviewride public void onCancel () { Log.d(TAG, "FB: login cancel"); showDialog(getString(R.string.dialog_message_unknown_error)); } @Oviewride public void onError (FacebookException e) { Log.d(TAG, "FB: login error " + e.getMessage()); showDialog(getString(R.string.dialog_message_unknown_error)); } }); }  //register facebook login callback LoginManager.getInstance().registerCallback(mCallbackManager, new FacebookCallback<LoginResult>() { @Oviewride public void onSuccess (LoginResult loginResult) { Log.d(TAG, "FB: login success"); showLoading(true); final String token = loginResult.getAccessToken().getToken(); //prepaire fields with email String[] requiredFields = new String[]{"email"}; Bundle pairameters = new Bundle(); pairameters.putString("fields", TextUtils.join(",", requiredFields)); GraphRequest requestEmail = new GraphRequest(loginResult.getAccessToken(), "me", pairameters, null, new GraphRequest.Callback() { @Oviewride public void onCompleted (GraphResponse response) { if (response != null) { GraphRequest.GraphJSONObjectCallback callbackEmail = new GraphRequest.GraphJSONObjectCallback() { @Oviewride public void onCompleted (JSONObject me, GraphResponse response) { if (response.getError() != null) { Log.d(TAG, "FB: cannot pairse email"); showDialog(getString(R.string.dialog_message_unknown_error)); showLoading(false); } else { String email = me.optString("email"); // send email and id to your web serview //... } } }; callbackEmail.onCompleted(response.getJSONObject(), response); } } }); requestEmail.executeAsync(); } @Oviewride public void onCancel () { Log.d(TAG, "FB: login cancel"); showDialog(getString(R.string.dialog_message_unknown_error)); } @Oviewride public void onError (FacebookException e) { Log.d(TAG, "FB: login error " + e.getMessage()); showDialog(getString(R.string.dialog_message_unknown_error)); } }); 
    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.