Monday, 14 February 2011


THE TWITTER API METHODS

The API method currently maintained by twitter can be organize into the following group based on what they are used for :

Publishing : this include changing the content published to twitter.
The information stream : This include retrieving and managing content publish to twitter .
The follow network : this include managing the people that follw a user and whom a user is following.
Communication: this involve exchanging the direct message with other member
Member account: dealing with twitter account
Administration: it negotiates access to twitter API.
Search: involves looking for key words in twitter achieves

Publishing

This method can be us to publish content or remove it from twitter information system.
Post a tweet : this method adds a tweet to information  stream for  authenticared users . This is an update of a current member’s status:


to make this URL function authentication is requested. since it requires a change to the service data base , the POST method is is required to encapsulate the parameter data. When a posting of a tweet is successful, twitter returns XML containing information about the new update.

Delete a tweet:  status update can be deleted after  being posted. However , it can only be successful if the authenticated is also the author of the update to be removed.

https://twitter.com/statuses/destroy/id.xml

The id parameter is required to identify to which specific character update is to be deleted or destroyed. If the request  is successful , twitter returns the status object information.

The information stream of twitter: the collection of publish tweets create a flow of information in twitter . There is a public time line of update fed by all account that are not configured to be private and are therefore available for anyone to take a look at..

  •  Show a tweet : this helps to view details for a single status update.
https://twitter.com/statuses/show/id.xml
this can be changed to json by editing the URL and changing the .xml to .json.
Authentication is not required as long as the tweet is public. Authentication is required if the post is from a private authors.

View the public time line

This method returns 20 most recent status update from public account in twitter.  Authentication is not needed.

https://twitter.com/statuses/public_timeline.xml

View a friend time line:
A method of API to access recent tweet from a specific user. A friend time line method returns 20 most recent status update posted by authenticated user and the author that a user follows.

https://twitter.com/statuses/friends_timeline.xml

a successful request returns XML that is the same with the data returned by the view the public time line method. There are several optional parameters that can be used to filter the data that is returned. Three of this parameter are since, since_id, count. These will change the number of returned id by cutting out the older tweet. The since_id parameter identifies a specific status ID. The count parameter shows the number recent tweets to show.

View an individual time line   
This stream contain tweet that was published by a single author. it returns 20 most recent status update by authenticated user.

https://twitter.com/statuses/user_timeline/id.xml

Authentication is needed for this method.

View replies
Replies are status update that reference twitter member.
https://twitter.com/statuses/replies.xml


View favorite
 This returns 20 most recent favorite statuses for the authenticated users.
https://twitter.com/favorites/seyi.xml


Sunday, 13 February 2011

HTTP STATUS CODES IN TWITTER

Status code is a series of information returned to client in HTTP request.  It is a series of three digit number used to communicate the type of success or failure encountered after making a request. The twitter API assigns special meaning to this code which describe specific outcome of method request.
Examples of codes:
200—OK
Success! The method request did what you expected it to do.
304—Not Modified
Nothing wrong, but nothing to report.
400—Bad Request
This can be caused by one of two things: either the request was formatted incorrectly
(missing required parameters, unknown method, etc.), or the rate limit has
been exceeded. Check the returned text for an explanation.
401—Not Authorized
The account (Twitter username or registered email address) or password you used
to authenticate to the API isn’t working. Check its accuracy and try again.
403—Forbidden
Twitter understood what you want to do, but won’t let you do it. Check the returned
text for an explanation.
404—Not Found
Probably caused by a typo or incorrect path to the API method you are requesting.
You might also get this error when trying to request a nonexistent user.
500—Internal Server Error

Status code helps in error handling.


REST

The design of twitter API uses the principle of Restful system. This is called representational state transfer. REST is an architectural design or style which can be employed to create a web service that focus on system resources. This also   involves how resource states are issued and sent over a HTTP by different client written in different languages.
Basic design principle involve in REST are usage of HTTP more explicitly , Stateless , expose directory  structure ( like URL) , transfer XML , Java Script object notation or both.

Explicit usage of HTTP method

One of the futures of a RESTful web service is a detailed application of HTTP method in a way that follows protocol as laid out by RFC 2616. twitter API permit 4 kind of  HTTP request.: GET , POST , DELETE and UPDATE.

GET
 The Get method accepts URL and uses it to retrieve something from another server after necessary processing is done. If the web server is PHP web page , the Get method will capture the HTML generated by the   PHP and not the PHP code itself. GET method is use to carry out query, in which the web server will process the query and produce the result with the issued query. GET is a method that must be free from side effect call idempotent, must not have side effect for performing Get operation , and must be cacheable.  
Example of twitter API that are accessed with GET methods:


https://twitter.com/direct_messages.xml
https://twitter.com/favorites.xml
https://twitter.com/followers/ids.xml
https://twitter.com/friends/ids.xml
https://twitter.com/friendships/exists.xml
https://twitter.com/help/test.xml
https://twitter.com/statuses/followers.xml
https://twitter.com/statuses/friends.xml
https://twitter.com/statuses/friends_timeline.xml
https://twitter.com/statuses/public_timeline.xml
https://twitter.com/statuses/replies.xml
https://twitter.com/statuses/show/id.xml
https://twitter.com/statuses/user_timeline.xml
https://twitter.com/users/show/id.xml

The following can be written in json by changing the XML extension to json.


POST
The POST method is required for API method that actually makes changes to twitter severs, rather than just retrieving data.  POST is use to establish a resources on a server. In twitter API the following method required POST request handling:

https://twitter.com/account/update_delivery_device.xml
https://twitter.com/account/update_location.xml
https://twitter.com/account/update_profile.xml
https://twitter.com/account/update_profile_colors.xml
https://twitter.com/account/update_profile_background_image.xml
https://twitter.com/account/update_profile_image.xml
https://twitter.com/blocks/create/id.xml
https://twitter.com/blocks/destroy/id.xml
https://twitter.com/direct_messages/destroy/id.xml
https://twitter.com/direct_messages/new.xml
https://twitter.com/favorites/create/id.xml

DELETE

The purpose of this type of HTTP call is to instruct the remote server to remove the requested URL resources. The DELETE method must be idempotent which means the request can be done in multiple times.

   https://twitter.com/blocks/destroy/id.xml
https://twitter.com/favorites/destroy/id.xml
https://twitter.com/friendships/destroy/id.xml
https://twitter.com/direct_messages/destroy/id.xml
https://twitter.com/statuses/destroy/id.xml

  





                            INTRODUCTION TO TWITTER AND TWEET


  Twitter is an example of a micro blog. Based on usage twitter can also be referred to as a short message service. Twitter is an online social network that is used to stay in touch with friends’ family members and coworker through computers and mobile phone. The interface of twitter allows users to post short message of about 140 characters that can be viewed by any other person that uses twitter. Twitter allows people to declare the people they interested in following and those people will be notified. The follower gets to see the message whenever the people they are following get to post anything.
            Twitter users are allowed to update directly and indirectly.  Direct post is when a user targets a specific person in her post. Indirect post is when an update is for anyone that feels like reading it. The term use for someone that has interest in the status of another is called follower.
             In most cases, there are two categories of twitter user. The first category is those that have a large number of followers that those they are following. The other category is those that follow more people that they follow than people following them. The number of friends might be used to know if a user is active or not.

What is tweet?

The message posted on twitter is called a tweet and the maximum tweet that is allowed is 140 characters. To receive or send a tweet, a user must open a free account with twitter.  Twitter can be use  as a blog  and be kept public meaning anyone can read all tweets kept public on personal twitter profile page of a user. Network of contracts can be built by inviting other twitter users to read tweets.
Limitation of tweets
A tweet can only contain 140 characters. Text are only allowed  but no pictures or videos are allowed. A picture or video or any multi media can only be included in a tweet indirectly. This is achieved by locating a web that can host the files and sending a message that contain the page address to twitter networks. Twitter changes all address that more than 30 characters into tiny URL. tiny URL  is  a URL shortening service that converts long URL into different short URL but can be redirected to the long URL which is the main address.

Web syndications used in twitter   

Web syndication is the gathering of application from one source and sending it out to different destinations. There are different syndication format used on the web but twitter is compatible with two of them. the two syndication employed by twitter are : really simple syndication , otherwise known as RSS and Atom format called Atom. Both format can be use to collect data from one source and then transfer it to another. Atom and RSS consist of a few lines of codes which can be embedded by a web based administrator into his or her own site’s code. Visitors can register to  this syndication service called the feed and get an update every time an administrator post any new materials on the web sever. Twitter uses these features to allow twitter members to post a message to a network of other twitter members and also allows twitter member to subscribe to other twitter members field.






Monday, 7 February 2011

CAPABILITIES OF ANDROID

In the year 2008, The Open Handset Alliance introduced the android platform and a beta program for developers was announced.
            Since the introduction of android, there has been a lot of improvement on it and a lot of functions and capabilities have been introduced to the world market. Some of android capabilities include :

ABILITY TO USE CONTACTS APPLICATION PROGRAMING INTERFACE

The enhance contact API of the platform of android allows the management and integration of contacts from several accounts and from other sources of data. To avoid mixing up of data from several sources, there is an arrangement and presentation of contacts that belong to same group as a single entity.
            In contact application programming interface, data is divided into contact, raw contacts and data. . This gives room for simplicity of storage and management of a particular contact from various contacts.

            Data is made up of table that contain all data point that has to do with a raw contacts. A particular row comprises of the same set of data. Each row is MIME type labeled. This shows the data that can be found in a particular row. E.g if the type of data a row can contain is photo.content_ITEM_TYPE , it means the column only keep a record of photo. On the other hand, each row in a raw contacts table contains information about an object and it is associated with a single contact source. E.g a row can contain a person’s twitter followers or hub pages followers.
A row in contact table contains group of one or several raw contact pointing to a particular object.

FASTER SCREEN ORIENTATION CHANGE
 Android is built to operate effectively on different array of device , that has a different configuration of hardware.
            Process of changes in configuration is automatically done by Android system. The current process will be reloaded with the new configuration.

DRAWABLE MUTATION



Sunday, 6 February 2011

WHAT IS ANDROID


Android is a software stack for mobile device that includes an operating system, middleware and key application.

THE ARCHITECTURE OF ANDROID
Several component of android are design as a stack which ranges form “Application” to “linux kernel.” Application is the upper layer of the stack while linux kernel forms the lowest layer.
 Application: All application is written using a java program. The set of application in android include home, contact, phone, browser, e.t.c.

Application Frame Work: There are no differences between the frame work application interface used by the developers and the one used by the core applications.
          The Application infrastructure has been made so simple that it allows the re-use of component. Publishing and re-using of existing application capabilities by other application is always allowed. Replacements of components by the user are allowed.
Application frame work includes:  

1.Activity manager.  2. Window Manager. 3. Content Provider. 4. View System. 5. Notification Manager.  6. Package Manager. 7. Telephony Manager. 8. Resource Manager. Location Manager. 10.XMPP Service.

Libraries

Various components of Android system make use of set of c/c++. These capabilities can be accessed by the developer by going through the android application frame work.

Android Runtime

Android comprises of:

1.     Core Libraries
2.     Dalvick Virtual Machine

Most of the functionality available in the java programming language core libraries is also available in the core library of android. Application of android runs uniquely with its own process, with its own type of Dalvik virtual machine. One of the advantage of using dalvik is that, it allows a device to run effective multiple VMs.
“VM is registered based , and runs classes compiled by a java language compiler that has been transferred into the .dex  format by the included dx tools.” [http://developer.android.com/guide/basics/what-is-android.html]

Linux Kernel

Linux kernel comprises of :
1.     Display Driver.  2. Camera Driver. 3. Blue tooth Driver. 4. M-System Driver. 5. Binder (IPC) driver. 6. USB Driver. 7. Key Pad Driver. 8. Wi Fi Driver. 9. Audio Driver. 10. Power Management.
Core system service like security , memory management , network stack and driver model in android uses linux 2.6.
“The kernel also acts as an abstraction layer between the hardware and rest of the software.” (www.linux.com).