Android compatibility between old versions and new versions

Hello everyone,

I'm trying to develop an app that is meant to use phone camera and it's about an Android app. The app is very simple and it is using a web-view where It render an web-app. The problem that I have at the moment is that the web app contains an input button of type="file" that is meant to open the camera or upload a picture, and for Android app I was not able to make it work for older sdk versions. For example, I' using a mobile device that is running Android 7.0 Nougat and running the app on this device, when I press the input button inside the app, the app is doing nothing, there is no event inside the app nothing. I searched for answers on this side and I found some threads on forum and I was able to handle the events.

The only problem that I have is that I'm not able to compile my app using an old Android version (I must keep the consistency). For example the app is compiling without problems using Android 7.0, but it is not compiling using Android 4.4 (or lower) (please see the attached image SDK.jpg).

In order to handle the file input events I inherited WebChromeClient class and overridden the event OnShowFileChooser:

_internal class MyWebChromeClient : WebChromeClient
{
// stuff in here

public override bool OnShowFileChooser(WebView webView, IValueCallback filePathCallback, FileChooserParams fileChooserParams)
{
    // another stuff in here
}

}_

When I'm trying to change the Android version for build from Android 7.0 to Android 4.4 (or lower) the error from attached image (Error.jpg) is displayed and I'm not able to build the app (actually for lower Android version, 4.4 (or lower) in this case there is no method to override). Also I must have here an consistency between old and new Android OS versions.

Is there any workaround to make this work (the input button), both on android bellow 5.0 and greater than 5.0?

Thank you!

Posts

Sign In or Register to comment.