Package android.content

Examples of android.content.SharedPreferences


        if( item == null ) {
            return;
        }

        // get user preferences
        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences( application.getBaseContext() );

        // check if we can connect to internet
        if( !CheckInternet.getInstance().canConnect( application.getBaseContext(), prefs ) ) {
            Log.v(TAG, "cant connect to internet");
            return;
View Full Code Here


            // file upload failed so abort post and close connection
            post.abort();
            client.getConnectionManager().shutdown();

            // get user preferences and number of retries for failed upload
            SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences( context );
            int maxRetries = Integer.valueOf( prefs.getString( "retries", "" ).substring( 1 ) );

            // check if we can connect to internet and if we still have any tries left
            // to try upload again
            if( CheckInternet.getInstance().canConnect( context, prefs ) && retries < maxRetries ) {
                // remove notification for failed upload and queue item again
View Full Code Here

        // set main layout screen
        setContentView( R.layout.main );

        // get user preferences
        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences( getBaseContext() );

        // check if application notification is on
        if( prefs.getString( "notification", "" ).contains( "enabled" ) ) {
            ApplicationNotification.getInstance().enable( getBaseContext() );
        }

        // store highest image id from database in application
        setMaxIdFromDatabase();
View Full Code Here

            // file upload failed so abort post and close connection
            p.abort();
            client.getConnectionManager().shutdown();

            // get user preferences and number of retries for failed upload
            SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences( context );
            int maxRetries = Integer.valueOf( prefs.getString( "retries", "" ).substring( 1 ) );

            // check if we can connect to internet and if we still have any tries left
            // to try upload again
            if( CheckInternet.getInstance().canConnect( context, prefs ) && retries < maxRetries ) {
                // remove notification for failed upload and queue item again
View Full Code Here

    editor.remove(ACCESS_TOKEN);
    editor.commit();
  }

  private Provider loadSelectedProvider() {
    SharedPreferences preferences = getSharedPreferences("default",
        MODE_PRIVATE);

    String name = preferences.getString(SELECTED_PROVIDER, null);

    try {
      Class<? extends Provider> providerClass = providerClasses.get(name);

      return providerClass.newInstance();
View Full Code Here

      return null;
    }
  }

  private OAuth3LeggedScheme.Token loadRequestToken() {
    SharedPreferences preferences = getSharedPreferences("default",
        MODE_PRIVATE);

    String requestTokenSecret = preferences.getString(REQUEST_TOKEN_SECRET,
        null);
    String requestToken = preferences.getString(REQUEST_TOKEN, null);
    Uri data = getIntent().getData();

    if (requestToken != null) {
      return new OAuth3LeggedScheme.Token(requestToken, requestTokenSecret);
    }
View Full Code Here

    return null;
  }

  private OAuth3LeggedScheme.Token loadAccessToken() {
    SharedPreferences preferences = getSharedPreferences("default",
        MODE_PRIVATE);
   
    String accessTokenSecret = preferences.getString(ACCESS_TOKEN_SECRET,
        null);
    String accessToken = preferences.getString(ACCESS_TOKEN, null);

    if (accessToken == null) {
      return null;
    }
View Full Code Here

TOP

Related Classes of android.content.SharedPreferences

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.