BidVertiser

Categories

Follow Us @web_learners

BidVertiser

Saturday, July 3, 2021

How to upload multiple files in webview android app | Webview App Development Series Part 18

 Hi Mobile App Developers, In the previous video we have learned that How to Enable File upload in Android Webview app. And I told in the last video that we will learn today how to upload multiple types of files together in the Android webview app.

As we saw in the last tutorial, we are able to upload any type of file such as Audio, Video, Txt, XL, Zip, PPT, etc. But we saw that we can only select one file and upload one file at a time,  So today we will learn How to select multiple files and upload multiple files together in the Android Webview app.

We will continue with the last tutorial code, If you have not followed that tutorial yet, first follow that tutorial, then continue this tutorial. Let's Start.

First, we will take a boolean variable, we will name it multiple_files, and the value we will store is "Yes".



Code:


Now we will move to the "onShowFileChooser" function, in that function you will find we have written code for file selection, now we will write code there for multiple file selection.


Code:


These codes will help you to select multiple files at a time in the Android webview app. Now let's see what will be the full code within the "onShowFileChooser" function.

Code:


Just need to add these line of code in "onShowFileChooser" function , and all the other code of Upload file in Webview (my last tutorial) are same such as "onActivityResult", "onConfigurationChanged""file_permission" , "create_image()", "create_video()".  Now let's run the project and check whether Multiple file selections and multiple file uploading in the Android webview app are working or not.


As you can see in the above picture, multiple file uploading working perfectly. This way you can convert your website easily. It works like website to apk converter

In the next, I will show you How to Enable Upload and Download in Android Webview App.

1 comment:

  1. I don't know how will I thank you maam , you are great I have been stuck on the same thing since two days and now I saw your tutorial , I was using image upload and now I I used the last technique and implemented that and made this possible . I would suggest you doing one thing , you can upload the full source code in every file , the activity.java files should be complete at the end , that will be more comfortable for other users , I was skipping your video since tomorrow because you were speaking in Bangla and I finally decided to see, I would suggest you to make video in Hindi language so that it will be easy for vast user and you will start getting more views

    ReplyDelete