0

I would like to know whether android has supports for the older versions. There are 15 different levels for android currently and I wonder about the followings.

  1. Can a project made on level 5 be used on the devices whose level higher than 5?

  2. How can I find the detailed differences between all the levels. For example, android.widget.VideoView starts with which level?

  3. Assume I made a project based on level 8 nowadays and after a while like 2 years, level 20 has been introduced by that time. And I would like to use one of the classes that belongs to the level 20. I guess there is no way for me to use that class without upgrading my project level to the 20. In this case, is it possible that level 20 doesn't accept some of the classes I used with level 8? If yes, what can be the solution? Can I download the jar file of level 20 and reference it in my project manually? If possible, does this mean that I don't have to upgrade my project level to 20 in order to use classes of level 20?

I am going to start a project in a few days. However, I didn't decide the level yet. I got confused the differences of levels.

Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140

3 Answers3

1
  1. Yes
    Until know all Levels are backward compatible and most likley this will continue a while.
  2. http://developer.android.com/reference/packages.html -> Filter by API Level
  3. Yes you have to upgrade. But you can set the compatibility to a level below that. Than you have to take care that none of the Methods of lvl 20 will be executed in lvl <=19. You can do this by determine the current Version while running your App
    Build.VERSION.SDK_INT gets you the API level.
Thommy
  • 5,070
  • 2
  • 28
  • 51
0

Hope this helps:

1- Yes A project made on lower levels will work on higher levels.

2- In the page of the component. For example for android video view you can check in the top right corner SINCE: API LEVEL 1

3-You are right, if you want to use level 20 classes your project will have to be upgraded to level 20, but as far as I know there are no compatibility issues for higher versions. You should take note about the deprecated classes though. Avoid using them because they might not be available later.

caiocpricci2
  • 7,714
  • 10
  • 56
  • 88
  • Can I download the jar file of level 20 and reference it in my project manually? If possible, does this mean that I don't have to upgrade my project level to 20 in order to use classes of level 20? – Emrullah Kızıltepe Mar 01 '12 at 16:30
  • As a general rule no you cant. The api 20 offers services that the api 8 doesn't have, so you can't use them. Even the devices might not have that functionality. But btw why are you so worried about that? – caiocpricci2 Mar 02 '12 at 09:17
  • If I don't determine all the possibilities about the future of my application, I can't feel good :) That's why I strain a gnat. Thanks for your answers. There is one thing I couldn't understand. Assume I use a deprecated class in my project based on android 3.0. After a while, android 5.0 is launched exactly without support of those deprecated classes. In this case, will I be able to run my application on android 5.0 devices? I mean, I don't try to upgrade my application to the 5.0 since I have to change my source code, I just wonder about whether 5.0 devices can use my application. – Emrullah Kızıltepe Mar 02 '12 at 13:21
  • No, they won't be able to use it. And I am not sure even if the 3.0 will be able to use if they decide to remove it! So it's better to not use it at all! – caiocpricci2 Mar 02 '12 at 16:25
0

1 - yes. Android devices support running code from older levels.

2 - look through the Android docs. It even lets you filter by API level.

3 - Higher levels always let you use the lower level classes. It's just not recommended.

To decide what to support, I looked at the current distribution dashboard to see what was really out there and using the market. I went with level 7 for what I was doing, but that's just me. Level 8 would also be a good place to work from.

Also, if you want to access the better parts of the API on supported devices, but still work on older versions of the API, there's advice in the answers to this question.

Community
  • 1
  • 1
Michael Kohne
  • 11,888
  • 3
  • 47
  • 79