Example usage for android.util Log wtf

List of usage examples for android.util Log wtf

Introduction

In this page you can find the example usage for android.util Log wtf.

Prototype

public static int wtf(String tag, Throwable tr) 

Source Link

Document

What a Terrible Failure: Report an exception that should never happen.

Usage

From source file:com.skalski.websocketsclient.ActivityMain.java

@Override
public void onRawTextMessage(byte[] payload) {
    Log.wtf(TAG_LOG, "We didn't expect 'RawTextMessage'");
}

From source file:com.skalski.websocketsclient.ActivityMain.java

@Override
public void onBinaryMessage(byte[] payload) {
    Log.wtf(TAG_LOG, "We didn't expect 'BinaryMessage'");
}

From source file:com.thelastcrusade.soundstream.CoreActivity.java

private void cleanUpAfterDisconnect() {
    final ServiceLocator<PlaylistService> playlistServiceLocator = new ServiceLocator<PlaylistService>(this,
            PlaylistService.class, PlaylistServiceBinder.class);

    playlistServiceLocator.setOnBindListener(new ServiceLocator.IOnBindListener() {
        @Override//w  w  w  .j ava 2  s. c  o m
        public void onServiceBound() {
            try {
                playlistServiceLocator.getService().clearPlaylist();
                //this is the only place where we bind and use the service, so we unbind as soon as we are done
                playlistServiceLocator.unbind();
            } catch (ServiceNotBoundException e) {
                Log.wtf(TAG, "PlaylistService not bound");
            }
        }
    });

    final ServiceLocator<MusicLibraryService> musicLibraryServiceLocator = new ServiceLocator<MusicLibraryService>(
            this, MusicLibraryService.class, MusicLibraryServiceBinder.class);

    musicLibraryServiceLocator.setOnBindListener(new ServiceLocator.IOnBindListener() {
        @Override
        public void onServiceBound() {
            try {
                musicLibraryServiceLocator.getService().clearExternalMusic();
                //this is the only place where we bind and use the service, so we unbind as soon as we are done
                musicLibraryServiceLocator.unbind();
            } catch (ServiceNotBoundException e) {
                Log.wtf(TAG, "MusicLibraryService not bound");
            }
        }
    });

    final ServiceLocator<UserListService> userListServiceLocator = new ServiceLocator<UserListService>(this,
            UserListService.class, UserListServiceBinder.class);

    userListServiceLocator.setOnBindListener(new ServiceLocator.IOnBindListener() {
        @Override
        public void onServiceBound() {
            try {
                userListServiceLocator.getService().clearExternalUsers();
                //this is the only place where we bind and use the service, so we unbind as soon as we are done
                userListServiceLocator.unbind();
            } catch (ServiceNotBoundException e) {
                Log.wtf(TAG, "MusicLibraryService not bound");
            }
        }
    });
}

From source file:com.granita.icloudcalsync.resource.Contact.java

@Override
public ByteArrayOutputStream toEntity() throws IOException {
    VCard vcard = null;/*w  ww  .  ja v  a  2s  . c  om*/
    try {
        if (unknownProperties != null)
            vcard = Ezvcard.parse(unknownProperties).first();
    } catch (Exception e) {
        Log.w(TAG, "Couldn't parse original property set, beginning from scratch");
    }
    if (vcard == null)
        vcard = new VCard();

    if (uid != null)
        vcard.setUid(new Uid(uid));
    else
        Log.wtf(TAG, "Generating VCard without UID");

    if (starred)
        vcard.setExtendedProperty(PROPERTY_STARRED, "1");

    if (displayName != null)
        vcard.setFormattedName(displayName);
    else if (organization != null && organization.getValues() != null
            && organization.getValues().get(0) != null)
        vcard.setFormattedName(organization.getValues().get(0));
    else
        Log.w(TAG, "No FN (formatted name) available to generate VCard");

    // N
    if (prefix != null || familyName != null || middleName != null || givenName != null || suffix != null) {
        StructuredName n = new StructuredName();
        if (prefix != null)
            for (String p : StringUtils.split(prefix))
                n.addPrefix(p);
        n.setGiven(givenName);
        if (middleName != null)
            for (String middle : StringUtils.split(middleName))
                n.addAdditional(middle);
        n.setFamily(familyName);
        if (suffix != null)
            for (String s : StringUtils.split(suffix))
                n.addSuffix(s);
        vcard.setStructuredName(n);
    }

    // phonetic names
    if (phoneticGivenName != null)
        vcard.addExtendedProperty(PROPERTY_PHONETIC_FIRST_NAME, phoneticGivenName);
    if (phoneticMiddleName != null)
        vcard.addExtendedProperty(PROPERTY_PHONETIC_MIDDLE_NAME, phoneticMiddleName);
    if (phoneticFamilyName != null)
        vcard.addExtendedProperty(PROPERTY_PHONETIC_LAST_NAME, phoneticFamilyName);

    // TEL
    for (Telephone phoneNumber : phoneNumbers)
        vcard.addTelephoneNumber(phoneNumber);

    // EMAIL
    for (Email email : emails)
        vcard.addEmail(email);

    // ORG, TITLE, ROLE
    if (organization != null)
        vcard.setOrganization(organization);
    if (jobTitle != null)
        vcard.addTitle(jobTitle);
    if (jobDescription != null)
        vcard.addRole(jobDescription);

    // IMPP
    for (Impp impp : impps)
        vcard.addImpp(impp);

    // NICKNAME
    if (!StringUtils.isBlank(nickName))
        vcard.setNickname(nickName);

    // NOTE
    if (!StringUtils.isBlank(note))
        vcard.addNote(note);

    // ADR
    for (Address address : addresses)
        vcard.addAddress(address);

    // CATEGORY
    if (!categories.isEmpty())
        vcard.setCategories(categories.toArray(new String[0]));

    // URL
    for (String url : URLs)
        vcard.addUrl(url);

    // ANNIVERSARY
    if (anniversary != null)
        vcard.setAnniversary(anniversary);
    // BDAY
    if (birthDay != null)
        vcard.setBirthday(birthDay);

    // PHOTO
    if (photo != null)
        vcard.addPhoto(new Photo(photo, ImageType.JPEG));

    // REL
    for (Related related : relations)
        vcard.addRelated(related);

    // PRODID, REV
    vcard.setProductId("DAVdroid/" + Constants.APP_VERSION + " (ez-vcard/" + Ezvcard.VERSION + ")");
    vcard.setRevision(Revision.now());

    // validate and print warnings
    ValidationWarnings warnings = vcard.validate(vCardVersion);
    if (!warnings.isEmpty())
        Log.w(TAG, "Created potentially invalid VCard:\n" + warnings);

    ByteArrayOutputStream os = new ByteArrayOutputStream();
    Ezvcard.write(vcard).version(vCardVersion).versionStrict(false).prodId(false) // we provide our own PRODID
            .go(os);
    return os;
}

From source file:at.bitfire.davdroid.resource.Contact.java

@Override
public ByteArrayOutputStream toEntity() throws IOException {
    VCard vcard = null;/*w  w  w .  j  a va2 s .  co  m*/
    try {
        if (unknownProperties != null)
            vcard = Ezvcard.parse(unknownProperties).first();
    } catch (Exception e) {
        Log.w(TAG, "Couldn't parse original property set, beginning from scratch");
    }
    if (vcard == null)
        vcard = new VCard();

    if (uid != null)
        vcard.setUid(new Uid(uid));
    else
        Log.wtf(TAG, "Generating VCard without UID");

    if (starred)
        vcard.setExtendedProperty(PROPERTY_STARRED, "1");

    if (displayName != null)
        vcard.setFormattedName(displayName);
    else if (organization != null && organization.getValues() != null
            && organization.getValues().get(0) != null)
        vcard.setFormattedName(organization.getValues().get(0));
    else
        Log.w(TAG, "No FN (formatted name) available to generate VCard");

    // N
    if (prefix != null || familyName != null || middleName != null || givenName != null || suffix != null) {
        StructuredName n = new StructuredName();
        if (prefix != null)
            for (String p : StringUtils.split(prefix))
                n.addPrefix(p);
        n.setGiven(givenName);
        if (middleName != null)
            for (String middle : StringUtils.split(middleName))
                n.addAdditional(middle);
        n.setFamily(familyName);
        if (suffix != null)
            for (String s : StringUtils.split(suffix))
                n.addSuffix(s);
        vcard.setStructuredName(n);
    }

    // phonetic names
    if (phoneticGivenName != null)
        vcard.addExtendedProperty(PROPERTY_PHONETIC_FIRST_NAME, phoneticGivenName);
    if (phoneticMiddleName != null)
        vcard.addExtendedProperty(PROPERTY_PHONETIC_MIDDLE_NAME, phoneticMiddleName);
    if (phoneticFamilyName != null)
        vcard.addExtendedProperty(PROPERTY_PHONETIC_LAST_NAME, phoneticFamilyName);

    // TEL
    for (Telephone phoneNumber : phoneNumbers)
        vcard.addTelephoneNumber(phoneNumber);

    // EMAIL
    for (Email email : emails)
        vcard.addEmail(email);

    // ORG, TITLE, ROLE
    if (organization != null)
        vcard.setOrganization(organization);
    if (jobTitle != null)
        vcard.addTitle(jobTitle);
    if (jobDescription != null)
        vcard.addRole(jobDescription);

    // IMPP
    for (Impp impp : impps)
        vcard.addImpp(impp);

    // NICKNAME
    if (!StringUtils.isBlank(nickName))
        vcard.setNickname(nickName);

    // NOTE
    if (!StringUtils.isBlank(note))
        vcard.addNote(note);

    // ADR
    for (Address address : addresses)
        vcard.addAddress(address);

    // CATEGORY
    if (!categories.isEmpty())
        vcard.setCategories(categories.toArray(new String[categories.size()]));

    // URL
    for (String url : URLs)
        vcard.addUrl(url);

    // ANNIVERSARY
    if (anniversary != null)
        vcard.setAnniversary(anniversary);
    // BDAY
    if (birthDay != null)
        vcard.setBirthday(birthDay);

    // PHOTO
    if (photo != null)
        vcard.addPhoto(new Photo(photo, ImageType.JPEG));

    // REL
    for (Related related : relations)
        vcard.addRelated(related);

    // PRODID, REV
    vcard.setProductId("DAVdroid/" + Constants.APP_VERSION + " (ez-vcard/" + Ezvcard.VERSION + ")");
    vcard.setRevision(Revision.now());

    // validate and print warnings
    ValidationWarnings warnings = vcard.validate(vCardVersion);
    if (!warnings.isEmpty())
        Log.w(TAG, "Created potentially invalid VCard:\n" + warnings);

    ByteArrayOutputStream os = new ByteArrayOutputStream();
    Ezvcard.write(vcard).version(vCardVersion).versionStrict(false).prodId(false) // we provide our own PRODID
            .go(os);
    return os;
}

From source file:org.exfio.weavedroid.resource.Contact.java

protected VCard toVCardObject() {
    VCard vcard = null;// ww w.  j a  v  a2s.  com
    try {
        if (unknownProperties != null)
            vcard = Ezvcard.parse(unknownProperties).first();
    } catch (Exception e) {
        Log.w(TAG, "Couldn't parse original property set, beginning from scratch");
    }
    if (vcard == null)
        vcard = new VCard();

    if (uid != null)
        vcard.setUid(new Uid(uid));
    else
        Log.wtf(TAG, "Generating VCard without UID");

    if (starred)
        vcard.setExtendedProperty(PROPERTY_STARRED, "1");

    if (displayName != null)
        vcard.setFormattedName(displayName);
    else if (organization != null && organization.getValues() != null
            && organization.getValues().get(0) != null)
        vcard.setFormattedName(organization.getValues().get(0));
    else
        Log.w(TAG, "No FN (formatted name) available to generate VCard");

    // N
    if (familyName != null || middleName != null || givenName != null) {
        StructuredName n = new StructuredName();
        if (prefix != null)
            for (String p : StringUtils.split(prefix))
                n.addPrefix(p);
        n.setGiven(givenName);
        if (middleName != null)
            for (String middle : StringUtils.split(middleName))
                n.addAdditional(middle);
        n.setFamily(familyName);
        if (suffix != null)
            for (String s : StringUtils.split(suffix))
                n.addSuffix(s);
        vcard.setStructuredName(n);
    }

    // phonetic names
    if (phoneticGivenName != null)
        vcard.addExtendedProperty(PROPERTY_PHONETIC_FIRST_NAME, phoneticGivenName);
    if (phoneticMiddleName != null)
        vcard.addExtendedProperty(PROPERTY_PHONETIC_MIDDLE_NAME, phoneticMiddleName);
    if (phoneticFamilyName != null)
        vcard.addExtendedProperty(PROPERTY_PHONETIC_LAST_NAME, phoneticFamilyName);

    // TEL
    for (Telephone phoneNumber : phoneNumbers)
        vcard.addTelephoneNumber(phoneNumber);

    // EMAIL
    for (Email email : emails)
        vcard.addEmail(email);

    // ORG, TITLE, ROLE
    if (organization != null)
        vcard.setOrganization(organization);
    if (jobTitle != null)
        vcard.addTitle(jobTitle);
    if (jobDescription != null)
        vcard.addRole(jobDescription);

    // IMPP
    for (Impp impp : impps)
        vcard.addImpp(impp);

    // NICKNAME
    if (!StringUtils.isBlank(nickName))
        vcard.setNickname(nickName);

    // NOTE
    if (!StringUtils.isBlank(note))
        vcard.addNote(note);

    // ADR
    for (Address address : addresses)
        vcard.addAddress(address);

    // URL
    for (String url : URLs)
        vcard.addUrl(url);

    // ANNIVERSARY
    if (anniversary != null)
        vcard.setAnniversary(anniversary);
    // BDAY
    if (birthDay != null)
        vcard.setBirthday(birthDay);

    // PHOTO
    if (photo != null)
        vcard.addPhoto(new Photo(photo, ImageType.JPEG));

    // PRODID, REV
    vcard.setProdId("WeaveDroid/" + Constants.APP_VERSION + " (ez-vcard/" + Ezvcard.VERSION + ")");
    vcard.setRevision(Revision.now());

    return vcard;
}

From source file:com.pepperonas.truthordare.MainActivity.java

/**
 * Showing the current app-state in the NavigationView's header
 *///  www .  ja v  a 2s .  c o  m
public void setNavigationViewSubtitle(String navViewSubtitle) {
    if (navViewSubTitle == null) {
        Log.e(TAG, "setNavigationViewSubtitle?");
        navViewSubTitle = (TextView) findViewById(R.id.nav_view_header_subtitle);
    }
    if (navViewSubTitle != null) {
        navViewSubTitle.setText(navViewSubtitle);
    } else
        Log.wtf(TAG, "setNavigationViewSubtitle WTF");
}

From source file:org.exfio.csyncdroid.resource.Contact.java

protected VCard toVCardObject() {
    VCard vcard = null;/*  ww  w  . ja  v a 2  s .  c  om*/
    try {
        if (unknownProperties != null)
            vcard = Ezvcard.parse(unknownProperties).first();
    } catch (Exception e) {
        Log.w(TAG, "Couldn't parse original property set, beginning from scratch");
    }
    if (vcard == null)
        vcard = new VCard();

    if (uid != null)
        vcard.setUid(new Uid(uid));
    else
        Log.wtf(TAG, "Generating VCard without UID");

    if (starred)
        vcard.setExtendedProperty(PROPERTY_STARRED, "1");

    if (displayName != null)
        vcard.setFormattedName(displayName);
    else if (organization != null && organization.getValues() != null
            && organization.getValues().get(0) != null)
        vcard.setFormattedName(organization.getValues().get(0));
    else
        Log.w(TAG, "No FN (formatted name) available to generate VCard");

    // N
    if (familyName != null || middleName != null || givenName != null) {
        StructuredName n = new StructuredName();
        if (prefix != null)
            for (String p : StringUtils.split(prefix))
                n.addPrefix(p);
        n.setGiven(givenName);
        if (middleName != null)
            for (String middle : StringUtils.split(middleName))
                n.addAdditional(middle);
        n.setFamily(familyName);
        if (suffix != null)
            for (String s : StringUtils.split(suffix))
                n.addSuffix(s);
        vcard.setStructuredName(n);
    }

    // phonetic names
    if (phoneticGivenName != null)
        vcard.addExtendedProperty(PROPERTY_PHONETIC_FIRST_NAME, phoneticGivenName);
    if (phoneticMiddleName != null)
        vcard.addExtendedProperty(PROPERTY_PHONETIC_MIDDLE_NAME, phoneticMiddleName);
    if (phoneticFamilyName != null)
        vcard.addExtendedProperty(PROPERTY_PHONETIC_LAST_NAME, phoneticFamilyName);

    // TEL
    for (Telephone phoneNumber : phoneNumbers)
        vcard.addTelephoneNumber(phoneNumber);

    // EMAIL
    for (Email email : emails)
        vcard.addEmail(email);

    // ORG, TITLE, ROLE
    if (organization != null)
        vcard.setOrganization(organization);
    if (jobTitle != null)
        vcard.addTitle(jobTitle);
    if (jobDescription != null)
        vcard.addRole(jobDescription);

    // IMPP
    for (Impp impp : impps)
        vcard.addImpp(impp);

    // NICKNAME
    if (!StringUtils.isBlank(nickName))
        vcard.setNickname(nickName);

    // NOTE
    if (!StringUtils.isBlank(note))
        vcard.addNote(note);

    // ADR
    for (Address address : addresses)
        vcard.addAddress(address);

    // URL
    for (String url : URLs)
        vcard.addUrl(url);

    // ANNIVERSARY
    if (anniversary != null)
        vcard.setAnniversary(anniversary);
    // BDAY
    if (birthDay != null)
        vcard.setBirthday(birthDay);

    // PHOTO
    if (photo != null)
        vcard.addPhoto(new Photo(photo, ImageType.JPEG));

    // PRODID, REV
    vcard.setProductId("CucumberSync/" + Constants.APP_VERSION + " (ez-vcard/" + Ezvcard.VERSION + ")");
    vcard.setRevision(Revision.now());

    return vcard;
}

From source file:de.elanev.studip.android.app.frontend.messages.MessageComposeFragment.java

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
    case android.R.id.home:
        getActivity().onBackPressed();/*from ww w.j a va  2  s  .c  o  m*/
        return true;

    case R.id.send_icon:
        // Check if all fields are filled
        UserItem user = (UserItem) mAutoCompleteTextView.getTag();
        if (user == null || TextUtils.isEmpty(mAutoCompleteTextView.getText())) {

            Toast.makeText(mContext, R.string.please_choose_receiver, Toast.LENGTH_LONG).show();
            mAutoCompleteTextView.requestFocus();

        } else if (TextUtils.isEmpty(mSubjectEditTextView.getText())) {

            Toast.makeText(mContext, R.string.please_enter_subject, Toast.LENGTH_LONG).show();
            mSubjectEditTextView.requestFocus();

        } else if (TextUtils.isEmpty(mMessageEditTextView.getText())) {

            Toast.makeText(mContext, R.string.please_enter_message, Toast.LENGTH_LONG).show();
            mMessageEditTextView.requestFocus();

        } else {

            mSendButtonVisible = false;
            getActivity().supportInvalidateOptionsMenu();

            String apiUrl = Prefs.getInstance(mContext).getServer().getApiUrl();
            String messagesUrl = String.format(getString(R.string.restip_messages), apiUrl);

            // Create Jackson HTTP post request
            JacksonRequest<Message> request = new JacksonRequest<Message>(messagesUrl, Message.class, null,
                    new Listener<Message>() {

                        public void onResponse(Message response) {

                            if (getActivity() != null) {
                                getActivity().finish();

                                Toast.makeText(mContext, getString(R.string.message_sent), Toast.LENGTH_SHORT)
                                        .show();
                            }

                        }
                    }, new ErrorListener() {
                        /*
                         * (non-Javadoc)
                         *
                         * @see com.android.volley.Response. ErrorListener
                         * #onErrorResponse(com .android.volley.
                         * VolleyError)
                         */
                        public void onErrorResponse(VolleyError error) {

                            if (getActivity() != null) {
                                mSendButtonVisible = true;
                                getActivity().supportInvalidateOptionsMenu();

                                Toast.makeText(mContext, R.string.something_went_wrong, Toast.LENGTH_SHORT)
                                        .show();
                                Log.wtf(TAG, error.getMessage());
                            }

                        }
                    }, Method.POST);

            // Set parameters
            request.addParam("user_id", user.userId);
            request.addParam("subject", mSubjectEditTextView.getText().toString());
            request.addParam("message", mMessageEditTextView.getText().toString());

            // Sign request
            try {
                Server server = Prefs.getInstance(mContext).getServer();
                OAuthConnector.with(server).sign(request);
            } catch (OAuthMessageSignerException e) {
                e.printStackTrace();
            } catch (OAuthExpectationFailedException e) {
                e.printStackTrace();
            } catch (OAuthCommunicationException e) {
                e.printStackTrace();
            } catch (OAuthNotAuthorizedException e) {
                StuffUtil.startSignInActivity(mContext);
            }

            // Add request to HTTP request queue
            StudIPApplication.getInstance().addToRequestQueue(request);

        }
        return true;

    default:
        return super.onOptionsItemSelected(item);

    }

}

From source file:conexionSiabra.Oauth.java

public JSONObject peticionPost(ArrayList<Pair<String, String>> elementos, String url) {
    String baseString = "";
    String parameters;//  ww  w . j av a2  s.c o  m
    String complement;
    String signature = "";
    String post = "";
    Boolean delanteFlag = false;
    ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
    ArrayList<String> delante = new ArrayList<String>();
    ArrayList<String> detras = new ArrayList<String>();
    for (int i = 0; i < elementos.size(); i++) {
        Pair<String, String> elemento = elementos.get(i);
        if (elemento.first.compareTo("oauth") < 0) { //Alfabeticamente va por delante de oauth
            delanteFlag = true;
            if (delante.size() == 0)
                delante.add(elemento.first + "=" + elemento.second);
            else
                delante.add("&" + elemento.first + "=" + elemento.second);
        } else {
            detras.add("&" + elemento.first + "=" + elemento.second);
        }
    }

    try {
        baseString = "POST&" + URLEncoder.encode(url, "UTF-8") + "&";
        String subparameters = new String();
        //Anadimos los parametros que van delante
        for (int i = 0; i < delante.size(); i++) {
            subparameters += delante.get(i);
        }
        parameters = subparameters;

        if (delanteFlag) {
            parameters += "&";
        }
        parameters += "oauth_consumer_key=" + CONSUMER_KEY + "&oauth_nonce=" + getNonce()
                + "&oauth_signature_method=HMAC-SHA1" + "&oauth_timestamp=" + setTimeStamp() + "&oauth_token="
                + ACCESS_TOKEN + "&oauth_version=1.0";
        //Anadimos los parametros que van detras
        for (int i = 0; i < detras.size(); i++) {
            parameters += detras.get(i);
        }
        complement = URLEncoder.encode(parameters, "UTF-8");
        baseString += complement;
        //REPARACION DE COMAS Y CORCHETES
        baseString = baseString.replace("%2C", "%252C");
        baseString = baseString.replace("%5B", "%255B");
        baseString = baseString.replace("%5B", "%255B");
        baseString = baseString.replace("%5D", "%255D");
        Log.wtf("base", baseString);
        signature = URLEncoder.encode(hmac_sha1(baseString, CONSUMER_SECRET + "&" + ACCESS_TOKEN_SECRET),
                "UTF-8");

        post = url + "?oauth_version=1.0&oauth_nonce=" + getNonce() + "&oauth_timestamp=" + timeStamp
                + "&oauth_consumer_key=" + CONSUMER_KEY + "&oauth_token=" + ACCESS_TOKEN
                + "&oauth_signature_method=HMAC-SHA1&oauth_signature=" + signature;

        nameValuePairs.add(new BasicNameValuePair("oauth_nonce", getNonce()));
        nameValuePairs.add(new BasicNameValuePair("oauth_timestamp", Long.toString(timeStamp)));
        nameValuePairs.add(new BasicNameValuePair("oauth_consumer_key", CONSUMER_KEY));
        nameValuePairs.add(new BasicNameValuePair("oauth_token", ACCESS_TOKEN));
        nameValuePairs.add(new BasicNameValuePair("oauth_signature_method", "HMAC-SHA1"));
        nameValuePairs.add(new BasicNameValuePair("oauth_signature", signature));
        nameValuePairs.add(new BasicNameValuePair("oauth_version", "1.0"));

        for (int i = 0; i < elementos.size(); i++) {
            Pair<String, String> parametro = elementos.get(i);
            nameValuePairs.add(new BasicNameValuePair(parametro.first, parametro.second));
        }
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    String result;
    Log.wtf("Envio", post);
    //PeticionPost peticion = new PeticionPost(post, nameValuePairs);
    Peticion peticion = new PeticionPost(post, nameValuePairs);
    result = peticion.Ejecutar();
    Log.wtf("Resultado", result);
    JSONObject resultado;
    try {
        resultado = new JSONObject(result);
    } catch (JSONException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
        resultado = new JSONObject();
    }

    return resultado;
}