Hello I am using Carbide C++ 2.0.2 with Nokia N97 SDK 1.0. The following code works well with the Emulator. However when I try on device debug configuration the status code in "httpFinished" method returns empty. I can not get the text of requsted url. At the time of on device debug, the Nokia N97 is already connected to the access point at home (my wireless modem) and the browser works fine. I am using self signing configuration (self sign sis file).
Although my device is connected to the accesspoint (browser is working fine), Do I need to set the access point in the code? If not, what can be the problem with this http request?
****************************************************************************************************************
Here is the header file:
Code:#ifndef QTINTERNET_H #define QTINTERNET_H #include <QtGui/QMainWindow> #include "ui_QTInternet.h" #include <QMessageBox> #include <qtimer.h> #include <stdlib.h> #include <QtNetwork/qhttp.h> #include <QtNetwork/qnetworkaccessmanager.h> #include <QtNetwork/qnetworkrequest.h> #include <QtNetwork/qnetworkreply.h> #include <qurl.h> #include <qplaintextedit.h> class QTInternet : public QMainWindow { Q_OBJECT public: QTInternet(QWidget *parent = 0); ~QTInternet(); private slots: void fetch_clicked(); void httpFinished(QNetworkReply* reply); private: Ui::QTInternetClass ui; QString urlArray[3]; QHttp *myHttp; QNetworkAccessManager* netMan; }; #endif // QTINTERNET_H ************************************************************************************************* Here is the cpp file: #include "QTInternet.h" QTInternet::QTInternet(QWidget *parent) : QMainWindow(parent) { ui.setupUi(this); connect(ui.fetchbutton,SIGNAL(clicked()), this, SLOT(fetch_clicked())); netMan = new QNetworkAccessManager(this); QObject::connect(netMan, SIGNAL(finished(QNetworkReply*)),this, SLOT(httpFinished(QNetworkReply*))); } QTInternet::~QTInternet() { } void QTInternet::httpFinished(QNetworkReply* reply){ // Reading attributes of the reply QVariant statusCodeV = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute); //int randomSayi = rand()%3; QMessageBox msgBox; //QString number(statusCodeV.toInt()); //msgBox.setText(number); //msgBox.setEscapeButton(QMessageBox::Close); //int ret = msgBox.exec(); QVariant tempQ = QVariant(statusCodeV.toString().length()); msgBox.setText(tempQ.toString()); int ret = msgBox.exec(); // "200 OK" received? if (statusCodeV.toInt()==200) { // TODO: read data from QNetworkReply msgBox.setText("Successfull!..."); int ret = msgBox.exec(); QByteArray bytes = reply->readAll(); // bytes const QString string(bytes); // string ui.textEdit->setText(string); } // Some http error or redirect else { // TODO: msgBox.setText("UnSuccessfull!..."); int ret = msgBox.exec(); } delete reply; } void QTInternet::fetch_clicked(){ QMessageBox msgBox; msgBox.setText("Fetch!..."); int ret = msgBox.exec(); QUrl url("http://www.google.com"); //QUrl url(ui.plEdit->text()); QNetworkReply* reply = netMan->get(QNetworkRequest(url)); }



