Android ConfigurationBuilder - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android ConfigurationBuilder class.

This code example shows how to use the following methods:build, setOAuthConsumerKey, setOAuthConsumerSecret
 
public class TwitterService implements ITwitterService { 
    private Configuration conf;
 
    public void initialize() { 
        ConfigurationBuilder cb = new ConfigurationBuilder();
 
        cb.setOAuthConsumerKey(PartakeConfiguration.twitter4jConsumerKey());
        cb.setOAuthConsumerSecret(PartakeConfiguration.twitter4jConsumerSecret());
 
        conf = cb.build();
    } 
 
    public TwitterLoginInformation createLoginInformation(String redirectURL) throws TwitterException {
        Twitter twitter = new TwitterFactory(conf).getInstance();
        String callbackURL = PartakeConfiguration.toppath() + "/auth/verifyForTwitter";
        RequestToken requestToken = twitter.getOAuthRequestToken(callbackURL);
 
        return new TwitterLoginInformation(twitter, requestToken, redirectURL);
    } 
7
CodeRank
This code example shows how to use the following methods:setApplicationOnlyAuthEnabled, setUseSSL
    } 
 
    @Override 
    protected void setUp() throws Exception { 
        super.setUp(); 
        builder = new ConfigurationBuilder();
        builder.setUseSSL(true);
        builder.setApplicationOnlyAuthEnabled(true);
    } 
 
    // --- Authentication 
 
    public void testAuthWithBuildingConf1() throws Exception { 
        // setup 
        Twitter twitter = new TwitterFactory(builder.build()).getInstance();
 
        // exercise & verify 
        twitter.setOAuthConsumer(browserConsumerKey, browserConsumerSecret);
        OAuth2Token token = twitter.getOAuth2Token();
        assertEquals("bearer", token.getTokenType());
7
CodeRank
This code example shows how to use the following methods:build, setOAuthAccessToken, setOAuthAccessTokenSecret, setOAuthConsumerKey, setOAuthConsumerSecret
        assertTrue(twitter1.equals(twitter2));
        assertEquals(twitter1, twitter2);
    } 
 
    public void testOAuth() throws Exception { 
        ConfigurationBuilder build = new ConfigurationBuilder();
        String oAuthAccessToken = p.getProperty("id1.oauth.accessToken");
        String oAuthAccessTokenSecret = p.getProperty("id1.oauth.accessTokenSecret");
        String oAuthConsumerKey = p.getProperty("oauth.consumerKey");
        String oAuthConsumerSecret = p.getProperty("oauth.consumerSecret");
        build.setOAuthAccessToken(oAuthAccessToken);
        build.setOAuthAccessTokenSecret(oAuthAccessTokenSecret);
        build.setOAuthConsumerKey(oAuthConsumerKey);
        build.setOAuthConsumerSecret(oAuthConsumerSecret);
        OAuthAuthorization auth = new OAuthAuthorization(build.build());
        Twitter twitter = new TwitterFactory().getInstance(auth);
        twitter.verifyCredentials();
    } 
 
    public void testDesktopClient() throws Exception { 
7
CodeRank
This code example shows how to use the following methods:build, setOAuthAccessToken, setOAuthAccessTokenSecret, setOAuthConsumerKey, setOAuthConsumerSecret
This code example shows how to use the following methods:build, setDebugEnabled
    public static final String CONSUMER_KEY = "4mmKNvN3CFUNygmQRvRsZA";
 
    public static final String CONSUMER_SECRET = "d4In9G8zze32nWKyXxzIXgdAisGN84rECsXpE7h9TA";
 
    static { 
        ConfigurationBuilder cb = new ConfigurationBuilder();
        cb.setDebugEnabled(true)
                .setOAuthRequestTokenURL("https://api.twitter.com/oauth/request_token")
                .setOAuthAuthorizationURL("https://api.twitter.com/oauth/authorize")
                .setOAuthAccessTokenURL("https://api.twitter.com/oauth/access_token")
                .setOAuthAuthenticationURL("https://api.twitter.com/oauth/authenticate")
                .setRestBaseURL("http://api.twitter.com/1/")
                .setOAuthConsumerKey(CONSUMER_KEY)
                .setOAuthConsumerSecret(CONSUMER_SECRET);
        Configuration conf = cb.build();
        twitterFactory = new TwitterFactory(conf);
        Logger.getLogger("TWITTER").info("Loaded Twitter Factory with following settings:\n" + conf);
    } 
 
    public static Twitter getTwitter() {
6
CodeRank
This code example shows how to use the following methods:build, setDebugEnabled, setOAuthAccessToken, setOAuthAccessTokenSecret, setOAuthConsumerKey
 
    private TwitterFactory twitterfactory;
    private Twitter twitter;
     
    public TwitterClientImpl(){ 
        ConfigurationBuilder configbuilder = new ConfigurationBuilder();
	configbuilder.setDebugEnabled(true);
	configbuilder.setOAuthConsumerKey("GZ6tiy1XyB9W0P4xEJudQ");
	configbuilder.setOAuthConsumerSecret("gaJDlW0vf7en46JwHAOkZsTHvtAiZ3QUd2mD1x26J9w");
	configbuilder.setOAuthAccessToken("1366513208-MutXEbBMAVOwrbFmZtj1r4Ih2vcoHGHE2207002");
	configbuilder.setOAuthAccessTokenSecret("RMPWOePlus3xtURWRVnv1TgrjTyK7Zk33evp4KKyA");
        
        twitterfactory = new TwitterFactory(configbuilder.build());
        twitter = twitterfactory.getInstance();
    } 
     
     
    @Override 
    public void publishUuid(TwitterStatusMessage message) throws Exception {
        if( message == null ){
7
CodeRank
This code example shows how to use the following methods:build, setDebugEnabled
	private Twitter twitter;
 
	public TwitterService() { 
		super("TwitterService"); 
 
		cb = new ConfigurationBuilder();
 
		cb.setDebugEnabled(true).setOAuthConsumerKey(CONSUMER_KEY)
				.setOAuthConsumerSecret(CONSUMER_SECRET)
				.setOAuthAccessToken(ACCESS_TOKEN)
				.setOAuthAccessTokenSecret(ACCESS_TOKEN_SECRET);
		tf = new TwitterFactory(cb.build());
		 
	} 
 
	@Override 
	protected void onHandleIntent(Intent intent) {
		Log.d(LOG, "Twitter service started");
 
		Intent broadCastIntent = new Intent();
6
CodeRank
This code example shows how to use the following methods:build, setOAuthAccessToken, setOAuthAccessTokenSecret, setOAuthConsumerKey, setOAuthConsumerSecret
This code example shows how to use the following methods:build, setOAuthAccessToken, setOAuthAccessTokenSecret, setOAuthConsumerKey, setOAuthConsumerSecret
	private final static String oAuthAccessToken = "405617247-XEcaeBdnggnWzbFry5sk4c50IYIcsTSXUNiBct03";
	private final static String oAuthAccessTokenSecret= "Vu6U4vgxotxa12bpAeuUa43rItLGWJPWRQaTcPIZDIg";
	private Twitter twitter;
	 
	public GetConfiguredTwitterObject(){ 
		ConfigurationBuilder cb = new ConfigurationBuilder();
		cb.setOAuthConsumerKey(oAuthConsumerKey);
		cb.setOAuthConsumerSecret(oAuthConsumerSecret);
		cb.setOAuthAccessToken(oAuthAccessToken);
		cb.setOAuthAccessTokenSecret(oAuthAccessTokenSecret);
		TwitterFactory tf = new TwitterFactory(cb.build());
		twitter = tf.getInstance();
	} 
	public Twitter getTwitter() {
		return twitter;
	} 
	public void setTwitter(Twitter twitter) {
		this.twitter = twitter;
	} 
 
6
CodeRank
This code example shows how to use the following methods:build, setOAuthAccessToken, setOAuthAccessTokenSecret, setOAuthConsumerKey, setOAuthConsumerSecret

Related Android ConfigurationBuilder Questions & Answers:

Other Android ConfigurationBuilder Examples

223:			// Check if already logged in
224:			if (!isTwitterLoggedInAlready()) {
225:				ConfigurationBuilder builder = new ConfigurationBuilder();
226:				builder.setOAuthConsumerKey(TWITTER_CONSUMER_KEY);
227:				builder.setOAuthConsumerSecret(TWITTER_CONSUMER_SECRET);
-
223:			// Check if already logged in
224:			if (!isTwitterLoggedInAlready()) {
225:				ConfigurationBuilder builder = new ConfigurationBuilder();
226:				builder.setOAuthConsumerKey(TWITTER_CONSUMER_KEY);
227:				builder.setOAuthConsumerSecret(TWITTER_CONSUMER_SECRET);
-
271:				String status = args[0];
272:				try {
273:					ConfigurationBuilder builder = new ConfigurationBuilder();
274:					builder.setOAuthConsumerKey(TWITTER_CONSUMER_KEY);
275:					builder.setOAuthConsumerSecret(TWITTER_CONSUMER_SECRET);
-
271:				String status = args[0];
272:				try {
273:					ConfigurationBuilder builder = new ConfigurationBuilder();
274:					builder.setOAuthConsumerKey(TWITTER_CONSUMER_KEY);
275:					builder.setOAuthConsumerSecret(TWITTER_CONSUMER_SECRET);

Read More