android-js/androidjs

file input not working in build apk

realrecordzLab opened this issue · 3 comments

After some tests I'm able to build correctly my app and get an apk. I've done some tests and in the browser the app works fine, but when I install the apk on the emulator I'm facing some problems.

The forst one is that my <input type="file"> if clicked will do nothing, no prompt are opened to select a file or multiple files. I'm using chrome://inspect/#devices and no error is logged into the console from the adb emulator. I need to ask a permission to use file selector or there is another way to achive this?
NB: I'm using vuejs for the front-end

      <div class="col-12" v-if="!selectedFiles.length > 0">
        <p class="text-muted">{{ log }}</p>
        <div class="mb-4">
          <input type="file" class="form-control" multiple @change="processFiles($event.target)">
        </div>
      </div>

The second problem is with node modules. In the main.js file I need to use some node modules like path, crypto, fs/promises. Anyway I've noticed that when I add them and build the apk, after installing the apk on the adb emulator, the app will shoutdown after few seconds. This will not happen if I comment or remove the modules. Is there any fix?

const crypro = require('crypto');
const back = require('androidjs').back;
const path = require('path');
const fs = require('fs/promises');

back.on("ping", () => {
	back.send("pong", "Hello from Android JS");
});

back.on('processFiles', (data) => {
	console.log(data);
});

This is related to Android WebView. An handler has to be added in the Java code

This is related to Android WebView. An handler has to be added in the Java code

Unfortunately I'm not a Java programmer so I'm not sure how to proceed and what file needs to be modified before build the app

This is related to Android WebView. An handler has to be added in the Java code

Unfortunately I'm not a Java programmer so I'm not sure how to proceed and what file needs to be modified before build the app

I'm not quite sure how this framework works. But I need a way to solve it or I'll have to find another way to do this