Skip to main content

Introduction to Posting your Photos to Twitter

Lesson 26 from: Building a Twitter App

Tony Hillerson

Introduction to Posting your Photos to Twitter

Lesson 26 from: Building a Twitter App

Tony Hillerson

buy this class

$00

$00
Sale Ends Soon!

starting under

$13/month*

Unlock this classplus 2200+ more >

Lesson Info

26. Introduction to Posting your Photos to Twitter

Lesson Info

Introduction to Posting your Photos to Twitter

All right. Well, welcome to the final week of this class where we trade a Twitter client. We've done a lot of things we've signed into Twitter using oh, off we've loaded tweets and display those in a list for you. We talked about the benefits and drawbacks, comparing comparing a contrast in using threads versus Google's a sink task sort of a background task classes you can use to make it easy to load stuff in the background. Which, as we've learned, is very important for user interface, um, applications. So you don't wanna be, ah, slowing down the users experience or making it look like your APP is freezing. So those were some important topics. And then we had a more fun topic last week where we talked about skinning and styling a little bit, which has definitely got some men's announce as faras Android application development goes. And this week we're gonna finish up by dealing with some media, um, by loading pictures into the twit pic service, which sort of works in concert with Twit...

ter. Um, Twitter. That doesn't actually have a way to ah show picture. They don't They don't host pictures on on Twitter itself. But there's other applications and services that are up there on the Web that that allow you to sort of associate your media like videos or pictures or things like that. And twit pic is one of those that lets you lets you put up a picture that's associated with the tweet. So what's happened? What happens is you actually posted a tweet through twit pic, and it will post it on to your account on Twitter and also hosts the image that's associated with the tweet. So to do that, we're going to be, ah, using AH library called twit pic for J, which is up on Google Code if this at this location and you can see on the screen and we're gonna allow the user to post photos from the library and from the camera. So if they've already taken a picture, the photo earlier it'll be in the library. And if they want to take one right on the spot that it can take a picture through the camera and it will also be added to the library. Um, now, one thing I kind of mentioned in the overview class, I believe, um, Twitter as you know, as changing over from basic authentication to to only use o off. Um, but that's twitpic for J library. Still, ah uses the basic authentication route through. So you have to put in your Twitter Twitter credentials. I expected there to be some changes in the library, but as far as I know, there has been no changes yet and times kind of running out on that. So this code I'm gonna try to keep the code up to date, and everybody stay tuned on the forms if anything changes. But this code may not end up working exactly as it does right now. Later in the in the future, when twit pic for Jay is ready to use twit pics alof, um, Twitpic as a way to use something that Twitter calls Oh, off echo where they can You can use a lot the time signing twit pic, And it will also authenticate you on Twitter. Somehow, I'm not quite sure of the details, but luckily, um, the android part of part of this course, which is really important part as far as learning android goes, that's still going to be valid. So you're just, um so you're gonna be able to learn how to use the the media how to access media on the user's device. Um, behalf the user, either through the library or through the camera. So a couple of new things Ah, for the code that you'll notice in the code this week, we're gonna be changing the settings helper that we had previously called the OAS helper. Because there's some different things that is going to need to do this week. We're gonna add a new post photo a sink task, which is ah, synchronous task that that looks just like the post tweet. A sink task that we had before it, except will be, will be using this when we want to post a tweet that also has a photo attached to it. And also the twit pic for JGR, which I've added to the library and should be already to go once you download the code. So this is the fifth generation of improving this Twitter applications have gone through these last couple weeks. It will be a few new things that we run into, um, one that we sort of just lightly touched on last class last where we built the task manager. So not this one. But the last class, um is the shared preferences a p I, which is a way to store local data. So we went through in depth in the last class where we build a task manager application or like a task lists type thing. Ah, we went through in depth how to deal with the local database, Um, the local secret light database that android allows. But there is a much easier way to store. If you don't really need some structured data, you could just store one off preferences for the user. That's that's the name of class. And that's kind of the intent of using this ap I so we can store some some little bits of information that we need, So we're gonna be running into how to use that today. Um, also talked a little bit about Twitpic already, but we're gonna be using that library called twit pic for J again to upload, um photos, um, and then to get those photos that we want to upload, we're gonna be using the media store class, which contains all the information about media on the user's device. Those stories are I'd like to like to have a little bit mawr. Interesting visual information about, um whatever I think is happening out there in the world that I think is worth sharing on Twitter, which could be anything, really. There's no there's no bar. So if you want to put some visual information along with that, um, as a user, we're gonna allow you to go and pick out a photo that you've already taken from your media library on the device or two. Snap a picture with the camera, and then once that once that picture is ready to go, um, then will be Then we'll be ready to go through the normal process that we went through before of posting a tweet. Except now there'll be a twit. Ah, twit pic picture instead. And then you'd be able to go to Twitpic and go to view that And when when you post through Twitpic, by the way, it posts on through to Twitter but also leaves a little short URL in the tweets so that someone can get onto the image by clicking that link. So those are the stories we're gonna be accomplishing. Let's get on to looking at the codes

RELATED ARTICLES

RELATED ARTICLES