Application Programming Interface (API)

  • #1
332
1
An is a particular set of rules and specifications that a software program can follow to access and make use of the services and resources provided by another particular software program that implements that API. It serves as an interface between different software programs and facilitates their interaction, similar to the way the user interface facilitates interaction between humans and computers. -- Wikipedia

Hi

I'm a layman but would like to know any two common software programs where one uses the API (whatever it is!) of another programs. Could you please help me to satisfy my curiosity? Thanks a lot.
 

Answers and Replies

  • #2
595
0
An API is exactly what it says... the specified interface to a chunk of software. The bits and pieces in the API are usually function names with associated arguments and some vague description of what the effects of calling that function might be.

I just posted this on another thread:
http://download.oracle.com/javase/1.4.2/docs/api/java/lang/String.html [Broken]
It's an example of the API for a particular Java Class, "String". It says what that piece of software contains and does.

Usually the name "API" is applied to the interface to some larger application, rather than just a single class. But it all depends on the level at which you are working.
 
Last edited by a moderator:
  • #3
symbolipoint
Homework Helper
Education Advisor
Gold Member
6,160
1,180
How do you study these APIs? Are they taught in any programming courses in colleges? What should someone study and learn before beginning to study APIs? What is that interface for APIs? Is it something like a window in the way you find when you open a Windows program by clicking on it?
 
  • #4
34,893
6,633
How do you study these APIs? Are they taught in any programming courses in colleges? What should someone study and learn before beginning to study APIs? What is that interface for APIs? Is it something like a window in the way you find when you open a Windows program by clicking on it?
To answer your questions in order -
1) One usually consults the documentation for the API of interest. For example, someone in another thread was trying to write an application using strings in Java. The API for the String class in Java can be found here: http://doc.java.sun.com/DocWeb/api/java.lang.String [Broken]

The members of this API include a number of constructors that are used to create instances of this class; a number of methods that can be used on a String instance, such as concat(), length(), and others; properties such as isEmpty, which evaluates to true if the string is empty.

2) Programming classes typically show how to use some API for reading data from the keyboard or displaying data to the monitor and other things. When I learned C many years ago, an API we were exposed to early on was the functions declared in stdio.h, a "header" file with declarations of functions that do what I said in the previous sentence. About all you need to know to use an API is how to create an instance of a class (if the API is for a class) or how to include a header file, and then how to call a function by passing the right number of parameters of the right type and storing the returned value.

3) There is no interface for an API. The API is the interface, which tells you what a given library of functions etc. provides.

4) An API is not related to clicking an icon in Windows or other OS.
 
Last edited by a moderator:

Related Threads on Application Programming Interface (API)

Replies
4
Views
6K
  • Last Post
Replies
1
Views
2K
Replies
2
Views
14K
  • Last Post
Replies
13
Views
502
  • Last Post
Replies
1
Views
1K
Replies
5
Views
2K
Replies
1
Views
2K
Top