I'm developing an app, and I need to animate some simple stuff, I manage to did it by using the Transition Framework, however it is not supported in android versions prior KITKAT(API LEVEL 19), I would like to know some alternatives to make some simple transitions in older devices, thank you.
You can use the following libraries:
TransitionsBackport
transitions-everywhere
SmoothTransition
PreLollipopTransition
android-transition
Related
I am getting started with Android. I am quite confused with what support library actually does . I am following a book and in the book it is mentioned that :
If an app is installed on a minimum SDK system, and our Java code
contains any calls to classes that are not present in minimum SDK ,
our app will crash
I read an article about support libraries here:
Tutorials Point
If Support libraries provide backward compatibility, doesn't it mean when they should prevent app crash?(may be by wrapping up those newer classes and making them backward compatible). What does support library actually do? Please explain.
When should I use the Android Support Library?
As new versions of Android are released, some style and behaviors may change. You should use one of the support libraries when you need specific framework features that are newer than the minSdkVersion of your app or that are not available in the standard framework.
What does support library actually do?
There are many devices still running in Jelly bean and below versions. So you need to give the same importance for old and new devices While making an app. Otherwise, the App in old devices looks dull when compared to new ones. That may affect the app’s market. To avoid this trouble, Android introduced the Support library. These are set of code libraries provides backward compatibility
Example:
Fragment API was introduced in API 11 HONEYCOMB .android.app.Fragment is the Fragment class introduced in API 11 and android.support.v4.app.Fragment is the Fragment class in the android support library,
If you want to make your app use fragments, and want to target devices before API 11, you must use android.support.v4.app.Fragment. However, if you want only targeting devices >=API 11 ,you can use android.app.Fragment.Therefore, android.support.v4.app.FragmentManager is used to deliver newer features to older platforms.
For more info about android support library:doc
1.Suppose you want to create an app which runs on platform comes after marshmallow.
then minimum sdk of your app will be marshmallow.
2.While creating your app you call a method which is present in oreo or later version then you app will have chances to crash on marshmallow and nougat.
I am learning Android development but I am really getting confused by all the AppCompat stuff. I may be wrong, but AppCompat allows the use of modern elements like Material Design on older Android version (lower than API 21). That's cool, but for the purpose of my learning, I wanted to create a pure API 21+ application, without caring about retro compatibility.
So I could use the "native" android:Theme.Material instead of Theme.AppCompat.xxx. But when it come to Toolbar it seem that I can't use it without a AppCompatActivity...
It's really confusing for me, Google seems to release new components that are only compatible on API 21+ but you can't use them without using retro-compatible activities ??
If someone could clear things out a bit, I would greatly appreciate that.
But when it come to Toolbar it seem that I can't use it without a AppCompatActivity
Bear in mind that there are two Toolbar classes:
android.widget.Toolbar, which is available on Android 5.0+ (API Level 21+)
android.support.v7.widget.Toolbar, which requires appcompat-v7 and AppCompatActivity and all of that, but will work going back to API Level 14 (and, with older versions of appcompat-v7, back to API Level 7)
So, you choose the Toolbar implementation that matches your chosen environment.
what is the version of android from which further on there is no concept of incompatibility(no need of support libs). I am a newbie and this supporting and non supporting thing is making it so boring. I just want to know of a stable version from which I should take start and do not use support libraries (like appcompat, sherlock, etc). Also tell me if I am doing a wrong thing doing this I mean anything that will help me. Thanks
Any relevant help is appreciated.
As an app developer, you'd like your app to run on as many devices as possible. Generally, developers give support from API level 8 (Android 2.2) and upwards.
Most of the compatibility libraries are for pre-API 11 (HoneyComb).
So basically, it depends upon what you want to aim for.
Edit
You might be interested in checking out Choosing the right API Level for my android application.
property animator API introduced in Android 3.0,it can't work in Android 2.0.Is there any method make property animator API work in the android system which below 3.0?
NineOldAndroids is a library created by the legendary Jake Wharton that brings the Android 3.0 Animation APIs all the way back to Android 1.0 . It has 1-to-1 API comparability, which means all the examples you see on the web will work and you don't have to update too much when everyone inevitably drops support for pre-3.0 devices.
I am in the process of making my application compatible with the earlier versions of android using the Android Compatibility library. One of the integral parts of my application is to be able to highlight the user's selection permanently in a list fragment. I was able to do this conveniently using a selector drawable in API level 11 and above using the android:state_activated property. But as it turns out this property was introduced only in API level 11.
Now I plan to achieve the same in earlier API levels, but am out of ideas. Does anyone have any suggestions?
I believe I'll need to create a separate layout for older API versions - res/layout-v10/
Thanks!
Found an excellent solution here: http://udinic.wordpress.com/2011/07/01/selectablelistview-make-selection-work/
View.setSelected(boolean) (since api level 1) made the trick for me