Home > Articles > Programming

This chapter is from the book

Social Networking

Twitter is a social networking and microblogging service that enables its users to send and read messages known as tweets. Twitter is described as the “SMS of the Internet,” and indeed, each tweet cannot exceed 140 characters (although links are converted to shorter links and not counted against the 140-character limit). Twitter users can follow other people’s tweets or be followed by others.

Recipe: Reading the Owner Profile

Starting with API Level 14 (Ice Cream Sandwich), developers are able to access the owner profile. This is a special contact that stores RawContact data. To read the owner profile of a device, the following permission must be added to the AndroidManifest.xml file:

<uses-permission android:name="android.permission.READ_PROFILE" />

The following enables access to profile data:

// sets the columns to retrieve for the owner profile - RawContact data
String[] mProjection = new String[]
    {
        Profile._ID,
        Profile.DISPLAY_NAME_PRIMARY,
        Profile.LOOKUP_KEY,
        Profile.PHOTO_THUMBNAIL_URI
    };

// retrieves the profile from the Contacts Provider
Cursor mProfileCursor = 
    getContentResolver().query(Profile.CONTENT_URI,mProjection,null,null,null);
// Set the cursor to the first entry (instead of -1)
boolean b = mProfileCursor.moveToFirst(); 
for(int i = 0, length = mProjection.length;i < length;i++) {
  System.out.println("*** " + 
      mProfileCursor.getString(mProfileCursor.getColumnIndex(mProjection[i])));
}

Note that where System.out.println() is used is the place where logic can be inserted to process the profile information. It is also worth mentioning that the output will be shown in LogCat, even though it is not a method from Log.*.

Recipe: Integrating with Twitter

Some third-party libraries exist to assist in integrating Twitter into Android applications (from http://dev.twitter.com/pages/libraries#java):

  • Twitter4J by Yusuke Yamamoto—An open source, Mavenized, and Google App Engine-safe Java library for the Twitter API, released under the BSD license
  • Scribe by Pablo Fernandez—OAuth module for Java, Mavenized, and works with Facebook, LinkedIn, Twitter, Evernote, Vimeo, and more

For this recipe, the Twitter4J library by Yusuke Yamamoto is used, which has documentation at http://twitter4j.org/en/javadoc/overview-summary.html. The recipe enables users to log in to Twitter by using OAuth and make a tweet.

Twitter has made changes to its authentication system that now require applications to register in order to access the public feed. To get started, an application has to be registered at https://dev.twitter.com/apps/new. During the registration process, OAuth public and private keys will be generated. They will be used in this recipe, so take note of them.

As this application will be accessing the Internet, it will need the INTERNET permission. There will also be a check to make sure that the device is connected to a network, so the ACCESS_NETWORK_STATE permission is also required. This is done by editing the AndroidManifest.xml file, as shown in Listing 10.12.

Listing 10.12. AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.cookbook.tcookbook"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="9"
        android:targetSdkVersion="17" />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.cookbook.tcookbook.MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="oauth" android:host="tcookbook"/>

            </intent-filter>
        </activity>
    </application>
</manifest>

For the layout of the application, everything will be put into the activity_main.xml file. This file will contain a button that is visible on page load and then several buttons, TextViews, and an EditText widget. Note that some of these will be hidden with android:visibility="gone". Listing 10.13 shows the contents of the activity_main.xml file.

Listing 10.13. res/layout/activity_main.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >
    tools:context=".MainActivity" >

    <Button android:id="@+id/btnLoginTwitter"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Login with OAuth"
        android:layout_marginLeft="10dip"
        android:layout_marginRight="10dip"
        android:layout_marginTop="30dip"/>

    <TextView android:id="@+id/lblUserName"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:padding="10dip"
        android:layout_marginTop="30dip"/>

    <TextView android:id="@+id/lblUpdate" 
        android:text="Enter Your Tweet:"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="10dip"
        android:layout_marginRight="10dip"
        android:visibility="gone"/>

    <EditText android:id="@+id/txtUpdateStatus"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="10dip"
        android:visibility="gone"/>

    <Button android:id="@+id/btnUpdateStatus"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Tweet it!"
        android:layout_marginLeft="10dip"

        android:layout_marginRight="10dip"
        android:visibility="gone"/>

    <Button android:id="@+id/btnLogoutTwitter"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Logout/invalidate OAuth"
        android:layout_marginLeft="10dip"
        android:layout_marginRight="10dip"
        android:layout_marginTop="50dip"
        android:visibility="gone"/>
</LinearLayout>

One activity is used in the application, and two classes are used: one to help with connection detection and one to display an alert message when the wrong application OAuth keys are used.

In the main activity, several constants are set up for use. These include the OAuth Consumer key and Consumer secret. A connectivity check is run to make sure that the user can reach Twitter. Several OnClickListener classes are also registered to trigger logic such as login, logout, and update when clicked.

As Twitter handles authentication for the user, the information passed back is saved in application preferences and is checked again when the user attempts to log in to the application. An AsyncTask is also used to move any tweets made to a background thread.

Listing 10.14 shows the contents of the activity in full.

Listing 10.14. src/com/cookbook/tcookbook/MainActivity.java

package com.cookbook.tcookbook;

import twitter4j.Twitter;
import twitter4j.TwitterException;
import twitter4j.TwitterFactory;
import twitter4j.User;
import twitter4j.auth.AccessToken;
import twitter4j.auth.RequestToken;
import twitter4j.conf.Configuration;
import twitter4j.conf.ConfigurationBuilder;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.content.pm.ActivityInfo;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.os.StrictMode;
import android.text.Html;
import android.util.Log;

import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

public class MainActivity extends Activity {

    // Replace the following value with the Consumer key
    static String TWITTER_CONSUMER_KEY = "01189998819991197253"; 
    // Replace the following value with the Consumer secret
    static String TWITTER_CONSUMER_SECRET =
       "616C6C20796F75722062617365206172652062656C6F6E6720746F207573";

    static String PREFERENCE_NAME = "twitter _ oauth";
    static final String PREF_KEY_OAUTH_TOKEN = "oauth_token";
    static final String PREF_KEY_OAUTH_SECRET = "oauth_token_secret";
    static final String PREF_KEY_TWITTER_LOGIN = "isTwitterLoggedIn";

    static final String TWITTER_CALLBACK_URL = "oauth://tcookbook";

    static final String URL_TWITTER_AUTH = "auth_url";
    static final String URL_TWITTER_OAUTH_VERIFIER = "oauth_verifier";
    static final String URL_TWITTER_OAUTH_TOKEN = "oauth_token";

    Button btnLoginTwitter;
    Button btnUpdateStatus;
    Button btnLogoutTwitter;
    EditText txtUpdate;
    TextView lblUpdate;
    TextView lblUserName;

    ProgressDialog pDialog;

    private static Twitter twitter;
    private static RequestToken requestToken;

    private static SharedPreferences mSharedPreferences;

    private ConnectionDetector cd;

    AlertDialogManager adm = new AlertDialogManager();

    @Override
    public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      // used for Android 2.3+
      if (Build.VERSION.SDK_INT > Build.VERSION_CODES_GINGERBREAD) {
        StrictMode.ThreadPolicy policy = 
            new StrictMode.ThreadPolicy.Builder().permitAll().build();
        StrictMode.setThreadPolicy(policy);
      }

      setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);

      cd = new ConnectionDetector(getApplicationContext());


      if (!cd.isConnectingToInternet()) {
        adm.showAlertDialog(MainActivity.this, "Internet Connection Error",
            "Please connect to working Internet connection", false);
        return;
      }

      if(TWITTER_CONSUMER_KEY.trim().length() == 0 || 
          TWITTER_CONSUMER_SECRET.trim().length() == 0){
        adm.showAlertDialog(MainActivity.this, 
            "Twitter OAuth tokens",
            "Please set your Twitter OAuth tokens first!", false);
        return;
      }

      btnLoginTwitter = (Button) findViewById(R.id.btnLoginTwitter);
      btnUpdateStatus = (Button) findViewById(R.id.btnUpdateStatus);
      btnLogoutTwitter = (Button) findViewById(R.id.btnLogoutTwitter);
      txtUpdate = (EditText) findViewById(R.id.txtUpdateStatus);
      lblUpdate = (TextView) findViewById(R.id.lblUpdate);
      lblUserName = (TextView) findViewById(R.id.lblUserName);

      mSharedPreferences = getApplicationContext().getSharedPreferences("MyPref", 0);

      btnLoginTwitter.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View arg0) {
          // Call login Twitter function
          loginToTwitter();
        }
      });

      btnUpdateStatus.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
          String status = txtUpdate.getText().toString();

          if (status.trim().length() > 0) {
            new updateTwitterStatus().execute(status);
          } else {
            Toast.makeText(getApplicationContext(),
                "Please enter status message", Toast.LENGTH_SHORT).show();
          }
        }
      });

      btnLogoutTwitter.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View arg0) {
          // Call logout Twitter function
          logoutFromTwitter();
        }
      });

      if (!isTwitterLoggedInAlready()) {
        Uri uri = getIntent().getData();

        if (uri != null && uri.toString().startsWith(TWITTER_CALLBACK_URL)) {
          String verifier = uri.getQueryParameter(URL_TWITTER_OAUTH_VERIFIER);

          try {
            AccessToken accessToken = twitter.getOAuthAccessToken(requestToken, verifier);

            Editor e = mSharedPreferences.edit();

            e.putString(PREF_KEY_OAUTH_TOKEN, accessToken.getToken());
            e.putString(PREF_KEY_OAUTH_SECRET,accessToken.getTokenSecret());
            e.putBoolean(PREF_KEY_TWITTER_LOGIN, true);
            e.commit();

//            Log.e("Twitter OAuth Token", "> " + accessToken.getToken());

            btnLoginTwitter.setVisibility(View.GONE);

            lblUpdate.setVisibility(View.VISIBLE);
            txtUpdate.setVisibility(View.VISIBLE);
            btnUpdateStatus.setVisibility(View.VISIBLE);
            btnLogoutTwitter.setVisibility(View.VISIBLE);

            long userID = accessToken.getUserId();
            User user = twitter.showUser(userID);
            String username = user.getName();

            lblUserName.setText(Html.fromHtml("<b>Welcome " + username + "</b>"));
          } catch (Exception e) {
            Log.e("***Twitter Login Error: ",e.getMessage());
          }
        }
      }

    }

    private void loginToTwitter() {
      if (!isTwitterLoggedInAlready()) {
        ConfigurationBuilder builder = new ConfigurationBuilder();
        builder.setOAuthConsumerKey(TWITTER_CONSUMER_KEY);
        builder.setOAuthConsumerSecret(TWITTER_CONSUMER_SECRET);
        Configuration configuration = builder.build();

        TwitterFactory factory = new TwitterFactory(configuration);
        twitter = factory.getInstance();

        if(!(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)) {
          try {
            requestToken = twitter.getOAuthRequestToken(TWITTER_CALLBACK_URL);
            this.startActivity(new Intent(Intent.ACTION_VIEW,
                Uri.parse(requestToken.getAuthenticationURL())));
          } catch (TwitterException e) {
            e.printStackTrace();
          }
          } else {
          new Thread(new Runnable() {

            public void run() {
              try { 
                requestToken = twitter.getOAuthRequestToken(TWITTER_CALLBACK_URL);
                MainActivity.this.startActivity(new Intent(Intent.ACTION_VIEW,
                    Uri.parse(requestToken.getAuthenticationURL())));
              } catch (TwitterException e) {
                e.printStackTrace();
              }
            }
          }).start();
        }
      } else {
        Toast.makeText(getApplicationContext(),"Already logged into Twitter",
            Toast.LENGTH_LONG).show();
      }
    }

    class updateTwitterStatus extends AsyncTask<String, String, String> {
      @Override
      protected void onPreExecute() {
        super.onPreExecute();
        pDialog = new ProgressDialog(MainActivity.this);
        pDialog.setMessage("Updating to Twitter...");
        pDialog.setIndeterminate(false);
        pDialog.setCancelable(false);
        pDialog.show();
      }

      protected String doInBackground(String... args) {
//        Log.d("*** Text Value of Tweet: ",args[0]);
        String status = args[0];
        try {
          ConfigurationBuilder builder = new ConfigurationBuilder();
          builder.setOAuthConsumerKey(TWITTER_CONSUMER_KEY);
          builder.setOAuthConsumerSecret(TWITTER_CONSUMER_SECRET);

          String access_token = 
              mSharedPreferences.getString(PREF_KEY_OAUTH_TOKEN, "");
          String access_token_secret =
              mSharedPreferences.getString(PREF_KEY_OAUTH_SECRET, "");

          AccessToken accessToken =
              new AccessToken(access_token, access_token_secret);
          Twitter twitter = 
              new TwitterFactory(builder.build()).getInstance(accessToken);

          twitter4j.Status response = twitter.updateStatus(status);

//          Log.d("*** Update Status: ",response.getText());
        } catch (TwitterException e) {
          Log.d("*** Twitter Update Error: ", e.getMessage());
        }
        return null;
      }


      protected void onPostExecute(String file_url) {
        pDialog.dismiss();
        runOnUiThread(new Runnable() {
          @Override
          public void run() {
            Toast.makeText(getApplicationContext(),
                "Status tweeted successfully", Toast.LENGTH_SHORT).show();
            txtUpdate.setText("");
          }
        });
      }

    }

    private void logoutFromTwitter() {
      Editor e = mSharedPreferences.edit();
      e.remove(PREF_KEY_OAUTH_TOKEN);
      e.remove(PREF_KEY_OAUTH_SECRET);
      e.remove(PREF_KEY_TWITTER_LOGIN);
      e.commit();

      btnLogoutTwitter.setVisibility(View.GONE);
      btnUpdateStatus.setVisibility(View.GONE);
      txtUpdate.setVisibility(View.GONE);
      lblUpdate.setVisibility(View.GONE);
      lblUserName.setText("");
      lblUserName.setVisibility(View.GONE);

      btnLoginTwitter.setVisibility(View.VISIBLE);
    }

    private boolean isTwitterLoggedInAlready() {
      return mSharedPreferences.getBoolean(PREF_KEY_TWITTER_LOGIN, false);
    }

    protected void onResume() {
      super.onResume();
    }

}

More information on using Twitter4j can be found in the following resources:

Recipe: Integrating with Facebook

Facebook has changed rapidly in the last couple of years, and it remains one of the top social networking sites. One thing the Facebook team has done recently is to clean up their documentation to help developers. The official documentation can be found at https://developers.facebook.com/docs/getting-started/facebook-sdk-for-android/3.0/.

To get started with Facebook development, first download the Facebook SDK and the Facebook android package (APK) from https://developers.facebook.com/resources/facebook-android-sdk-3.0.zip. The APK is provided as a means of authentication without having to use a WebView. If the Facebook application is already installed on the phone, the APK file need not be installed.

Next, add the Facebook SDK as a library project to the Eclipse installation. This is done by choosing File → Import and then General → Existing Projects into Workspace. Note that Facebook warns against using the “Copy projects into workspace” options, as this may build incorrect filesystem paths and cause the SDK to function incorrectly.

After the Facebook SDK has been imported, the sample projects are available for experimentation. Note that most of the projects require the generation of a key hash that will be used to sign applications and that developers can add to their Facebook developer profile for quick SDK project access.

The key is generated by using the keytool utility that comes with Java. Open a terminal or command prompt and type the following to generate the key:

OS X:

keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore |
[ccc]openssl sha1 -binary | openssl base64

Windows:

keytool -exportcert -alias androiddebugkey -keystore %HOMEPATH%\.android\debug.
keystore [ccc]| openssl sha1 -binary | openssl base64

The command should be typed in a single line, although terminals or command prompt windows may show it breaking into multiple lines. When the command is executed, a password prompt should appear. The password to enter is android. After the key has been generated successfully, it will be displayed. Note that if a “'keytool' is not recognized as an internal or external command . . .” error is generated, move to the bin directory of the JRE installation directory and try again. If there is a similar error for “openssl,” download OpenSSL from http://code.google.com/p/openssl-for-windows/. If there are still errors, make sure that the bin directories have been added to the system path or that the exact directories are being used instead of %HOMEPATH%.

If more than one computer will be used for development, a hash must be generated for each one and added to the developer profile at https://developers.facebook.com/.

Once that is done, dig into the sample applications and log in with them. The showcase example project, called HelloFacebookSample, demonstrates how to access a profile, update a status, and even upload photos.

The last step in creating an application that integrates with Facebook is to create a Facebook app that will then be tied to the Android application by using a generated key hash. This will take care of integration and allow users to authenticate themselves while using the application.

The developer site gives a terrific breakdown of all the pieces needed to get started. Be sure to read the official Scrumptious tutorial, which can be found at http://developers.facebook.com/docs/tutorials/androidsdk/3.0/scrumptious/.

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020