so i’m trying to trying to transfer files to my android device using mtp, and the android file transfer program in the depot, and the application opens for a split second and then closes again. I have all libraries needed for usb transfer installed. is this program outdated, or does haiku support this yet?
It also never opened for me. There was a mini app developed by a russian (I think) user that through a very basic native (using BeAPI) GUI that uses libmtp you can see the list of files and download the selected file (this is the only two things that it can do), but there is no app in Depot, and I got the app because someone uploaded in Telegram the source code. Maybe someone knows how to get it from the dev.
If you have the app/source code, why can’t you send him that (or upload it to the depot)?
Here is the code: Telegram: Contact @haiku_es_LOA
This is a screenshot I took.
I wrote the port of android_file_transfer but I never used it with the Qt GUI. It also provides a FUSE filesystem that can be used with userlandfs, and then you can access your phone directly inTracker.
Unfortunately it seems I didn’t post anywhere explanations on how to do it. I’ll try to do that next time I’m in front of my Haiku machine.
how to use it directly?
note that this is the x86 32 bit version of the program. 64 bit might not work for me. usually installing apps with pkgman works better than using haikudepot.
Why is that I wonder?
Hello,
Sorry for the delay. I am in front of my Haiku machine and I could test this again. It turns out I had this working, I upstreamed the patches, but then I completely forgot to enable it in the recipe, so no one else knew it was there.
I have just pushed an update to android_file_transfer (version 4.3~git+5) that will include the FUSE module. I have moved the Qt GUI to a separate package, android_file_transfer_qt.
To use it:
- Create a mount directory:
mkdir /droid
- Put your phone in file sharing mode. In my case, this mode is disabled if the phone is left unused for too long and goes to sleep, so make sure the phone remains unlocked until the next step
- Run this command to mount the phone:
mount -t userlandfs -o android_file_transfer /droid/
- You can then browse it directly in Tracker (it appears on the desktop like other disks)
- Don’t forget to unmount it (right click → unmount or eject) before unplugging the phone
Ideally, there should be a way to make these commands run automatically when an Android phone in file transfer mode is detected. I think we need to write a driver for that, and maybe have it talk with mount_server?
I tried your instructions, but it does’t work. The mount process is stuck doing nothing, and no matter what, mount and userlandfs processes are unkillable during this situation, only a reboot stop them.
AFTqt is as broken as always, because it does not even open a GUI.
The only thing it does is printing in the console something like
upload worker started
current text color value: 0 , guessed theme: "light"
scan
probing device...
Control read(type 80 req 6 value 300 index 0 size 255) with timeout 1000…
any updates about this?
My samsung devices are still not being properly handled at all.
When I want to exchange files in Haiku I use FTP protocol. Haiku has buildin FTP server. I also have FTP server in my wireless router. You can also install FTP server on phone.
Thanks for interest of my app. Source code now available at repository. If you have a bug please file report hear. Sorry not a github repository. The service unavailable for me because sanctions.
Getting an error trying to run make:
/Share/wip/mtp> make
mkdir -p objects.x86_64-cc13-release; \
mkdepend -I./ -I. -p .cpp:objects.x86_64-cc13-release/%n.o -m -f "objects.x86_64-cc13-release/MainWindow.d" MainWindow.cpp
mkdir -p objects.x86_64-cc13-release; \
mkdepend -I./ -I. -p .cpp:objects.x86_64-cc13-release/%n.o -m -f "objects.x86_64-cc13-release/App.d" App.cpp
g++ -c App.cpp -iquote./ -iquote./ -iquote. -isystem/boot/system/develop/headers -isystem/boot/system/develop/headers/be -isystem/boot/system/develop/headers/cpp -isystem/boot/system/develop/headers/posix -O0 -o "objects.x86_64-cc13-release/App.o"
App.cpp: In function 'LIBMTP_filetype_t find_filetype(const char*)':
App.cpp:37:13: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
37 | ptype = "";
| ^~
g++ -c MainWindow.cpp -iquote./ -iquote./ -iquote. -isystem/boot/system/develop/headers -isystem/boot/system/develop/headers/be -isystem/boot/system/develop/headers/cpp -isystem/boot/system/develop/headers/posix -O0 -o "objects.x86_64-cc13-release/MainWindow.o"
cc -o "mtpview" objects.x86_64-cc13-release/App.o objects.x86_64-cc13-release/MainWindow.o -Xlinker -soname=_APP_ -L./ /boot/system/develop/lib/libbe.so /boot/system/develop/lib/libmtp.so /boot/system/develop/lib/libtracker.so
xres -o ./mtpview
mimeset -f "mtpview"
mimeset: "mtpview": No such file or directory
/boot/system/develop/etc/makefile-engine:240: recipe for target 'mtpview' failed
make: *** [mtpview] Error 1
What Haiku revision used? Do you install libmtp_devel package from HaikuDepot? I try on R1beta5 (hrev57937+118) and nightly hrev58187 under VirtualBox and make end without errors. If have no success with make, mtpview can be built with Paladin. Also you can try to regenerate Makefile from it.
R1B5 64bit, but with a more recent libmtp then in the depot (version 1.1.21 packaged this morning as per request by someone else), could give it a go with the current one from the depot.
Paladin I haven’t checked yet, saw the project file for it.
EDIT: works with libmtp 1.1.19 and the makefile maybe you could check why it’s failing for the new version?
Failed with Paladin:
I see linker errors in Paladin output. Does new libmtp installed correctly? If not you can edit pld file by Pe and write a correct path.
For my test machine locations of libmtp.so is:
Same setup with last attempt here:
/system/develop/lib> ls -la libmtp.so*
lr-xr-xr-x 1 user root 15 Apr 14 2023 libmtp.so -> libmtp.so.9.4.0
lr-xr-xr-x 1 user root 15 Apr 14 2023 libmtp.so.9 -> libmtp.so.9.4.0
lr-xr-xr-x 1 user root 25 Apr 14 2023 libmtp.so.9.4.0 -> ../../lib/libmtp.so.9.4.0
/system/develop/lib> ls -la ../../lib/libmtp.so*
lr-xr-xr-x 1 user root 15 Apr 14 2023 ../../lib/libmtp.so.9 -> libmtp.so.9.4.0
-r-xr-xr-x 1 user root 597968 Apr 14 2023 ../../lib/libmtp.so.9.4.0
/system/develop/lib>
mtpview builds ok with Paladin, it’s mtp that isn’t:
I can reproduce this errors if uncheck libtracker.so from Setting->Change system libraries. But on this case libtracker.so removed from pld-file too (you have it). I don’t figure out what happen.
I made fist release of mtpview. You can try mtpview-0.0.1-alpha.hpkg.zip from assets. This is zipped because Gitflic does not know about Haiku packages yet.
I can’t read what it mentions at Gitfic there, but for instance, I uploaded my (new) libmtp here: Haiku_Testdrive/libmtp at master · Begasus/Haiku_Testdrive · GitHub
You can click on the hpkg file and then you can right-click on the “raw” link and save it to disk like:
https://github.com/Begasus/Haiku_Testdrive/raw/refs/heads/master/libmtp/libmtp-1.1.21-1-x86_64.hpkg
Maybe we could add this to haikuports so it becomes available for everyone? (you could perhaps also check with the newer libmtp version).