Android TwitterStreamFactory - 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 TwitterStreamFactory class.

This code example shows how to use the following methods:
    protected TwitterStreamFactory factory;
 
    public TwitterStreamResolver() { 
        SettingsDao settings = settingsService.getConsumerSettings();
        if ( settings == null ) {
            factory = new TwitterStreamFactory();
        } 
        else { 
            ConfigurationBuilder cb = new ConfigurationBuilder();
            cb.setDebugEnabled(true)
              .setOAuthConsumerKey(settings.getConsumerKey())
              .setOAuthConsumerSecret(settings.getConsumerSecret());
            factory = new TwitterStreamFactory(cb.build());
        } 
    } 
 
    public TwitterStream createTwitterStream( TwitterAccountDao account, boolean emptyAuth ) throws TwitterAuthenticationException {
 
        TwitterStream twitter = null;
 
4
CodeRank
This code example shows how to use the following methods:
    private boolean isAuthed = false;
    private OAuthAuthorization oAuth;
    private String oauthAccessToken;
    private String oauthAccessTokenSecret;
    private ConfigurationBuilder cbuilder = new ConfigurationBuilder();
    private static TwitterStreamFactory streamFactory = new TwitterStreamFactory();
 
 
    public static L2witterApprication getInstance() { 
      return sInstance;
    } 
 
    public TwitterStream getTwitterStream(){
        return twitterStream;
    } 
 
    @Override 
    public void onCreate() { 
      super.onCreate(); 
      sInstance = this;
4
CodeRank
This code example shows how to use the following methods:
 
	interface TweetFilter { 
		boolean accepts(Status status);
	} 
 
	private static final TwitterStream TWITTER_STREAM = new TwitterStreamFactory()
			.getInstance();
	private static final TweetFilter ENGLISH_STATUS_FILTER = new TweetFilter() {
		private final LanguageCategorization languageCategorization = new LanguageCategorization(); 
 
		@Override 
		public boolean accepts(Status status) { 
			return languageCategorization.findLanguage( 
					new ByteArrayList(status.getText().getBytes())).contains( 
					"english.lm"); 
		} 
	}; 
 
	@Override 
	public List<String> getSamples(int count) {
4
CodeRank
This code example shows how to use the following methods:
		boolean accepts(twitter4j.Status status);
	} 
 
	private static final MongoDatastore DATA_STORE = MongoDatastore
			.getInstance(); 
	private static final TwitterStream TWITTER_STREAM = new TwitterStreamFactory()
			.getInstance();
	private static final TweetFilter ENGLISH_STATUS_FILTER = new TweetFilter() {
		private final LanguageCategorization languageCategorization = new LanguageCategorization(); 
 
 
		@Override 
		public boolean accepts(twitter4j.Status status) { 
			return languageCategorization.findLanguage( 
					new ByteArrayList(status.getText().getBytes())).contains( 
					"english.lm"); 
		} 
	}; 
 
	public static void main(String[] args) {
4
CodeRank
This code example shows how to use the following methods:
	public static void setPollTimeOut(long pollTimeOut) {
		TweetConfig.pollTimeOut_ = pollTimeOut;
	} 
 
	public TwitterStream getTwitterStream() {
		return new TwitterStreamFactory(configuration_).getInstance();
	} 
 
	public Twitter getTwitter() {
		return new TwitterFactory(configuration_).getInstance();
	} 
	 
	@Override 
	public void afterPropertiesSet() throws Exception { 
		ConfigurationBuilder cb = new ConfigurationBuilder();
		cb.setOAuthConsumerKey(oAuthConsumerKey_);
		cb.setOAuthConsumerSecret(oAuthConsumerSecret_);
		cb.setOAuthAccessToken(oAuthAccessToken_);
		cb.setOAuthAccessTokenSecret(oAuthAccessTokenSecret_);
		configuration_ = cb.build();
4
CodeRank
See Code Examples for Android TwitterStreamFactory Methods: