App Inventor and the Twitter Component


A quick Twitter Tutorial with App Inventor 2

Note: The Twitter component unfortunately is broken.
For details see this thread in the forum.

Let's tweet with App Inventor 2! Now in App Inventor 2 we also can tweet with images! The App Inventor team did a great job, everything is so easy to do, and I know what I'm talking about, see my Twitter example using the web component, where I did everything by hand, which was a nightmare.

Note: There is no TwitPic API key required anymore!

Preparation: Get a Twitter Consumer key and Consumer secret.

You already have a Twitter account. Now follow the documentation to get a Consumer key and Consumer secret.





Note: The Callback URL is mandatory!

Login

As mentioned in the documentation, App Inventor does all the "ugly" work for you: Login is handled using the OAuth protocol, as required by the Twitter API ( dev.twitter.com/pages/auth ). An App Inventor app that needs to make Twitter API calls on behalf of an authenticated user should first call Authorize. This loads a Twitter login page that will allow the user to login with their username and password, and then return appropriate credentials to the Twitter component in the app. Once the Twitter component has the credentials the IsAuthorized event is raised to let the app know that it can proceed with Twitter API calls.

Tweet

This snippet shows how to tweet with or without image.

For questions about App Inventor,
please ask in the App Inventor community.Thank you.

Timeline

Followers

Mentions

Follow

Other Blocks used

Test

Tested successfully on Samsung Galaxy Tab 10.1N running Android 3.2.
Note: the Twitter component requires min. Android version 2.3.

Questions and Answers

Q1: I'm wondering about what happens after the user authenticates their Twitter Account in an AI2 app, are they good to go? Is there the need to log in to Twitter over and over again when you close the AI2 App, then reopen the app at another time and access it's Twitter screen?
A: The user only needs to login once. He/she only needs to re-atuthenticate after the user revoked access to your app, see also the Twitter support page.

Download


Developing and maintaining snippets, tutorials and extensions for App Inventor takes a lot of time.
I hope it saved some of your time. If yes, then you might consider to donate a small amount!

Donation amount:

or donate some mBTC to Bitcoin Address:
1Jd8kXLHu2Vkuhi15TWHiQm4uE9AGPYxi8
Bitcoin

Thank you! Taifun
 

Download aia file for App Inventor
Back to top of page ...

Creative Commons License
This work by Pura Vida Apps is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License
with attribution (name=Pura Vida Apps and link to the source site) required.


Home | Snippets | Tutorials | Extensions | Links | Search | Privacy Policy | Contact