QField icon indicating copy to clipboard operation
QField copied to clipboard

Android USB update

Open bettellam opened this issue 1 year ago • 23 comments

bettellam avatar Sep 06 '24 14:09 bettellam

@bettellam , hey there, nice to see you opening a pull request over here, hoping this will be one of more to come :)

If you are interested, I can guide you through adding the UI to select bault rate if this test turns out to fix your issue.

nirvn avatar Sep 06 '24 14:09 nirvn

@nirvn Thanks All this comes from #5576 Here I am like "a fish out of water". As I already wrote to @m-kuhn , I would never be able to complete something like this, I am not a programmer, I barely read code... but it seemed like an interesting thing to investigate....

bettellam avatar Sep 06 '24 20:09 bettellam

@bettellam as soon as the workflows finished, you should get apks in here https://github.com/opengisch/QField/actions/runs/10750024510?pr=5618 There will still be a failure indicated, but let's ignore that for now.

Let's see where we go with this after the first test results.

m-kuhn avatar Sep 07 '24 08:09 m-kuhn

@m-kuhn Ok. I'm home this afternoon. I'll do a test right away. Thanks

bettellam avatar Sep 07 '24 08:09 bettellam

@m-kuhn Test with the window version: I reset the default setting of the COM1 port to 9600 baud rate, leaving the receiver set to 115200. image

Started QField and it connects. !!!!! image

This means that having changed mSocket->setBaudRate( QSerialPort::Baud115200 ); is a correct choice. It will be useful to create a combobox where the user chooses the connection baud rate to the USB port.

As for android I can't find the apr file.

I think that the android.hardware.usb alone is not enough because there are all the authorization problems for the use of the USB! Here's what happens with SWMaps: image

bettellam avatar Sep 07 '24 15:09 bettellam

If you scroll down here https://github.com/opengisch/QField/actions/runs/10750305033 can you see the apk files?

m-kuhn avatar Sep 07 '24 17:09 m-kuhn

I don't understand what the file is? It seems to me that it is not there......

bettellam avatar Sep 07 '24 17:09 bettellam

image

You should be able to download the qfield_dev-android-arm64-android file and install it on your phone/tablet for testing. You might have to uninstall a potentially already installed beta version of qfield before (no conflict with the stable installed version)

m-kuhn avatar Sep 08 '24 06:09 m-kuhn

Nothing... it doesn't install... I tried with 2 devices (android 8 and android10)

bettellam avatar Sep 08 '24 08:09 bettellam

Do you have any error message?

m-kuhn avatar Sep 08 '24 09:09 m-kuhn

Android 8

https://github.com/user-attachments/assets/c640e74d-c22f-4b3d-b1e9-97f699f3c8c4

bettellam avatar Sep 08 '24 09:09 bettellam

@bettellam , do you have a previous QField 'beta' (i.e. an APK from a PR) installed on your phone?

nirvn avatar Sep 08 '24 09:09 nirvn

@bettellam , do you have a previous QField 'beta' (i.e. an APK from a PR) installed on your phone?

@m-kuhn Qfield dev beta uninstalled! Standard Qfiled installed.

bettellam avatar Sep 08 '24 10:09 bettellam

@bettellam , alright, new APKs have been generated in the latest Android workflow runs and you'll be able to install those. Let us know :)

nirvn avatar Sep 10 '24 16:09 nirvn

@nirvn Installation OK There is nothing in the listbox that refers to my connected USB device. The USB port access permissions are missing! (a system form should open with which the user enables USB access)

https://github.com/user-attachments/assets/26f9c6dd-50c6-46fc-8427-d3b17f8e6a2e

bettellam avatar Sep 10 '24 20:09 bettellam

I think you need to programmatically ask for these permissions (similar to here https://github.com/opengisch/QField/blob/5c5273e29b456bfe68df5a4418e499c3e240c8c4/src/core/platforms/android/androidplatformutilities.cpp#L678 )

m-kuhn avatar Sep 10 '24 21:09 m-kuhn

@bettellam , have your been able to investigate this further?

nirvn avatar Oct 12 '24 05:10 nirvn

@nirvn No, I haven't done anything anymore. Also because I changed phone... android14 .... a disaster ... it doesn't recognize my bluetooth devices anymore... it's no longer possible to write in the folder android/data/ch.opengis.qfield

Pravicy and Security are blocking everything!

bettellam avatar Oct 13 '24 10:10 bettellam

@bettellam , that sounds dramatic.

it's no longer possible to write in the folder android/data/ch.opengis.qfield

You mean you can't copy files into that folder via USB cable?

nirvn avatar Oct 13 '24 10:10 nirvn

@nirvn Exactly!

with this application you can copy files to the qfield folder: https://play.google.com/store/search?q=fv+file+manager&c=apps

bettellam avatar Oct 13 '24 10:10 bettellam

@bettellam , I don't think Android 14 is the cause of USB cable transfer not working anymore. I have a pixel 6a with Android 14 and it copies files into that folder without a problem.

nirvn avatar Oct 13 '24 10:10 nirvn

@nirvn my realme gt6 I did a test with USB cable from PC and it works. Thanks I was used to transfer files with android app in wifi I will investigate...

bettellam avatar Oct 13 '24 10:10 bettellam

@nirvn Back to the USB issue you could try with android.hardware.usb.host You need approval to continue....

bettellam avatar Oct 13 '24 13:10 bettellam

@bettellam , are you still interested in the baud rate control here? If so, I think we could guide you into coding it :)

nirvn avatar Nov 27 '24 09:11 nirvn

@nirvn Thanks for the trust... but I don't have specific technical knowledge in programming to deal with this problem. If I find some solution I will not fail to report it!

bettellam avatar Nov 27 '24 09:11 bettellam

@bettellam , is it still a need of yours or have you found a workaround?

nirvn avatar Nov 27 '24 09:11 nirvn

@nirvn , The alternative solution to connect a GNSS receiver with USB port in Android is to use the TCPUART app https://play.google.com/store/apps/details?id=com.hardcodedjoy.tcpuart , I reported it in this: https://github.com/opengisch/QField/issues/4329

bettellam avatar Nov 27 '24 09:11 bettellam