Discussion Board

Results 1 to 4 of 4
  1. #1
    Nokia Developer Champion axeljaeger's Avatar
    Join Date
    Mar 2009
    Posts
    430
    Hello,
    I've played a bit around with the mobile webserver in my local network. So I needed the IP-Adress that my phone got from the dhcp. Because I did not find a way to get the IP on the phone I sat down and wrote the following application that displays a list of all IP-adresses the phone is currently bound to.

    Code:
    #include <QApplication>
    #include <QHostAddress>
    #include <QNetworkInterface>
    #include <QScopedPointer>
    #include <QListView>
    #include <QStringListModel>
    
    int main(int argc, char** argv) {
        QApplication app(argc, argv);
    
    
        QStringList adresses;
    
        foreach (QHostAddress adress, QNetworkInterface::allAddresses()) {
            adresses << adress.toString();
        }
    
    
        QScopedPointer<QListView> list_view(new QListView(NULL));
        QScopedPointer<QStringListModel> model(new QStringListModel(NULL));
        
        list_view->setModel(model.data());
        model->setStringList(adresses);
        
        list_view->showMaximized();
        return app.exec();
    }

  2. #2
    Nokia Developer Champion savaj's Avatar
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034
    I would suggest you to put this code to wiki so that it might be useful to others.

  3. #3
    Nokia Developer Champion axeljaeger's Avatar
    Join Date
    Mar 2009
    Posts
    430
    Because I found a symbian application that can show the IP: http://www.patrickfrei.ch/phonetinfo/index.html I will not continue that project.

    I also won't put in in the wiki because I see no value in duplicating the whole Qt documentation into the nokia wiki.

  4. #4
    Nokia Developer Champion james1980's Avatar
    Join Date
    Sep 2007
    Location
    Bhavnagar
    Posts
    919
    Hi axeljaeger ,
    I think you should put it on wiki as savaj had also suggested you. there are many developers who directly refer the wiki for any help...
    This is just the suggestion.....
    Jajal Mehul

Similar Threads

  1. running an application on a phone
    By Klon5 in forum Symbian C++
    Replies: 3
    Last Post: 2008-11-05, 09:04
  2. Nokia Gamer (GamR) - concept phone
    By tgm91 in forum General Development Questions
    Replies: 4
    Last Post: 2008-10-01, 21:34
  3. Replies: 2
    Last Post: 2007-02-06, 15:16
  4. looking for small midi application
    By memosen80 in forum Symbian C++
    Replies: 3
    Last Post: 2003-08-04, 04:22

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved