Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Usb device
Forum Updated to NodeBB v4.3 + New Features

Usb device

Scheduled Pinned Locked Moved Solved Mobile and Embedded
3 Posts 2 Posters 738 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    Elnur_Ismailzada
    wrote on last edited by
    #1

    Hi!
    I want to get a file from usb device.
    I did everything as on this site https://developer.android.com/guide/topics/connectivity/usb/host.html
    I get the path to the device like qstr = "/dev/bus/usb/001/030". In Qt QFile(qstr).exists() return true.
    But I can not get files from device:

        QDirIterator it(qstr, QStringList() << "*.mp4", QDir::Files, QDirIterator::Subdirectories);
        while (it.hasNext())
            qDebug() << it.next();
    

    What could be the reason?

    K 1 Reply Last reply
    0
    • E Offline
      E Offline
      Elnur_Ismailzada
      wrote on last edited by
      #3

      I solved my problem with android tools. I connected my usb to android and chose "connect as internal storage". My device was formatted. After in the settings I changed to external storage. Appeared my device in /storage/MyUSBNAME.

      1 Reply Last reply
      1
      • E Elnur_Ismailzada

        Hi!
        I want to get a file from usb device.
        I did everything as on this site https://developer.android.com/guide/topics/connectivity/usb/host.html
        I get the path to the device like qstr = "/dev/bus/usb/001/030". In Qt QFile(qstr).exists() return true.
        But I can not get files from device:

            QDirIterator it(qstr, QStringList() << "*.mp4", QDir::Files, QDirIterator::Subdirectories);
            while (it.hasNext())
                qDebug() << it.next();
        

        What could be the reason?

        K Offline
        K Offline
        koahnig
        wrote on last edited by
        #2

        @Elnur_Ismailzada

        Without error message this is crystal ball reading.

        Checkout QFile's functions about status of file.

        Vote the answer(s) that helped you to solve your issue(s)

        1 Reply Last reply
        1
        • E Offline
          E Offline
          Elnur_Ismailzada
          wrote on last edited by
          #3

          I solved my problem with android tools. I connected my usb to android and chose "connect as internal storage". My device was formatted. After in the settings I changed to external storage. Appeared my device in /storage/MyUSBNAME.

          1 Reply Last reply
          1

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved