-1

I'm having some errors with running a developed application on a device with android 6.0.1 that runs perfectly on a device with Android 2.3.6. I'm using the same built application (compiled for an Android API 10) for both devices.

The errors are about the application being closed when a new Activity starts and when a contact is selected, I know how I could solve those problems for that device, but problem is that from what I had read I thought that android had no problems with being functionally backwards compatible (maybe there could be some graphical issues but nothing that would make the application crashing, as it is happening to me).

So I'd like to know if this is just some exceptional event that has happened to me, and the most likely thing is that, once I check these errors in some more android versions and fix the code of the app to run on them, something like these errors is not going to happen again, or if events like that are relatively common. If that's the case it sounds pretty painful to have to check and maybe develop accordingly for a lot of versions, so I'd like to know if there's some shortcut which, even if it doesn't offer 100% security of having the application correctly functionally developed, it gives a good percentage of security.

comrade
  • 4,590
  • 5
  • 33
  • 48
user2638180
  • 1,013
  • 16
  • 37
  • since the app targets a version before marshmallow, it doesn't check for permissions in runtime. Maybe your app requires permissions that the user have to explicitly allow in the settings – nandsito May 14 '17 at 12:55
  • @nandsito Thanks for your comment, problem wasn't there. Anyway the objective of the question is to know if those type of errors are common or not when running the app in different versions of Android, and if they are, how to properly treat them, I'm telling about the errors on my application just to make more clear which type of errors I'm refering to. – user2638180 May 14 '17 at 13:10
  • 1
    backward compatibility is a theoretically desirable software property in general, and, of course, also in Android. But Android history shows that it has not been so smooth, specially when you see how the APIs changed since ancient versions like Gingerbread or Ice Cream Sandwich up to Nougat/O. Some APIs are more stable than others, so the likeliness of having API version problems depends on what APIs you use. But in a general sense, Android APIs changes considerably and in a considerable pace. I wouldn't expect an app to behave properly for two or three years without updates – nandsito May 14 '17 at 13:44

1 Answers1

1

I think in general an app is forward compatible, but only if you ensure that you don't make use of private or undocumented api's.

For example when I first started playing with android there was a bunch of info on the web on how to send and received text messages that were not mentioned at all in the google documentation. Using that info (undocumented api) would have caused my app to break when KitKat came out and introduced and officially documented api for that particular purpose, since at the same time they removed the functionality that was available in the undocumented api. See here for details. of the above example.

Here is a link to some info on compatibility: https://developer.android.com/guide/topics/manifest/uses-sdk-element.html

And a snip-it of the relevant section

Application forward compatibility Android applications are generally forward-compatible with new versions of the Android platform.

Because almost all changes to the framework API are additive, an Android application developed using any given version of the API (as specified by its API Level) is forward-compatible with later versions of the Android platform and higher API levels. The application should be able to run on all later versions of the Android platform, except in isolated cases where the application uses a part of the API that is later removed for some reason.

Forward compatibility is important because many Android-powered devices receive over-the-air (OTA) system updates. The user may install your application and use it successfully, then later receive an OTA update to a new version of the Android platform. Once the update is installed, your application will run in a new run-time version of the environment, but one that has the API and system capabilities that your application depends on.

In some cases, changes below the API, such those in the underlying system itself, may affect your application when it is run in the new environment. For that reason it's important for you, as the application developer, to understand how the application will look and behave in each system environment. To help you test your application on various versions of the Android platform, the Android SDK includes multiple platforms that you can download. Each platform includes a compatible system image that you can run in an AVD, to test your application.

nPn
  • 16,254
  • 9
  • 35
  • 58