Android Programming Press on the image to return to the main documentation page.

ABTwitter

Written by Alain Bailleul

List of types:

ABDirectMessage
ABDirectMessages
ABFollowers
ABFriends
ABStatus
ABTimeLine
ABTwitter
ABUser

ABDirectMessage

Returns a Direct Message. This contains the sender (QuickScreenName) and the text.
QuickScreenName has been added so you do not have to use the getScreenName of the User object to get
the screen name.

Events:

None

Members:


  DirectMessageID As Long  [read only]

  Message As String  [read only]

  QuickScreenName As String  [read only]

  User As ABUser  [read only]

Members description:

DirectMessageID As Long  [read only]
Returns the ID of the Direct Message
Message As String  [read only]
Returns de text of the Direct Message
QuickScreenName As String  [read only]
Returns the ScreenName of the sender
User As ABUser  [read only]
Returns a full User object that contains more extended information. Uses the slower Twitter API.

ABDirectMessages

Returns an object that contains a list of the DirectMessages

Events:

None

Members:


  getStatus (Index As IntAs ABDirectMessage

  LoadDirectMessagesReceived (Page As IntAs Int

  LoadDirectMessagesSent (Page As IntAs Int

Members description:

getStatus (Index As IntAs ABDirectMessage
Gets a specific Direct Message after using the LoadDirectMessagesReceived()
and LoadDirectMessagesSent() functions
LoadDirectMessagesReceived (Page As IntAs Int
Gets the received DirectMessages
LoadDirectMessagesSent (Page As IntAs Int
Gets the sent DirectMessages

ABFollowers

Returns an object that contains the Followers of the authenticated user.
This is rather slow Twitter API function so use with caution.

Events:

None

Members:


  GetUser (Index As IntAs ABUser

  Load As Int

Members description:

GetUser (Index As IntAs ABUser
Get an Follower from the list filled by the Load() function
Load As Int
Load the Followers of the authenticated user.

ABFriends

Returns an object that contains the Friends of the authenticated user.
This is rather slow Twitter API function so use with caution.

Events:

None

Members:


  GetUser (Index As IntAs ABUser

  Load As Int

Members description:

GetUser (Index As IntAs ABUser
Get an Friend from the list filled by the Load() function
Load As Int
Load the Friends of the authenticated user.

ABStatus

Returns a Status object. This is a tweet that contains the sender (QuickScreenName) and the text.
QuickScreenName has been added so you do not have to use the getScreenName of the User object to get
the screen name.

Events:

None

Members:


  QuickScreenName As String  [read only]

  Status As String  [read only]

  StatusID As Long  [read only]

  User As ABUser  [read only]

Members description:

QuickScreenName As String  [read only]
Returns the ScreenName of the sender
Status As String  [read only]
Returns de text of the tweet
StatusID As Long  [read only]
Returns the ID of the tweet
User As ABUser  [read only]
Returns a full User object that contains more extended information. Uses the slower Twitter API.

ABTimeLine

Returns an object that contains the currently logged in user's timeline

Events:

None

Members:


  getStatus (Index As IntAs ABStatus

  LoadFriendsLast As Int

  LoadFriendsPage (Page As Int, NumberOfTweets As IntAs Int

  LoadFriendsSinceID (Page As Int, NumberOfTweets As Int, SinceID As IntAs Int

  LoadHomeLast As Int

  LoadHomePage (Page As Int, NumberOfTweets As IntAs Int

  LoadHomeSinceID (Page As Int, NumberOfTweets As Int, SinceID As IntAs Int

  LoadMentionsLast As Int

  LoadMentionsPage (Page As Int, NumberOfTweets As IntAs Int

  LoadPublicLast As Int

  LoadRetweetedByMeLast As Int

  LoadRetweetedByMePage (Page As Int, NumberOfTweets As IntAs Int

  LoadRetweetedOfMeLast As Int

  LoadRetweetedOfMePage (Page As Int, NumberOfTweets As IntAs Int

  LoadRetweetedToMeLast As Int

  LoadRetweetedToMePage (Page As Int, NumberOfTweets As IntAs Int

  LoadUserLast As Int

  LoadUserPage (Page As Int, NumberOfTweets As IntAs Int

  LoadUserSinceID (Page As Int, NumberOfTweets As Int, SinceID As IntAs Int

Members description:

getStatus (Index As IntAs ABStatus
LoadFriendsLast As Int
Returns the 20 most recent statuses posted by the authenticating user and that user's friends.
LoadFriendsPage (Page As Int, NumberOfTweets As IntAs Int
Returns the most recent statuses posted by the authenticating user and that user's friends per page.
LoadFriendsSinceID (Page As Int, NumberOfTweets As Int, SinceID As IntAs Int
Returns the most recent statuses posted by the authenticating user and that user's friends per page since an ID.
LoadHomeLast As Int
Returns the 20 most recent statuses, including retweets, posted by the authenticating user and that user's friends.
LoadHomePage (Page As Int, NumberOfTweets As IntAs Int
Returns the most recent statuses, including retweets, posted by the authenticating user and that user's friends per page.
LoadHomeSinceID (Page As Int, NumberOfTweets As Int, SinceID As IntAs Int
Returns the most recent statuses, including retweets, posted by the authenticating user and that user's friends per page since ID.
LoadMentionsLast As Int
Returns the 20 most recent mentions (status containing @username) for the authenticating user.
LoadMentionsPage (Page As Int, NumberOfTweets As IntAs Int
Returns the most recent mentions (status containing @username) for the authenticating user per page.
LoadPublicLast As Int
Returns the 20 most recent statuses from non-protected users who have set a custom user icon.
LoadRetweetedByMeLast As Int
Returns the 20 most recent retweets posted by the authenticating user
LoadRetweetedByMePage (Page As Int, NumberOfTweets As IntAs Int
Returns the most recent retweets posted by the authenticating user per page.
LoadRetweetedOfMeLast As Int
Returns the 20 most recent tweets of the authenticated user that have been retweeted by others.
LoadRetweetedOfMePage (Page As Int, NumberOfTweets As IntAs Int
Returns the most recent tweets of the authenticated user that have been retweeted by others per page.
LoadRetweetedToMeLast As Int
Returns the 20 most recent retweets posted by the authenticating user's friends.
LoadRetweetedToMePage (Page As Int, NumberOfTweets As IntAs Int
Returns the most recent retweets posted by the authenticating user's friends per page.
LoadUserLast As Int
Returns the 20 most recent statuses posted from the authenticating user.
LoadUserPage (Page As Int, NumberOfTweets As IntAs Int
Returns the most recent statuses posted from the authenticating user per page.
LoadUserSinceID (Page As Int, NumberOfTweets As Int, SinceID As IntAs Int
Returns the most recent statuses posted from the authenticating user per page since an ID.

ABTwitter

This library allows you to use twitter.

Permissions:

android.permission.INTERNET

Events:

None

Members:


  ABConnect (ConsumerKey As String, ConsumerSecret As String, Token As String, TokenSecret As StringAs Boolean

  ABDestroyDirectMessage (DirectMessageId As IntAs Boolean

  ABDestroyStatus (StatusId As LongAs Boolean

  ABEnterPIN (PIN As String)

  ABLoggedInUser As ABUser  [read only]

  ABSendDirectMessage (screenName As String, message As StringAs Boolean

  ABToken As String  [read only]

  ABTokenSecret As String  [read only]

  ABUpdateStatus (Tweet As StringAs Boolean

  ABURL As String  [read only]

Members description:

ABConnect (ConsumerKey As String, ConsumerSecret As String, Token As String, TokenSecret As StringAs Boolean
Makes a connection with Twitter. If Token and TokenSecret are empty then an URL is generated
which can be used in a browser. The user can then give the app permission to access Twitter with a PIN.
You best then save the Token en TokenSecret on the device so the user does not have to enter the PIN
every time.

ConsumerKey(String): the ConsumerKey generated by Twitter when registering your app
ConsumerSecret(String): the ConsumerSecret generated by Twitter when registering your app
Token (String): the Token generated by Twitter when the user entered the PIN
TokenSecret (String): the TokenSecret generated by Twitter when te user entered the PIN

Example:
 
Dim Ret As Boolean
 
Dim List1 As List
 
Dim sdRoot As String
 
Dim Token As String
 
Dim TokenSecret As String 
 sdRoot = File.DirRootExternal & 
"/"
    
 
If File.Exists(sdRoot, "ABTwitter.txt") = False  Then
     Ret = myABTwitter.ABConnect(
"PKADfNWSCNc1TTTpcsDcM""Y0gYdZFdX78HmOObH1fLRkX6rbySxdxm8iRqpv14Ac""""")
     
If myABTwitter.ABURL <> "" Then
         
Dim p As PhoneIntents
         StartActivity(p.OpenBrowser(myABTwitter.ABURL)) 
     
End If
 
Else
     List1 = File.ReadList(sdRoot, 
"ABTwitter.txt")
     Token = list1.get(
0)
     TokenSecret = List1.Get(
1)
     Ret = myABTwitter.ABConnect(
"PKADfNWSCNc1TTTpcsDcM""Y0gYdZFdX78HmOObH1fLRkX6rbySxdxm8iRqpv14Ac", Token, TokenSecret)
     DoSomething
 
End If
ABDestroyDirectMessage (DirectMessageId As IntAs Boolean
Destroys a direct message

DirectMessageId (int): the ID of the direct message

Example:
 
dim Ret as boolean
 Ret = ABDestroyDirectMessage(dmId)
 
ABDestroyStatus (StatusId As LongAs Boolean
Destroys a tweet from the timeline

StatusID (long): the ID of the status

Example:
 
dim Ret as boolean
 Ret = ABDestroyStatus(StatusId)
 
ABEnterPIN (PIN As String)
After the user enters his login and password of his twitter account in the webbrowser
a PIN is returned. The user has to enter this PIN in your app. After entering the pin
you can retrieve ABToken and ABtokenSecret and save it for future use.

PIN (String):the PIN returned by Twitter in the webbrowser

Example:
 myABTwitter.ABEnterPIN(editText1.Text)
 Ret = myABTwitter.ABConnect(
"DfNWSCNc1TaTpcsDcMPKA""Y0gYdZFdX78HmoybH1fLRkX6rbySxdxm8iRqpv14Ac", myABTwitter.ABToken , myABTwitter.ABTokenSecret)
    
 
Dim sdRoot As String
 
Dim List1 As List
 sdRoot = File.DirRootExternal & 
"/"
     
 
If File.Exists(sdRoot, "ABTwitter.txt") = False Then
     
If File.ExternalWritable = False Then
           Msgbox(
"Cannot write on storage card.""")
    
End If
     List1.Initialize
     List1.Add(myABTwitter.ABToken)
     List1.Add(myABTwitter.ABTokenSecret)
     File.WriteList(sdRoot, 
"ABTwitter.txt", List1)
 
End If
     
 DoSomething
ABLoggedInUser As ABUser  [read only]
Returns the logged in user.
ABSendDirectMessage (screenName As String, message As StringAs Boolean
Sends a message directly to someone

screenName (String): Name of the person you want to send the message to
message (String): the message to send

Example:
 
Dim Ret as Boolean
 Ret = ABsendDirectMessage(
"SomeOnesScreenName""A message personally for you")
 
ABToken As String  [read only]
the Token to connect to Twitter (Example see ABconnect)
ABTokenSecret As String  [read only]
the TokenSecret to connect to Twitter (Example see ABConnect)
ABUpdateStatus (Tweet As StringAs Boolean
sends a tweet to your timeline

Tweet (String): the text you want to send

Example:
 
Dim Ret as Boolean
 Ret = ABUpdateStatus(
"this is my frist tweet!")
 
ABURL As String  [read only]
If the Token and TokenSecret where empty in ABConnect then this variable returns the URL
that must be opened by a browser (see ABConnect for example)

ABUser

Returns an object that contains user information. This can be yourself, a friend, a follower or the sender of an tweet

Events:

None

Members:


  getDescription (OnlyThis As BooleanAs String

  getImageUrl (OnlyThis As BooleanAs String

  getLocation (OnlyThis As BooleanAs String

  getName (OnlyThis As BooleanAs String

  getScreenName (OnlyThis As BooleanAs String

  UserID As Int  [read only]

Members description:

getDescription (OnlyThis As BooleanAs String
Gets the description. If you only want to retrieve the description, set OnlyThis = true
to speed up the slow Twitter Retrieval functions
getImageUrl (OnlyThis As BooleanAs String
Gets the url to the user image. If you only want to retrieve the url to the user image, set OnlyThis = true
to speed up the slow Twitter Retrieval functions
getLocation (OnlyThis As BooleanAs String
Gets the location. If you only want to retrieve the location, set OnlyThis = true
to speed up the slow Twitter Retrieval functions
getName (OnlyThis As BooleanAs String
Gets the user name. If you only want to retrieve the name, set OnlyThis = true
to speed up the slow Twitter Retrieval functions
getScreenName (OnlyThis As BooleanAs String
Gets the screen name. If you only want to retrieve the screen name, set OnlyThis = true
to speed up the slow Twitter Retrieval functions
UserID As Int  [read only]
Gets the user ID
Top