Writing a cross platform GUI/service - qt

I'm working on a project that requires a desktop client to scan certain directories on a users computer at set intervals. My plan is to separate the actual directory scanning code out of the GUI and into a service so that it can run even when the GUI isn't open. Does this sound like the right way to do this? Additionally I'd like all this to be cross platform. I'm using QT to create the GUI. Is it possible to write cross platform services? I've looked into QTService a bit. The documentation for QTService says it's for implementing Windows services and Unix daemons. I assume the Unix portion means support for both linux and mac systems? Any other suggestions?

Yes ,Qt definitely seems a good option for developing cross platform applications.You can write once and recompile it for windows ,Mac and linux.A Qt app will actually look like a native app because it uses the native look and feel to decorate its widgets.
You can alter the build process to build a GUI app or a console application that can be invoked from commandline.
EDIT
QtService is not part of the standard SDK . It is available here

Related

How to make JavaFX Stage always on bottom?

There is a setAlwaysOnTop() method, but I need make a 'always-on-bottom' windows or a window pinned to the desktop to, I want to create a application work like Windows 7 Gadgets.
Window management in general is something that the operating system has to take care of. The JVM (and hence JavaFX, too) only uses OS features. So, in Java/JavaFX, we can only use those features that the JVM + Java + JavaFX API uses. AFAIK, there is no method like "always on bottom" there (and also not in some other development environments that let you build native applications).
If you need to send windows to the background or even need to monitor window depth, then you are looking for OS features. You would have to use the Windows Platform SDK. You would need to use the Java Native Interface e.g., in order to call Windows functions from Java.

How to use WinPcap in Xamarin (Forms)

There are many .Net wrappers in C# for WinPcap like SharpPcap and PcapDotNet
I have tried to add these Nuget packages to my Xamarin Forms projects but it does not work. I want to create a wifi/packet scanner but I am not sure how to do this in Xamarin. Is it even possible?
When I clone the GitHub repo and build my own version of SharpPcap, the application runs, but I get the error:
System.DllNotFoundException: wpcap
The wpcap.dll is the dll that all these packages are wrapped around and use [DllImport("wpcap.dll")] to work. This wont work in Xamarin (I think).
Another way to use dll's is when you embed them as an application resource, is there any library which I can use that does that?
WinPcap consists of a driver, that extends the operating system to
provide low-level network access, and a library that is used to easily
access the low-level network layers. This library also contains the
Windows version of the well known libpcap Unix API.
Source: https://www.winpcap.org/
There is nothing impossible, however in mobile world you don't have that low level access to drivers and etc. unless you have a root on your device. It is unclear what exactly you want to build. But I know that on both iOS & Android there is an app called Fing. It scans your WiFi network for connected devices. It is written natively per platform. On Android there used to be many different applications that used MITM technique. For example DroidSheep. But I am not aware of any cross-platform solution that is able to scan the network or sniff packages.

Running QT5 in an embedded device with 64 MB RAM

I have been working with QML for a couple of weeks now. But now a new requirement has risen where I have to check whether I can run QT5 in an embedded device for my project. I need this for my GUI related operations. The device has an ARM processor (Intel ARM920T-PXA27x processor to be exact) with 64 MB RAM. 32 MB will be taken up for the OS and the rest will be available for application and QT.
I have to check whether this is possible. I have googled for some references and unable to find a suitable answer to my requirement with QT5. I need the GUI libraries but my project does not have advanced graphical requirements like swiping or animations. It contains basic controls like texts, buttons and lists/grids. Since I am new to QT especially to this part, I would like to hear whether
1) Is this a viable option and should I keep digging more into this? Any feedback would be welcome to know if it's worthy to spend time to attempt this or if it's a lost cause.
2) If there are options, could you point me in the right direction to look more into this?
It depends on the OS you are running on your SOC.
It's definitely possible when running Linux. You can e.g. use Qt Lite for configuring a minimal static build of Qt. Then you deploy your statically linked application to the device. You can check this blog post for experiences with Qt Lite.
One possibility is to go with Qt for Device Creation for the whole embedded Linux based software stack which boots to a UI implemented with Qt technologies.

How to use Nokia Qt to launch another mobile application within an application based upon a MIME type?

I am using Qt Nokia for mobile development (I'm currently testing on a Nokia C7) and would like to launch an application from another an application based upon a MIME type.
For example, I might have a file, and I would like to be able to open another application from the original application without specifying the application but using the MIME type of that file. On the other application opening it would load the file and perhaps be given an additional message or payload.
If this sounds a little strange it might help to know that I have come from a J2ME background and would have used the CHAPI API.
I need to use Qt Nokia so that I can build the application for the Symbian or Maemo platform. So far I have only been able to find documentation showing you how to do it under Symbian.
Can I do what I require by using Qt Nokia? I am just not looking the right places?
QDesktop::openUrl may be a good candidate.
This HowTo may be helpful.

Connect to internet with Qt for symbian

I'm creating a Qt Symbian application and need to connect to internet. In some way I need to let the user choose a connection when the app starts. I could use Qt Mobility to get it working but when Nokia approves I wan't do publish my application on Ovi Store. As the Qt Mobility is not included in Qt 4.6 it might be a problem to publish my app later. So for this reason I'm thinking of using native APIs instead.
The idea is to use: qt_SetDefaultIap() to set the connection on start. I have been looking at this to actually understand what it is doing. If I have two connections that the app could use, one with WIFI and one through mobile internet, which one will qt_SetDefaultIap() choose? And can I in some way with native api make the user choose a connection on start up? (qt_SetDefaultIap seems to just set a default connection on its own, without user choice)
Thanks!
Qt 4.7 is now released, and although not all of the Mobility APIs have made it into the core, QNetworkSession has.
Mrbiggerm: it looks like you've found the sym_iap_util.h file that's included in the QFtp example code in the Qt SDK. Rather than calling qt_SetDefaultIap(), try calling qt_OfferIapDialog(), and passing its return value to qt_SetDefaultIapName(). That should do what you're after. (Although this is a bit of a hack, it's often a preferred option as it presents a native S60 UI rather than making you implement your own list of access points.)
Do you expect to finish your program before Qt 4.7 release (I don't know the exact release date, but I'd estimate it will be around July), which AFAIK will contain Qt Mobility?
If the answer is no, don't worry about releasing issues, use custom build of QtMobility for development, wait for 4.7 and don't worry about releasing issues.
If the answer is yes, what stops you from deploying your program with custom QtMobility build? Internally it uses the same native API calls you want to use, not some super secret Nokia API, so there should be no problem with code validation (in fact, there will probably be less problems, since you won't have a chance to screw up code covered by QtMobility libraries).

Resources