Skip to content

Mobile and Embedded

The forum for developing everything embedded: Linux, WinCE, Symbian, MeeGo... you name it.
14.2k Topics 62.6k Posts
  • V-play FlappyBird can't play in Android.

    Unsolved
    2
    0 Votes
    2 Posts
    550 Views
    veryqtpersonV
    Windows AppData Try to run it (Qt Creator and build) with administrative rights :)
  • Can't find stdlib.h included in cstdlib.

    Unsolved header ndk solved
    13
    0 Votes
    13 Posts
    11k Views
    lm365cnL
    @egg.nut I met the same question,how do you solve it?
  • why qt android bluetooth rfcomm always failed qt5.7

    Unsolved
    2
    0 Votes
    2 Posts
    1k Views
    dbskcncD
    the code #ifndef TBLUETOOTHMANAGER_H #define TBLUETOOTHMANAGER_H #include <QObject> #include<QTimer> #include <qbluetoothaddress.h> #include <qbluetoothdevicediscoveryagent.h> #include <qbluetoothlocaldevice.h> #include <QBluetoothDeviceInfo> #include<QBluetoothSocket> #include<QBluetoothServiceDiscoveryAgent> #define SPP_UUID QString("00001101-0000-1000-8000-00805F9B34FB") class TbluetoothManager : public QObject { Q_OBJECT Q_PROPERTY(bool comOk READ comOk WRITE setComOk NOTIFY comOkChanged) Q_PROPERTY(QList<QString> bluedevices READ bluedevices WRITE setBluedevices NOTIFY bluedevicesChanged) QList<QString> m_bluedevices; bool m_comOk; public: explicit TbluetoothManager(QObject *parent = 0); QList<QString> bluedevices() const; bool comOk() const; signals: void onComData(QByteArray data); void bluedevicesChanged(QList<QString> bluedevices); void deviceDiscovered(const QBluetoothDeviceInfo &info); void comOkChanged(bool comOk); public slots: void scanBluetoothDevices(); void connectComDevices(QString device); void sl_deviceDiscovered(const QBluetoothDeviceInfo &info); void sl_comConnected(); void sl_comDisconnected(); void sl_comReadyRead(); void sl_comStateChanged(QBluetoothSocket::SocketState state); void sl_comError(QBluetoothSocket::SocketError error); void sl_serviceDiscovered(const QBluetoothServiceInfo &info); void sl_comConnectToService(); //auto gen void setBluedevices(QList<QString> bluedevices); void setComOk(bool comOk); protected: QBluetoothDeviceDiscoveryAgent * discoveryAgent; QBluetoothSocket* m_local_bluetooth_socket; QBluetoothServiceDiscoveryAgent* m_bluetooth_service_disc; QString m_com_device_addr; QBluetoothServiceInfo m_com_service_info; }; #endif // TBLUETOOTHMANAGER_H cpp: #include "tbluetoothmanager.h" #include<QBluetoothServiceInfo> #include<QDebug> TbluetoothManager::TbluetoothManager(QObject *parent) : QObject(parent) { discoveryAgent= new QBluetoothDeviceDiscoveryAgent(this); connect(discoveryAgent, SIGNAL(deviceDiscovered(QBluetoothDeviceInfo)), this, SLOT(sl_deviceDiscovered(QBluetoothDeviceInfo))); m_local_bluetooth_socket=0; m_bluetooth_service_disc= new QBluetoothServiceDiscoveryAgent(this); connect(m_bluetooth_service_disc,SIGNAL(serviceDiscovered(const QBluetoothServiceInfo&)),SLOT(sl_serviceDiscovered(const QBluetoothServiceInfo&))); } QList<QString> TbluetoothManager::bluedevices() const { return m_bluedevices; } bool TbluetoothManager::comOk() const { return m_comOk; } void TbluetoothManager::scanBluetoothDevices() { //qDebug()<<"start scan bluetooth"; m_bluedevices.clear(); emit bluedevicesChanged(m_bluedevices); discoveryAgent->start(); } void TbluetoothManager::connectComDevices(QString device) { int last_pos=device.lastIndexOf("||"); if(last_pos<0){ qDebug()<<"can not found sep in device string"; return; } int last_second_pos=device.lastIndexOf("||",last_pos-1); if(last_second_pos<0){ qDebug()<<"can not found second sep in device string"; return; } m_com_device_addr=device.mid(last_second_pos+2,last_pos-last_second_pos-2); //qDebug()<< "device addr:"<<device_addr ; QString device_uuid=device.mid(last_pos+2,100); //qDebug()<< "device uuid:"<<device_uuid ; m_bluetooth_service_disc->setRemoteAddress(QBluetoothAddress(m_com_device_addr)); m_bluetooth_service_disc->start(); } void TbluetoothManager::sl_deviceDiscovered(const QBluetoothDeviceInfo &info) { QString device=info.name()+"||"+info.address().toString()+"||"+ info.deviceUuid().toString(); m_bluedevices.append(device); emit bluedevicesChanged(m_bluedevices); qDebug()<<"one bluetooth device:"<<device; connectComDevices(device); } void TbluetoothManager::sl_comConnected() { qDebug()<< "com connected" ; setComOk(true); } void TbluetoothManager::sl_comDisconnected() { qDebug()<< "com disconnected" ; setComOk(false); } void TbluetoothManager::sl_comReadyRead() { QByteArray data=m_local_bluetooth_socket->readAll(); qDebug()<< "com rev:" <<data; } void TbluetoothManager::sl_comStateChanged(QBluetoothSocket::SocketState state) { qDebug()<< "comm state:" <<state; } void TbluetoothManager::sl_comError(QBluetoothSocket::SocketError error) { qDebug()<< "com error:" <<error; } void TbluetoothManager::sl_serviceDiscovered(const QBluetoothServiceInfo &info) { qDebug()<< "service addr:" <<info.device().address().toString()<<"mcom addr:"<<m_com_device_addr <<"service uuid:"<<info.serviceUuid().toString(); if (info.device().address().toString()==m_com_device_addr) { QTimer::singleShot(10,[&]{ qDebug()<< "stop service disc" ; m_bluetooth_service_disc->stop();; }); m_com_service_info=info; QTimer::singleShot(1000,this,SLOT(sl_comConnectToService())); //m_local_bluetooth_socket->connectToService(info); } } void TbluetoothManager::sl_comConnectToService() { qDebug()<< "connect to addr:"<<m_com_service_info.device().address().toString()<<"suuid:"<<m_com_service_info.serviceUuid().toString() ; if (m_local_bluetooth_socket) { m_local_bluetooth_socket->deleteLater(); } m_local_bluetooth_socket=new QBluetoothSocket(QBluetoothServiceInfo::RfcommProtocol); m_local_bluetooth_socket->setPreferredSecurityFlags(QBluetooth::NoSecurity); connect(m_local_bluetooth_socket,SIGNAL(connected()), SLOT(sl_comConnected())); connect(m_local_bluetooth_socket,SIGNAL(disconnected()),SLOT(sl_comDisconnected())); connect(m_local_bluetooth_socket,SIGNAL(readyRead()),SLOT(sl_comReadyRead())); connect(m_local_bluetooth_socket,SIGNAL(stateChanged(QBluetoothSocket::SocketState)),SLOT(sl_comStateChanged(QBluetoothSocket::SocketState))); connect(m_local_bluetooth_socket,SIGNAL(error(QBluetoothSocket::SocketError)),SLOT(sl_comError(QBluetoothSocket::SocketError))); //m_local_bluetooth_socket->connectToService(m_com_service_info); m_local_bluetooth_socket->connectToService(m_com_service_info.device().address(), QBluetoothUuid(SPP_UUID)); } void TbluetoothManager::setBluedevices(QList<QString> bluedevices) { if (m_bluedevices == bluedevices) return; m_bluedevices = bluedevices; emit bluedevicesChanged(bluedevices); } void TbluetoothManager::setComOk(bool comOk) { if (m_comOk == comOk) return; m_comOk = comOk; emit comOkChanged(comOk); }
  • Wait on event

    Unsolved
    6
    0 Votes
    6 Posts
    2k Views
    K
    @raven-worx This is kinda cool! Thanks for the idea. I am going to try this as well. I will keep the results posted. here. Thanks!
  • ARMv8 android binaries

    Unsolved
    1
    0 Votes
    1 Posts
    735 Views
    No one has replied
  • Memory/Performance Management

    Unsolved memory performance
    2
    0 Votes
    2 Posts
    898 Views
    SGaistS
    Hi, Depends on the platform See number 1 What objects ? How are you creating them ? What's their lifetime ? In any case, KDAB's GammaRay is a very interesting tool. Valgrind is another one.
  • Embedded Qt Mouse Pointer Not Showing Up

    embedded qcursor cursor
    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • webview cut off veritcally in mobile

    Unsolved qml webview mobile
    1
    0 Votes
    1 Posts
    539 Views
    No one has replied
  • Qt Android Problem

    Solved
    9
    0 Votes
    9 Posts
    4k Views
    I
    @kd_wala Thanks. I solved the problem: void TestClass::toast_message(const QString& text, Duration duration) { QtAndroid::runOnAndroidThread([&] { QAndroidJniObject _text = QAndroidJniObject::fromString(text); QAndroidJniObject toast = QAndroidJniObject::callStaticObjectMethod( "android/widget/Toast", "makeText", "(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;", QtAndroid::androidActivity().object(), _text.object(), jint(duration)); toast.callMethod<void>("show"); }); } This is running!
  • Qt Mapviewer example

    Unsolved
    5
    0 Votes
    5 Posts
    1k Views
    RickLinuxR
    If you want to follow this bug here is the link: https://bugreports.qt.io/browse/QTBUG-55085 RickLinux
  • Qt Android assets

    Unsolved
    4
    0 Votes
    4 Posts
    4k Views
    KMaxK
    For everyone else who is have the same problem, this did the trick: .pro file: android { data.files = db/flags.sqlite data.path = /assets/db INSTALLS += data } .cpp file QFile dfile("assets:/db/flags.sqlite"); QString filePath = QStandardPaths::writableLocation( QStandardPaths::StandardLocation::AppLocalDataLocation ); filePath.append( "/flags.sqlite"); if (dfile.exists()) { if( QFile::exists( filePath ) ) QFile::remove( filePath ); if( dfile.copy( filePath ) ) QFile::setPermissions( filePath, QFile::WriteOwner | QFile::ReadOwner ); } d->database.setDatabaseName( filePath ); #else d->database.setDatabaseName( "db/flags.sqlite" ); #endif if( d->database.open() ) { qDebug( "DB open successful "); QSqlQuery q(d->database); q.exec("SELECT * from flags"); q.last(); d->dbSize = q.at() + 1; } else { qDebug( "DB failed" ); } } Link: Click me
  • How to set ANDROID_NDK_PLATFORM ?

    Unsolved
    4
    0 Votes
    4 Posts
    2k Views
    ekkescornerE
    I think, if you don't use Java code via Android Extras relying on a higher API level, you can start with the lowest one supported by Qt this means 18 for Qt 5.7 can someone confirm ?
  • Android/iOS Best Practices

    Unsolved design android ios
    3
    0 Votes
    3 Posts
    2k Views
    pppgogogoP
    @DRoscoe Thanks so much, I really appreciate you taking time to respond!
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    15 Views
    No one has replied
  • Disable gstreamer dependency with Qt WebKit

    Unsolved
    13
    0 Votes
    13 Posts
    4k Views
    K
    @kumararajas From what I know, Milian Wolff from KDAB is working on bringing newer WebKit to Qt 4, ping milian on #qt-labs to know if this option is available and how much it would cost. It should also be possible to bring Qt 4 support to https://github.com/annulen/webkit, but you would need to hire Milian or someone else
  • Problem when running Release on Android kit

    Solved
    13
    0 Votes
    13 Posts
    13k Views
    ZZZZZMLZ
    I met the same problem as you, I had solved the error by uninstalling two diffirent version Qt creators in my pc. Keep the last version Qt creator on my windows8.1. I tried , builded and ran, it installed successfully the apk on my android device.
  • simple chat in console application does not send data

    Unsolved qtcpsocket qtcpserver
    1
    0 Votes
    1 Posts
    995 Views
    No one has replied
  • Setup Qt on windows 7 to cross compile for Raspberry Pi 2

    Unsolved
    18
    0 Votes
    18 Posts
    8k Views
    avgjoecoderA
    @jsulm The problem is CONFIGURING QtCreator. Apparently no one here knows how to do that for windows to pi cross compile and debug. I gave up on QT and have succeeded to do just that with Eclipse, their suggested toolchain and detailed configuration docs. So for my purposes, no need to continue this thread.
  • Create Qt application on raspberry pi (ARM cpu)

    Solved
    2
    0 Votes
    2 Posts
    620 Views
    SGaistS
    Hi and welcome to devnet, Since your are new to all of that, I'd recommend asking to use a virtual machine with Linux on it. It will make the setup way easier that way.
  • VTHandler in EGLFS breaks GDB Remote Debugging

    Unsolved eglfs gdb sigint
    10
    0 Votes
    10 Posts
    4k Views
    Julien CarbonnierJ
    Hi, I found your topic and i have a problem with a SIGSEGV at the start of qt application when i used gdb. Your patch work with a previous problem i have with breakpoints but no with this one so have you an idea ? I'm using an imx6 platform with EGLFS and when upgrading Qt from 5.3.2 to 5.5.1, I can't start a debug. I try to backtrace in qtcreator but i can't find anything to help. Thanks, Here it's a part of gdb log. >909-exec-run Process AW_APP created; pid = 1370 >library-loaded,id="/lib/ld-linux-armhf.so.3",target-name="/lib/ld-linux-armhf.so.3",host-name="/opt/fsl-imx-fb/4.1.15-1.2.0/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/lib/ld-linux-armhf.so.3",symbols-loaded="0",thread-group="i1" Library /lib/ld-linux-armhf.so.3 loaded >909^running dNOTE: ENGINE RUN AND INFERIOR RUN OK sRunning. dState changed from EngineRunRequested(7) to InferiorRunOk(11) [master] dINFERIOR STARTED sDémarrage de l'application >*running,thread-id="all" dNOTE: INFERIOR STILL RUNNING IN STATE InferiorRunOk. >~"\nProgram received signal " >~"SIGSEGV, Segmentation fault.\n" >~"0x4dca9e24 in ?? ()\n" >*stopped,reason="signal-received",signal-name="SIGSEGV",signal-meaning="Segmentation fault",frame={addr="0x4dca9e24",func="??",args=[]},thread-id="1",stopped-threads="all",core="0" dNOTE: INFERIOR SPONTANEOUS STOP sStopped. > 914bt full >&"bt full\n" >~"#-1 0x4dca9e24 in ?? ()\n" >~"No symbol table info available.\n" >&"warning: Unable to restore previously selected frame.\n" Unable to restore previously selected frame. >914^done