Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android framework. What is it? [closed]

Tags:

android

I've few questions on Android Framework. Can someone please answer them

  1. What does an Android Framework do? What is it's job?

  2. What are these managers - Activity Manager, Location Manager etc? Are they APIs or libraries?

  3. I heard that the definition of a framework is - a set of libraries that say “Don’t call us, we’ll call you.” So can I say that Activity Manager, Location Manager etc are such libraries? Or is it that they are not libraries but APIs (used to access underlying c/c++ libraries) and the actual libraries that do "Don't call us, we'll call you." are hidden from us?

like image 654
Confused Avatar asked Jun 03 '10 16:06

Confused


2 Answers

  1. The android framework is the set of API's that allow developers to quickly and easily write apps for android phones. It consists of tools for designing UIs like buttons, text fields, image panes, and system tools like intents (for starting other apps/activities or opening files), phone controls, media players, ect. Essentially an android app consists of Activities (programs that the user interacts with), services (programs that run in the background or provide some function to other apps), and broadcast receivers (programs that catch information important to your app). The best way to learn this system will be to go through the Google Tutorials found here

  2. AcitivityManager and LocationManager are examples of classes found in the android sdk (the framework). I do not know of any use for these classes, as I believe they are part of the system. I have never used them, but if you wanted to learn more about them i would look at the Android API

  3. I believe your question is a bit 3 dimensional:

    • A library is a code source that a developer and add to their application. It is not source code, thus the inner details are hidden to the developer. You can only access the visible (public) parts.

    • An API is the documentation that accompanies a library to explain how to use the library (an example of this is the Android API listed above)

So to answer your question, ActivityManager and LocationManager are neither libraries nor APIs. Rather, they are classes within the Android SDK (which is a library) that are used by either the system, or the developer (if he can find any use for them). Also, everything in android is Java, so you wont find any C/C++ libraries for android

I hope that this answer was helpful for you.

like image 188
mtmurdock Avatar answered Sep 22 '22 13:09

mtmurdock


The Android Framework is the entire stack of stuff that makes up the OS. This is the underlying Native libraries that are not directly accessible, the layer above that that you actually interact with and the code that developers write to run on the system. Yo are confused about Libraries vs APIs. Libraries are just chunks of useful code, APIs are the interface to those libraries. API actually stands for Application Programming Interface. The Managers do exactly what it says on the tin! The Activity Manager is the class that manages Activities, the Location Manager manages your current location.

like image 41
CaseyB Avatar answered Sep 21 '22 13:09

CaseyB