PrintManager class is add from api level 19.
how to implement printing functionality in below api level 19 in android.
Check out the Android Support Libraries designed to provide backward-compatible versions of Android framework APIs as well as features that are only available through the library APIs. Each Support Library is backward-compatible to a specific Android API level. This design means that your applications can use the libraries' features and still be compatible with devices running Android 1.6 (API level 4) and up.
If you look through the revision history you can see that
Android Support Library, revision 19.0.1
Changes for v4 support library:
Improved PrintHelper by adding asynchronous handling of printing.
You can find details of the support libraries here
There is no support for printing at the OS level in Android 4.3 and below. You will need to use some sort of third-party software, such as Google Cloud Print, or perhaps an application from your printer manufacturer. Details for how to use such software should come with that software.
Related
Does anyone know what the lowest minimum API level is for Android projects that don't require any Support Libraries? 21 or 22 was my guess but I may be wrong. I don't need any Support Library features for my future project.
Does anyone know what the lowest minimum API level is for Android projects that don't require any Support Libraries?
API Level 1. After all, the Support Library did not come into existence until after API Level 11 shipped. We developed Android apps for a few years without such a library.
If you are asking what is the min sdk to support in order not to have to use support library then the answer is there is not such a thing. You will end up using a support library in the future because android api is always being updated.
If you do not want to use library supports then you need to develop apps to use only basic features including in API 1.
I am new to android app development.I don't understand what the android support library is?.Is it included in android framework APIs like API level 17,18 or is it separate API which can be included in projects.Thanks in advance!!
Is it included in android framework APIs like API level 17,18
No.
or is it separate API which can be included in projects
Yes.
Quoting the documentation:
The Android Support Library package is a set of code libraries that provide backward-compatible versions of Android framework APIs as well as features that are only available through the library APIs. Each Support Library is backward-compatible to a specific Android API level. This design means that your applications can use the libraries' features and still be compatible with devices running Android 1.6 (API level 4) and up.
I'm trying to implement cursor loaders into my android app. When I write the code for LoaderManagers, eclipse prompts me to import the correct libraries. However there are two options which appear to be the same; android.app and android.support.v4.app. Whats the difference between these two, and which one should I use?
The Android Support Library package is a set of code libraries that provide backward-compatible versions of Android framework APIs as well as features that are only available through the library APIs. Each Support Library is backward-compatible to a specific Android API level. This design means that your applications can use the libraries' features and still be compatible with devices running Android 1.6 (API level 4) and up.
This both are different library android.app is for the i.e. Fragment which are available from the API level 3.0 and above. So to use the Fragments in below api's you have to use its backword compatible libraries form android.support.v4.app to support below the API level than 3.0. So android has provided the flexibility to provide the support in lower version using android.support.v4.app library.
Each Support Library is backward-compatible to a specific Android API level. So whenever you are implmenting anything which is available in 3.0 but not below then you should use its support library.
If I want to develop an app for API 7 through to 18. I understand I should set minSdkVersion to 7 in the manifest, and I assume I should set 18 as targetSdkVersion. But I'm confused by what SDK I should use for development. Should I be using the SDK for 2.1 (API 7) or 4.3 (API 18)? I don't want compatibility behaviours as I want to completely control and specify what to do on each platform version. And what about the support library? Would I use support libraries 8-18 or 1-7?
(Posted here because development questions are off-topic for android.stackexchange.com)
You can and should use the newest SDK. Eclipse or Intellij will automatically take care of letting you know if you are attempting to use a component that is only available in newer APIs. You will only want to use support library v7 and below since you intend on supporting API 7 and above. A lot of your worries will automatically be taken care of by your IDE. It will let you know if you are trying to use things that are not available in your minimum API level (which you indicate in your manifest file).
I am trying to create an Application on Android and want to target apps all the way down to Android 2.2.
I am a bit confused on how to configure the application
Min SDK: 2.2
Target SDK: 4.1
Compile SDK against: 4.2
This is the default config i got when i created a new Android Project.
Should i still need to use ActionBar Sherlock to support the older versions ?
Unless you are using any API's not available for lower versions, you will not require any additional libraries like ActionBarSherlock.
However, if you are using any specific API's and want to make them backward compatible, for example Fragments, ActionBar, etc then you can make use of the Support Library which supports a minimum API level of 4.
Quote from the Support Library Page:
Minimum API level supported: 4
The Support Package includes static "support libraries" that you can
add to your Android application in order to use APIs that are either
not available for older platform versions or that offer "utility" APIs
that aren't a part of the framework APIs. The goal is to simplify your
development by offering more APIs that you can bundle with your
application so you can worry less about platform versions.
ABS is an extension of the Support Library. This is from the ABS page Link: ActionBarSherlock:
The library will automatically use the native action bar when
appropriate or will automatically wrap a custom implementation around
your layouts. This allows you to easily develop an application with an
action bar for every version of Android from 2.x and up.
To summarize, if you are making use of API's not available in older SDK's, then you can use either of the two listed above. If you are not using API's specific to newer SDK's, you will not need ABS or the Support Library.
Min SDK = Least API you want to support ie., 2.2
Target SDK = API you want to test on. If not set will take default value as Min SDK. Usually target will be the Max API you want to support or the Latest API. This is to tell the Application to use the latest API Features, but if not possible allow backwards compatibility.
I never heard about Compile SDK
and you don't need any Support libraries if you are using only 2.2 API elements.
For something like Fragments etc.., which are not present in <3.0 API you must use Support Libraries.