HELP Needed HttpConnection PROBLEM
Hi I'm a Newbie to the Blackberry development... I'm trying to read data from the URL through HttpConnection. Here it is my code. When I call through Simulator code, the following code does not run... System.out.println ("MDS getResponseCode" + c.getResponseCode ()); There is no exception too... Pls help what's wrong in my code...
Thanks in advance - Poy
import java.io.IOException;
import java.io.InputStream;
java.lang.String import;
Import javax.microedition.io.Connector;
Import javax.microedition.io.HttpConnection;
Import net.rim.device.api.ui.Field;
Import net.rim.device.api.ui.FieldChangeListener;
Import net.rim.device.api.ui.UiApplication;
Import net.rim.device.api.ui.component.ButtonField;
Import net.rim.device.api.ui.component.LabelField;
Import net.rim.device.api.ui.container.MainScreen;
Main class
SerializableAttribute public class HttpCxn extends UiApplication {}
Starting point
Public Shared Sub main (String [] args) {}
HttpCxn httpCxn = new HttpCxn();
httpCxn.enterEventDispatcher ();
}
Initial screen of calls
public HttpCxn() {}
pushScreen (new HttpCxnScreen());
}
}
class HttpCxnScreen extends form {}
Declare my initial variables
ButtonField submitButton = new ButtonField ("Submit", ButtonField.CONSUME_CLICK);
HttpCxnScreen screen = this;
Main screen, including the entries for the character/server names
public HttpCxnScreen() {}
Create the label of title for the main screen
LabelField mainTitle = new LabelField ("HTTP CONNECTION", LabelField.ELLIPSIS
| LabelField.USE_ALL_WIDTH);
Set title to the top of the label
setTitle (mainTitle);
Add other elements to the form
Add (submitButton);
Create the feature of the "submit" button
submitButton.setChangeListener (new FieldChangeListener() {}
' Public Sub fieldChanged (field field, int context) {}
Thread postnameThread = new Thread (new ServerConnection());
postnameThread.start ();
}
});
}
http connection class
ServerConnection class extends Thread {}
String url = ""http://172.24.30.27: 9091/demo/index.jsp;deviceside=false ";"
Method called by the Send button
public ServerConnection() {}
System.out.println ("test");
}
public void run() {}
C HttpConnection = null;
InputStream is = null;
Response string;
int rc;
try {}
StringBuffer buffer = new StringBuffer();
System.out.println ("URL" + URL);
c = (HttpConnection) Connector.open (url);
System.out.println ("AZtest" + c); My debugger not crossed this line
Get the response code is open the connection,
Send the request and read HTTP response headers.
The headers are stored until asked.
System.out.println ("MDS getResponseCode" + c.getResponseCode ());
RC = c.getResponseCode ();
System.out.println ("CHECK MDS" + rc);
If (rc! = HttpConnection.HTTP_OK) {}
System.out.println ("HTTP_OK" + RC);
throw new IOException ("HTTP response code:" + rc);
}
is = c.openInputStream ();
Get the ContentType
The string of type = c.getType ();
The length and process data
int len = (int) c.getLength ();
If (len > 0) {}
real int = 0;
int BytesRead = 0;
data Byte [] = new ubyte [len];
While ((bytesread! = len) & (real! = - 1)) {}
real = is.read (data, bytesread, len - bytesread);
bytesRead += real;
}
} else {}
int ch;
While ((ch = is.read (())! = - 1) {}
ch = is.read ();
buffer. Append ((Char) ch);
}
response = buffer.toString ();
}
} catch (Exception e) {}
e.printStackTrace ();
}
}
}
}
This message can help.
Tags: BlackBerry Developers
Similar Questions
-
Desperate Help Needed re problem of Activation/Installation CS6
A few months ago, I bought the full commercial version of CS6 (standard) for Windows. I installed on another clean computer with Windows 7 and activated and registered. Installation, activation and registration process went smoothly, and initially, everything seemed OK.
A little more than a month, the nightmare began. Since then, whenever I try to run one of the CS6 components, I get a message telling me it "thinks" I have the trial version installed (although actually, I installed and activated the full version) and asks me if I want to "start trial" or "license of this software." If I choose "license" it asks my serial number (which has already been repeatedly entered) and then it seems to be OK - for a while. However, in a period of time, the problem is back, and the cycle starts again.
I've tried repeatedly (and spent countless dozens of hours) trying to solve this problem through Adobe support, both by telephone and via the 'chat '. Each time, I end up telling the same story to several different people, re-explain until they apparently understand it and then get transferred around several people until I finally get to someone who, supposedly, can help. Then, this person walk in the same things that have been tried many times before. Finally, I am sure that the problem has been fixed and also assured me that they will keep the case open. Each time, the problem has not been fixed, and I find that the case was classified (so the only way I can try to communicate is by starting all over, lose more hours trying to get through and finally again learn to someone who has no idea what to do otherwise that to tell me to do the same things that have already been proven (many times) not to work).
The result of all this is that I have a piece of a $1200 software that is totally useless.
Maybe someone from Adobe can help me with how to take this to the next level so that it is someone with the knowledge to understand how to solve the problem. If anyone other that Adobe has solved a similar problem, any suggestion would be appreciated.
Robert Rothman (a very dissatisfied customer)
Edit: To be clear, this has not purchased via download; I installed from the physical disks.
Is Rob Rothman possible that you only encounter this difficulty with your 64-bit activations? I recommend the revision of 64-bit applications ask repeatedly to activate - l http://helpx.adobe.com/creative-suite/kb/64-bit-creative-suite-applications-repeatedly.htm. If you are affected by this problem then I would recommend bookmarking this document as it will be updated once our engineering team has discovered a solution.
-
I need help with a problem of file softdub.dll any answers or how to replace it?
I need help with a problem of file softdub.dll all the answers, or how to replace it? Yes, it's a problem of Vista vs itunes and apparently I lost? This file somehow. I have no idea how blessed remedy. I tried all the normal fixes / easy I know, but I am a novice at best. so please, be gentle and try to guide me through a response. Please, I beg you!
Hello
Did you download and save iTunes on the desktop > then right-click > select run as administrator to install?
If you don't have anything done, see if this information helps you.
"Not to install iTunes or QuickTime for Windows"
http://support.Apple.com/kb/HT1926
«Remove and reinstall iTunes, QuickTime, and other software components for Windows Vista or Windows 7»
http://support.Apple.com/kb/HT1923
If the advice already given does not, please contact Apple for assistance.
"iTunes support-how to use iTunes.
http://www.Apple.com/support/iTunes/
"Contact iTunes Support.
http://www.Apple.com/support/iTunes/contact/
Or ask in the community Apple iTunes:
https://discussions.Apple.com/community/iTunes
See you soon.
-
my hotmail account has been temp.blocked I tried the sms message thing and it did not work I know my password, but when I was able to access my account was limited because of the temp. block can you please help? Or should I find another email provider?
Thank you for your quick response;Shannon aka ChilaHello
I'm sorry, but we cannot help with hotmail problems in these forums in response to vista
Please repost your question in hotmail in the hotmail link below forums
http://windowslivehelp.com/product.aspx?ProductID=1
ForumsConsult with Microsoft Certified Solutions -
X120e - Help! BIOS problems!
Hi again,
I'm getting some strange behaviour in the bios. One of them is that I can not activate the AMD V (TM) technology. I allow it, save the changes and reboot. The value is returned to the people with reduced mobility.
Also, sometimes I lose some of the tabs in the bios, which is the Startup tab. I have to Load Setup Defaults to have that tab back, although I did not change in the bios.
Another thing is that I can't get the boot of diagnosis. I always get the quick start (with the lenovo logo). Cannot enable the diagnostic startup.
What is going on? Is the bios software buggy, or my Board is saying 'goodbye '?
abvasili
Hi abvasili,
I've got your MP about your request for help for this problem of fixing on the center of services because of your first experience with them.
Please give me the info I need in my MP replied you.
Thank you very much!
Kind regards
Cleo -
I have wndow XP Home edition service pack 3 installed on my lap top. When I start the computer the hard drive continues to work for almost 1/2 hour; Meanwhile, if I open IE, or any program, the machine runs very slowly and I just can not open the program up until the drive hard light is off. Please help solve the problem
How much RAM you have on your system? (Right click on "My Computer"-> properties)
As a general rule, Windows XP does not work well if you have less than 1 GB or more of RAM. What usually happens is that your RAM capacity is exceeded leading to overflow on virtual memory (the drive) to compensate for the need of RAM in the computer. This causes your system to beat on your hard drive and slow down your system.
If this is your problem, the options are to increase the RAM on your system or decrease the non-essential programs that launch at startup on your computer using a tool like Autoruns.
HTH,
JW -
Please can someone help, need password CNU9497P2C
I have the same problem and its driving me crazy... I need the BIOS password because I can't access to this
[number of Series edited by Moderator]
Please can someone help, need password
HP MINI CQ10
Sweb try.
e9lovox27e
3rd letter tiny L.
4th and 6th letter lowercase o.
Use this code to go into the BIOS.
Disable all passwords that are enabled.
If demand for CURRENT password using this code.
Request NEW password just press ENTER.
If asked to hit just to CHECK password to enter.
Save and exit.
REO
I must inform you that these services are not endorsed by HP, and that HP is not responsible for any damages that may occur to your system using these services. Please be aware that you do so at your own risk.
-
Hello! A few days ago, I, disabled Photoshop subscription (CC of Lightroom and Photoshop CC) Act in accordance with your instructions, I have not be enabled. Please help solve the problem?
Contact support - for the link below, click on the still need help? option in the blue box below and choose the option to chat or by phone...
Make sure that you are logged on the Adobe site, having cookies enabled, clearing your cookie cache. If it fails to connect, try to use another browser.
Creative cloud support (all creative cloud customer service problems)
http://helpx.Adobe.com/x-productkb/global/service-CCM.html ( http://adobe.ly/19llvMN )
-
Hello
I got this message after the import on ten H.264 files that I coded for Adobe media encoder. "It is not available on this system from adobe yet the software that is used to decode the media. install the correct decoders for the file you are editing can help fix the problem. »
The files that we have shot with HD cameras. Edited in Premiere Pro CS3. I installed the update 3.0.1 with always the same error.
I also tried a new project and after about ten or so files imported into a timeline, the breakdown of the system. I tried twice...
Thanks in advance
Please report to us. I don't know the exact specifications. for stills in still, the limit is 4000 pixels in the largest dimension for PrPro.
Now, I must add that in PS. resizing algorithms are better, in my opinion, than those of PrPro and again. This means that there is nothing to gain and quality of untying, important images much larger than the size of the frame of the project, i.e. of 720 x 480 for NTSC SD projects yet. The size of the image will be the limiting factor, so scratch that.
Even in projects PrPro, I resize to exactly what I need. If I will not pan on a zoomed image, I resize it to the size of the image of the project. If I move on a zoomed image, I resize just what I need.
Good luck
Hunt
-
I'm still stuck on my * address email is removed from the privacy * e-mail account. I get this error code 80048823. Can I get help with this problem?
Hi Rutherford,
Since the problem is related to Windows Live, you can also send your query to Windows Live Solution Center.
-
My mac will be save, convert doc or pdf or convert docx. I have not had this problem before. I'm a business, so I need this problem immediately.
Thank you.
Jamie
Hello
You try this - would require
Acrobat > Preferences > under general > under basic tools, uncheck the option "online storage see the saving of files.
Kind regards
Christian
-
Seeking help with a problem with the LRI use LR CC on a laptop, when you try to export a picture to an external hard drive, I am now without apparent reason to get the following message."Could not create a respondent JPEG limit you 92 k Bytes.Please increase the size limit files. (1)......I tried to increase the size of the file several times,I left LRI restarted the computer.Any help or advice for this problem will be greatly appreciatedThanks in advance@stu
Not because of the number of pixels, in this photo and the chosen level of quality there is no possible way to create a JPG file to the size of file you requested. You must change your export settings.
Show us a copy of the export dialog box, so we can see clearly the part file setting and the size of the Image.
Also indicate the number of this image (width and height) pixels after cropping (as appropriate) and prior to export.
-
Error 213:10 on windows 10. Please help solve the problem
Error 213:10 on windows 10. Please help solve the problem
Different code, but can help - error 213:19 license https://forums.adobe.com/thread/1907953 because of write permissions
Run all programs as Administrator http://forums.adobe.com/thread/969395 to assign FULL... Permissions said yet, but it is sometimes necessary for Adobe
-
Get error 207 trying to download creative Cloud and someone please help with this problem, thanks in advance please.
Please refer to
-
And anyone who has used the creative cloud cleaner to help with installation problems? I should try?
Hi Alison,.
You do not specify the issue that you are facing, but you can restore Photoshop CC 2014.Please use the link below to find out how to install an older version of any Application Adobe CC.
How to find and install a previous Version of Adobe Apps in CC 2015 | Adobe Customer Care Team
Link to adobe vacuum as you said use the Adobe Creative Cloud cleaning tool to solve installation problems
Cloud troubleshooting creative risks troubleshoot Adobe Creative Cloud download and installation issues
Let us know if that helps you solve/Rolling back Photoshop.
~ Assani
Maybe you are looking for
-
Pinned tabs are not visible.
After I pin a tab in ff29, she disappears to the left of the row of tabs. I see a grey box blank where the pinned tabs were visible in ff28.
-
Satellite R830 - FN keys not working not
Hello I have a laptop model * R830 *, but unfortunately the FN keys does not workI hope you help me With gratitude and thanks in advance* Fahmi
-
Equium A60 stops automatically after 10 min
My laptop TOSHIBA Equium A60, after 10 minutes of work it disconnects because it seems to become very hot, even if the fan is working? How can I solve this problem
-
Hi all I just set up a new production machine and the last cvi for linux runtime is installed. If I compile a program white int main (void) {return 2 ;} it works fine.} But a simple prog like this immediately main dumps: #include int main (int argc,
-
WRE54G V3 - Web: gateway no response
I configured my WRE54G, following the instructions and moved in my living room and confirmed that the link linght has turned blue. Since my iPhone wif' are and my Nokia N97, we now see a signal of 100%, up from 45 percent before installing the expan