[Android-development] connect to wifi via Qt

Harri Pasanen harri at mpaja.com
Thu Sep 4 21:02:56 CEST 2014


Calling into Java API's is relatively straight forward and the latest Qt 
Creator can automatically add a Java class to correct place and deploy 
it as required.

I guess some blog posts or documentation could be handy, I've been 
meaning to write a blog post myself when I have the time.
That said, for instance

http://blog.qt.digia.com/blog/2013/07/23/anatomy-of-a-qt-5-for-android-application/

and

http://blog.qt.digia.com/blog/2013/12/12/implementing-in-app-purchase-on-android/

are useful.

Harri



On 04/09/2014 16:04, Katerina Karagiannaki wrote:
>
> Hello everyone,
>
> I am developing an application on Qt for Android. The application 
> serves the role of aTCPclient that connects to a server written in C++ 
> and retrieves data from it. I also have deployed it on my Android phone.
>
> I am also trying to connect to a wifi network programmatically via Qt. 
> I have read the documentation of Bearer Management and 
> QNetworkConfiguration and I am able to find all the available 
> configurations in the wlan0 interface. I am also able to start a new 
> session for a configuration and see all available interfaces etc.
> Therefore I think I have understood how the documentation works, but I 
> am not able to connect to a wifi.
> I have read in the Qt forums that there is no built-in way in Qt to do 
> that, and that I need to use some native api.
>
> Another thing that i’ve tried is to execute a QProcess with Linux 
> system calls, such as ifconfig and iwconfig to connect to the wifi in 
> the same way as in Linux terminal (Qt desktop version) but I haven’t 
> seen any results and if I see any, I don’t know if that will work in 
> Android.
>
> Is there a way to connect to wifi via Qt? Is there anything in the 
> documentation that i have not seen or understood yet? If not, is it 
> possible to do it in C++ with someAPIfor Linux? (I have found out that 
> there areAPIs on Windows that do this but my server needs to be 
> running on a Linux device).
>
> Finally, I am also thinking if it is possible to establish a wifi 
> connection in Java. I googled and found code snippets in Android Java 
> that make that connection possible. Is there a way to do that in Qt - 
> run Java code with android packages (from Android SDK) somehow? I 
> found this link -> 
> http://developer.android.com/training/articles/perf-jni.html , should 
> I continue towards that direction or better find something else?
>
> Sorry for the burst of questions, but I've been facing that problem 
> for quite a while.
> Any help would be great!
>
> Thanks in advance,
> Katerina
>
>
>
> _______________________________________________
> Android-development mailing list
> Android-development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/android-development

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/android-development/attachments/20140904/2b38018b/attachment.html>


More information about the Android-development mailing list