How to write a program that allows an HTTPs connection to the APACHE TOMCAT server in blackberry JDE
Hello.. I am very new to the blackberry JDE environment. But then, I have a project in which I should write a program that will make an HTTPs connection to the apache tomcat server using blackberry JDE. The simulator which I use is 8330-JDE.
Here is my code...
import java.io.IOException;
Import java.io.InputStream;
Import javax.microedition.io.Connector;
Import javax.microedition.io.HttpsConnection;
Import net.rim.device.api.ui.UiApplication;
Import net.rim.device.api.ui.container.MainScreen;
public class Httproto extends UiApplication
{
public public static void main (String [] args)
{
Httproto instance = new Httproto();
instance.enterEventDispatcher ();
}
public Httproto()
{
pushScreen (new HttpsConnectionScreen());
}
}
final class HttpsConnectionScreen extends screen
{
public HttpsConnectionScreen()
{
HttpsConnection c = null;
InputStream is = null;
int rc;
try {String url =
"https://192.168.2.3: 8443/cit/j_acegi_security_check? j_username = sanogo & j_password = redhat;
c = (HttpsConnection) Connector.open (url);
c.setRequestMethod (HttpsConnection.POST);
System.out.println ("connection is open with the server");
Get the response code is open the connection,
Send the request and read HTTP response headers.
The headers are stored until asked.
RC = c.getResponseCode ();
System.out.println ("response from the server" + rc);
if (rc! = HttpsConnection.HTTP_OK) {
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) {
int actual = 0;
int BytesRead = 0;
byte data = new byte[len]; while ((bytesread! = len) & (real! = - 1)) {
real = is.read (data, bytesread, len - bytesread);
bytesRead += real;
}
} else {}
int ch;
while ((ch = is.read (())! = - 1). {
}
}
} catch (ClassCastException e) { throw new IllegalArgumentException ("not a HTTP URL");}
}
catch (IOException ioe) {}
finally {
Try
{
if (is! = null)
is. Close();
if (c! = null)
c.Close ();
}
catch (IOException ioe) {}
}
}
}
When I run this program in the Simulator, I can do nothing. Please correct me if I'm wrong in coding.
As I am new to this blackberry JDE environment, ideas and suggestions on how to write and run the sample applications in the blackberry are more welcomed.
Concerning
Hinduja
Make sure that your MDS starts when the Simulator starts. In the JDE will in Edition > Preferences > Simulator > General and click the checkbox "launch Mobile Data System connection with Simulator Service.
Tags: BlackBerry Developers
Similar Questions
-
Software loaded, computer rebooted, selected activate over the internet (internet works), entry of information required (US) and subject - receipt cannot connect to the Microsoft activation server. tried to activiate telephone (not then given telephone number I looked on internet) called tech support and they can not activate by phone and referred me to this site.
original title: unable to activiate microsoft xp professionalHow to contact a Microsoft Product Activation Center:
http://support.Microsoft.com/default.aspx/KB/950929/en=usMicrosoft Activation centers worldwide telephone numbers:
http://www.Microsoft.com/licensing/existing-customers/activation-centers.aspx
(This site is for activating Volume License, but if you call, they will help you)The phone number is not working:
Microsoft Wordwide contacts: http://www.microsoft.com/worldwide/default.aspxOnce Windows activated / Genuine Advantage Notifications:
http://www.Microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=afd45b36-3d77-4259-801c-d31a9a90cdcf
(This tool will confirm that the copy of Windows installed on your PC is genuine and authorized)J W Stuart: Http://www.pagestart.com
-
How to create a program that allows to perform sequential tasks?
A particular task should be performed first, then only the authorization is given to perform the next task?
It is possible on LabVIEW?
LabVIEW comes with examples. You should look at the examples and the research of the structure of State machine. It will show you the details on how to structure your code in order to allow the exact process that you use to succeed. Try to look at this code and then come back when you have a code for us to examine. This allows to inform you and guide you through how to use things properly.
We like it more when you have specific questions, as I can't get this to work or I don't understand how it works...
I hope that you help so that we can better help you.
-
I have firefox uninstalled and reinstalled, but get the same allert
Always leave
Check and tell if its working.
-
How to open a program that ends with... .iXL?
How to open a program that ends with... .iXL?
You try to open a file with an extension of .ixl?
This file extension seems to be associated with the Inmagic Inc. software.
http://FILExt.com/file-extension/IXL
The file may be in XML format, in which case you can open it with Notepad.
http://www.iSiloX.com/support/manual/IXL/IXL.htm
http://www.iSilo.com/ may be what you are looking for.
-
HOW CAN I KNOW PROGRAMS THAT I USE IS NO LONGER IN WINDOWS 7
HOW CAN I KNOW PROGRAMS THAT I USE IS NO LONGER IN WINDOWS 7. Where will be click here to see the programs that I don't use anymore in my pc.
Windows out of the box with WordPad, Notepad, calculator, and paint. Anything else (other than the administrative tools) will have been added by you, so get your mind on what you have installed.
You can refresh your memory by looking at all THE PROGRAMS in the start menu...
-
How can I cancel a subscription. I am being charged monthly for a program that is not pop up on the tab plans and services. I don't remember if it's creative cloud or something else. I remember logging in the past months to cancel it, but I couldn't find the way.
Make sure that you are logged on the Adobe site, having cookies enabled, clearing your cookie cache. If he continues to not try to use a different browser.
-
How to provide a botton that takes a quick measure of the Isc and VOC?
Right now I have a program that allows to measure Voc, Isc and the efficiency of the solar cell. How to provide a botton that takes a quick measure of the Isc and VOC and displays the result next the botton? I want to do this because I want to know VOCS and SAIS before hand, so that I can set the amplitude of scanning. In addition, I also want to set the initial time in seconds. At present, the time is 3 seconds, I can't find where to put them, is 3 seconds by default.
Button not botton.
It will be similar to what you have already in your another thread.
Did you take the tutorials since then? I highly recommend you do.
LabVIEW Introduction course - 3 hours
LabVIEW Introduction course - 6 hours -
How to write graph of waveform data to text file with the option to the user to do
So, I'm new to labview and will have bad to write a program in particular. I have a waveform graph that runs for 120 seconds, generating a sine curve. I am, however, having a time difficult get the program to write the x and are coordinated in a text file. I've attached what I have so far.
The first task I was assigned was to write a program that creates a curve of snusoidal on the front panel by adding a data point every half second for 120 seconds. The plot should starts only if the user presses a button to start.
The next part is to give the user an option to write the data generated in a file of worksheet called 'sine.txt '. The file name and location should be hard-coded. The file must contain the x and there contact information of each data point in columns separated by tabs, also known as the delimited.
I spent several hours refining the attached program, and I can't seem to make it work right. Any suggestions would be helpful at this stage.
Sincerely,
A student of chemistry frustrated whose research mentor is out of town
First, you create files Excel. You create text files. And it seems that your writing on a file already created X (time) vs Y (curve of data) that is delimited by tabs.
All you do is simply too complicated or a Rube Goldberg.
All you need is the joint.
-
We will use a script that allows users to connect only once.
We will use a script that allows users to connect only once.
However some users need a second possibility of connection.
How is - this can be handled in a script?The users in question are members of the same group secuity.
Where the use of Windows server 2003 with xp clients.
Hello
Your question of Windows 7 is more complex than what is generally answered in the Microsoft Answers forums. It is better suited for the IT Pro TechNet public. Please post your question in Windows 7 IT Pro Technet Forums network.
http://social.technet.Microsoft.com/forums/en/category/WindowsServer/
I hope this helps.
-
whenever I click on a program, that it does not open and the 'open with' screen appears
whenever I click on a program, that it does not open and the 'open with' screen appears
Hello
Use above message for intense and thorough check for malware.
To restore the ability to run any .exe programs.
1 make a Restore Point so that you can come back if necessary back although probably not required.
How to create a Vista System Restore Point
http://www.Vistax64.com/tutorials/76332-system-restore-point-create.htmlHow to make a Vista system restore
http://www.Vistax64.com/tutorials/76905-System-Restore-how.html
2. copy BETWEEN these lines and paste it into Notepad - save as exefileFix.reg - then right
Click on it and FUSION - REBOOTDO NOT COPY THE LINES
-----------------------------------------------------------------Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\. [EXE]
@= "exefile".
"Content Type"="application/x-msdownload".[HKEY_CLASSES_ROOT\. EXE\PersistentHandler]
@= "{098f2470-bae0-11cd-b579-08002b30bfeb}".[HKEY_CLASSES_ROOT\exefile]
@= "Application".
"EditFlags" = hex: 38, 07, 00, 00
"FriendlyTypeName" = hex (2): 40, 00, 25, 00, 53, 00, 79, 00, 73, 00, 74, 00, 65, 00, 6 d, 00, 52,------.
00, 6f, 00, 6f, 00, 74, 00, 25, 00, 5 c, 00, 53, 00, 79, 00, 73, 00, 74, 00, 65, 00, 6 d, 00, 33, 00,------.
32,00, 5 c, 00, 73, 00, 68, 00, 65, 00, 6 c, 00, 6 c, 00, 33, 00, 32, 00, 2nd, 00, 64, 00, 6 c, 00, 6 c,
00, 2 c, 00, 2d, 00, 31, 00, 30, 00, 00, 31, 35, 00, 36, 00, 00, 00[HKEY_CLASSES_ROOT\exefile\DefaultIcon]
@="%1"[HKEY_CLASSES_ROOT\exefile\shell]
[HKEY_CLASSES_ROOT\exefile\shell\open]
"EditFlags" = hex: 00, 00, 00, 00[HKEY_CLASSES_ROOT\exefile\shell\open\command]
@="\"%1\" %*"
""IsolatedCommand"="\"%1\" %. "[HKEY_CLASSES_ROOT\exefile\shell\runas]
[HKEY_CLASSES_ROOT\exefile\shell\runas\command]
@="\"%1\" %*"
""IsolatedCommand"="\"%1\" %. "[HKEY_CLASSES_ROOT\exefile\shellex]
[HKEY_CLASSES_ROOT\exefile\shellex\DropHandler]
@= "{86C86720-42A0-1069-A2E8-08002B30309D}".[- HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.exe\UserChoice]
--------------------------------------------------------------
DO NOT COPY THE LINESIf necessary:
Check the fix of exe here
http://www.Winhelponline.com/articles/105/1/file-association-fixes-for-Windows-Vista.htmlAlso check this one if it applies
http://www.Winhelponline.com/articles/165/1/restore-the-exe-file-association-in-Windows-Vista-after-incorrectly-associating-it-with-another-application.htmlHow to set default Associations for a program under Vista
http://www.Vistax64.com/tutorials/83196-default-programs-program-default-associations.htmlI hope this helps.
-
Why always show that "there is a connection to the Apple store error."? It has been a month I am facing such a problem. How can I fix? Hope you have a solution to this...
I don't know if this is the problem, but it is something that must be correct establish a secure connection:
Open Date and time preferences system, Date & time tab. Make sure that it is set to automatically set the time.
Alternatively, make sure that your date/time is correctly set to the second.
Another thing to try is to restart your modem and router.
-
My computer screen is in landscape position. How can I fix so that I do not read on the side?
Friday, October 19, 2012 13:12:42 + 0000, LisaCarey wrote:
My computer screen is in landscape position. How can I fix so that I do not read on the side?
The ability to rotate the screen image is a characteristic of your video
card, to help work with instructors who turn to the portrait
orientation. Almost certainly you accidentally pressed Ctrl-Alt, and
an arrow key.Rotate using these keys.
Ken Blake, Microsoft MVP
-
What happened to the brushes PS that allows us to get on the Adobe site? I can't find them.
Hello
Can I know what Adobe site? Do you mean https://creative.adobe.com/addons
Thank you
-
Is there a way to color the correct main items that allows me to export/save the results as a mp4? I shot images that I need to spend on another editor for editing, but I want to fix the images colors before putting to sea. I know you can color correct elements, but is it possible to export the clips to the original position of the source for mp4? I tried to export a clip using H.264 corresponds to the source, but the result is a half the size of the original file. Your help is appreciated!
You realize that what you do is a generational loss. Compression of the images already well compressed!... as well as many other works that used saw the final cut.
Increase the flow of your export to preserve quality as much as possible.
Maybe you are looking for
-
I live in Ukraine, today apple Russian support refused to help me. Where can I go?
-
Protection of personal information
at the first time, using my old phone Samsung Galaxy Verizon SCH-S3 - I535 Skype worked perfectly, but then change my phone for Skype Samsung Galaxy S4 T-Mobile SGH-M919 has now finished with a question. during any kind of calls even call the sound T
-
Photosmart C5200: Printer fails to print
I can print and copy normal documents, but when I change the text in a document and try to print the computer sends the signal of the poster "Now printing" printer and then stops! I tried to disconnect and reconnect the printer, but it makes no diffe
-
BSOD on reboot after installing the patch MS10-046
I installed the critical patch MS10-046 on a netbook under XP SP3. On reboot, bsod with error message: "The Shell32.dll image is possibly corrupt. The header checksum does not match the checksum calculated. » The only way to start was via a USB key.
-
Changed the color scheme, but can not change back
original title: Color and appearance I have inadvertently changed the intensity of the color of my color scheme, now I can't change it back. The tasks and the text boxes are so pale they appear white against white window. How can I change this back