Skip to content

Creation of a Twitter account to use

Daniele Morgantini edited this page Aug 20, 2013 · 2 revisions

Basically, you have to grant access rights to your account for the application. You have to go through this process only once and never again. If you already did, you can skip these steps.

  • Go to https://dev.twitter.com/apps and login.
  • Click on "Create an Application" and fill in the details: the application name, a short description and your application's publicly accessible home page (the git page, for instance) and hit the "Create your Twitter application" button. In Settings you can define the type of access your application needs (Read / Read and Write / Read, Write and Access direct messages).
  • Create the access token (lower on the page) to obtain the access token and access token secret.

At this point, you've got everything you need to configure Twitter4j: Consumer key, Consumer secret, Access token and Access Token Secret.

Test Twitter4j

There are several ways to set oAuth properties. Here's some example
You can test that Twitter4j is working properly and that you've got everything set up. Create a Test class in your project and start playing around with Twitter4j.