Backward compatibility

yo3ggx

Active Member
Licensed User
Longtime User
Hi all,

I'm developing an application using API level 14.
Some of the features are available from API level 9(ex. SIP), others from API level 12 (ex. USB Host), but I want to keep the app available and functional (without these feature) for Android devices with API level 8 or lower.

There is something special to take care of in order to prevent application crash or just deactivating respective features inside app based on API level is enough?

Thank you,
Dan
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
The best solution is to put all the USB code in a class and all the SIP code in another class and only use the classes if the current device supports these APIs.

Note that this solution is not 100% documented however many developers use it.

Another option is to create a library from your main project and then create several projects that reference the main library and add the additional features.
 
Upvote 0
Top