Android app, which allows to search tweets as user types and scroll them infinitely
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

SearchTwitter Build Status

Android app, which allows to search tweets as user types and scroll them infinitely

Utilizes modern Android libraries

for Dependency Injection, Reactive Programming, Networking, Images Loading, Logging, User Interface, etc.

Code quality is assured by Unit Tests, Static Code Analysis and Continuous Integration.



User can search tweets with a given keyword as he or she types or by touching search icon. Moreover, application has so called infinite scroll for tweets. Implementation of the dynamic search is quite simple thanks to RxJava and Reactive Programming principles.



Configuration of Twitter API keys and tokens

Go to website, register your account and Twitter app. Next, generate your keys and tokens. When you have them, go to file in the repository and add the following contents to this file:


and set your keys and tokens to appropriate variables.

After that, you can build and run the app.

Working with secrets in Git Repository

We shouldn't keep tokens and API keys in the Git repository. In order to work efficiently with Git, we can add file to .gitignore file in the repository or add the following aliases to our .gitconfig file:

ignore-local = update-index --assume-unchanged
unignore-local = update-index --no-assume-unchanged
ignored-local = !git ls-files -v | grep "^[[:lower:]]"

Then, we can execute:

$ git ignore-local

After that, we can add our keys and tokens to this file and our secrets won't be commited or pushed.

To undo this operation, we can simply call:

$ git unignore-local

To list all files ingored locally in the Git repository, we can call:

$ git ignored-local

Twitter API rate limits

Please remember that Twitter API has its own rate limits, so when user will perform too many requests in a short period of time, further requests may be blocked for a given amount of time. Don't worry - it's not so long. Error code for rate limit is provided in TwitterApiProvider class and is used by RxJava error handling in MainActivity class.

Building the project

We can build project with Gradle Wrapper and the following command:

./gradlew build


Tets are located in app/src/androidTest/java and can be executed on device or emulator with the following command:

./gradlew connectedCheck

Reports from tests are located in app/build/reports/androidTests/ directory.

Static Code Analysis

Project uses the following tools for static code analysis configured in config/quality.gradle file:

  • Checkstyle
  • PMD
  • FindBugs
  • Android Lint

Reference to this file is added in app/build.gradle file.

Static Code analysis can be executed with the following command:

./gradlew check

Reports from analysis are generated in app/build/reports/ directory.

Code style

Code style used in the project is called SquareAndroid from Java Code Styles repository by Square available at:

Used libraries


Copyright 2016 Piotr Wittchen

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.