Application Programming Interface (API)

AI Thread Summary
An API, or Application Programming Interface, is a set of rules and specifications that allows software programs to communicate and utilize each other's services and resources. It functions as an interface between different software applications, similar to how a user interface allows human-computer interaction. Common examples of API usage include programming languages like Java, where the API for classes such as "String" outlines available functions and methods for developers. To study APIs, one typically consults the relevant documentation, which details the functions, constructors, and properties available within the API. Programming courses often include instruction on using APIs, particularly those for basic operations like input and output. Understanding how to create instances of classes and call functions with the correct parameters is essential for working with APIs. Importantly, an API itself serves as the interface, distinct from graphical user interfaces found in operating systems.
jackson6612
Messages
334
Reaction score
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.
 
Technology news on Phys.org
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
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:
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?
 
symbolipoint said:
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

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:
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...
Back
Top