Phone recieving and sending messages
Hi there
i have configured my apache server servlet to send the message "hello world" to a phne, the phone recieves the message but when i want my phone to send a message back i get nothing just a "null" value, here is the code please take a look and let me know what is wrong:
phone side:
import java.io.*;
import javax.microedition.io.*;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
public class test extends MIDlet implements CommandListener{
Command connect;
String url;
Form form;
public test(){
HttpConnection hc = null;
InputStream in = null;
OutputStream out = null;
url = "http://localhost:80/testing_2/hits";
connect = new Command("Connect",Command.SCREEN,0);
form = new Form("connect");
form.addCommand(connect);
form.setCommandListener(this);
public void startApp(){
Display.getDisplay(this).setCurrent(form);
public void pauseApp(){}
public void destroyApp(boolean a){}
public void commandAction(Command c,Displayable d){
if(c==connect){
Thread t = new Thread(){
public void run(){
connects(); }
t.start();
public void connects(){
try{
HttpConnection hc;
InputStream in;
OutputStream out;
String req = "checlsea";
hc = (HttpConnection)Connector.open(url);
in = hc.openInputStream();
out = hc.openOutputStream();
try{
int contentlength = (int)hc.getLength();
byte[] raw = new byte[contentlength];
int length = in.read(raw);
in.close();
hc.close();
String s = new String(raw,0,length);
System.out.println(s);
byte post[] = req.getBytes();
for(int i=0;i<post.length;i++){
out.write(post);
System.out.println(post[i]);
catch(java.lang.IllegalStateException e){}
} catch(IOException e){ System.out.println("error lala");}
servlet side:
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
public class testing2 extends HttpServlet{
private int mcount;
public void doGet(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException{
String message = "hello world";
PrintWriter out = response.getWriter();
out.println(message);
BufferedReader in = request.getReader();
int i;
byte j;
i = in.read();
System.out.print( i);
some one plz help ive been trying to solve this for aaaaaaaaaaagees, any help would be greatly appreciated, regards
hi!
you need to use the loop
for(int i=0;i<post.length;i++){
out.write(post);
System.out.println(post);
out.write(byte array);
pls use the loop to read the stream on the server side!
[email protected]
Similar Messages
-
i can't use the green app of my ipod at home...but when i'm in another wifi place i can use it...please help me!!! T.T
If you are talking about the Messages app, try going to Settings>wifi and change the DNS to Googles's 8.8.8.8
-
Hi
I have my Dad's apple ID etc, but he has an iphone and i have an Ipod Touch then on IMessage i can read all the messages he recieves and sends and he can read all the messages i send and recieve how do i stop this? But i still want to send messages to him.
Thank You. You do not need a seperate Apple ID. One one device you just need to go to Settings>Messages and add another/different Messaging email address and delete the common Apple ID address. Also see:
MacMost Now 653: Setting Up Multiple iOS Devices For Messages and FaceTime -
Why mine iphone 5c cannot normal receive message and send message to another phone? I also cannot receive any message form Digi Centre~ I am form malaysia~
Sorry, forgot to add this and I can't find the edit button.
-I am using build: 9A406
-One funny thing I want to add too: when I put the iPhone in the Apple dock and connect it with my PC, I open iTunes and select my phone. There you can see the build, software version,.. But after telephonenumber it says N/A: not applicable.. Something I only just noticed. I'm pretty sure my number was displayed back in Nov. when I first got my iPhone 4S.
And the very last thing: Most of the time I have a very good signal, 4 out of 5 bars. It is only rarely that I have only 1 or 0 bars. -
I just upgraded my iPhone4s to iOS7 and now I am unable to make phone calls and send/receive text messaes. Network signal indicator on the upper left side of the display shows hollow circles instead of full circles (but with the network provider name). I checked with my colleagues in the office who use the same network and theirs work just fine on iOS7. Any idea how to fix the problem?
I have also called my service provider and my service remains active in the network. I tried removing and reinserting my SIM but to no avail.
-
Is there any way i can let another iphone user view my recieved and sent messages?
Is there any way i can let another iphone user view my recieved and sent messages?
Of course. Just show them your phone screen, and let them browse through your messages - the same way you would do so yourself.
-
How do I cancel the distance between the numbers?
I'm having trouble copy phone numbers from the phone book and send it via SMS
This problem I've found in the Arabic language, numbers appear in reverse
Please help
System 6.0.1MPEG-4 should not be used in FCP unless it is converted first or optimized in the application.
Trash your preferences. Trash your project render files. Switch off background rendering. Do not re-render. Export your projects.
Ignore the last frame and first frame indicators. -
ı wanna delete my purchase but it did hide and where is the hidding ı wanna delete my purchase please because I am not looking a few purchase (dowloaded at the apple store) help me and send message to my email thank you have good work.
what?
-
Enter and send message from portal
Hi
I am able to allow user to enter rejection reasons using task TS20000139 (Enter and Send Message) when the user clicks the Reject button in SAP Gui. However when the user clicks Reject from the portal, the Enter and Send Message does not appear immediately. Instead it appears as a new task in the portal. Is there a way for the Enter and Send Message to appear immediately in the portal when the user clicks on the Reject button ?Hi Ronaldo,
Also, as Jocelyn says...
<i>Hi folks,
Actually advance with dialog will work under some specific scenarios from the UWL.
1. If you are launching work items using WinGUI.
2. If you are launching work items using SAPGUI for HTML and are on a high enough release .
In other words, it depends on the launch mechanism - not the UWL.</i>
Try checking the launch mechanisms.
Regards
<i><b>Raja Sekhar</b></i> -
Hello All!
Is there a Way to receive and send Messages with attachments From Forms 6i?
Could you give us one actual example i really cant understand this how to do this through forms?
AronaWhat kind of messages? If you are referring to email, then if you search this forum, you will find many threads. Here are a few:
Sending email with a pdf attachment
email attachment
Re: CLIENT_OLE2 and Outlook to send an email.. -
Any (source code)FREE BOOK implementing recieving and sending emails
any (source code)FREE BOOK implementing recieving and sending emails
if avgailable on net.
please help...
Regards,
Navin.check this out:
http://www.javaworld.com/javaworld/jw-10-2001/jw-1026-javamail.html -
I need to block some phone numbers and text messages from my iphone
I need to block some phone numbers and text messages from my iphone
Contact your provider and see if they have a means to do this. It can be done for a cost with AT&T.
-
My i phone 4 will send messages but does not receive them - why?
My i phone 4 will send messages but does not receive them - why is this?
e mail works both waysDid you already check the general troubleshooting for messages here?
http://support.apple.com/kb/TS2755 -
I'm unable to use Fiverr.com with Firefox. Last year I was able to order Fiverr gigs and send messages but for the last 3 weeks I've been unable to do either. I can login to Fiverr but I'm unable to use the service.
I'm using Windows 7.Many site issues can be caused by corrupt cookies or cache. In order to try to fix these problems, the first step is to clear both cookies and the cache.
Note: ''This will temporarily log you out of all sites you're logged in to.''
To clear cache and cookies do the following:
#Go to Firefox > History > Clear recent history or (if no Firefox button is shown) go to Tools > Clear recent history.
#Under "Time range to clear", select "Everything".
#Now, click the arrow next to Details to toggle the Details list active.
#From the details list, check ''Cache'' and ''Cookies'' and uncheck everything else.
#Now click the ''Clear now'' button.
Further information can be found in the [[Clear your cache, history and other personal information in Firefox]] article.
Did this fix your problems? Please report back to us! -
After Clicking Rejection(Enter and send message from portal )
Hi
I am able to allow user to enter rejection reasons using task TS20000139 (Enter and Send Message) when the user clicks the Reject button in SAP Gui. However when the user clicks Reject from the portal, the Enter and Send Message does not appear immediately. Instead it appears as a new task in the portal. Is there a way for the Enter and Send Message to appear immediately in the portal when the user clicks on the Reject button or any other task is there for Enter and Send Message supporting SAP portal...
please let me know the solutions...
Thanks
ramRam,
the Advanced with Dialog works fine only in certain scenarios, as Jocelyn mentioned in the following thread. pl go thru' this.
Extended Notification-Submethods and advance with dialog not supported...
COming to your requirement, if you want to provide a box for the user to enter Rejection reason on the portal side, you can use the User decision Actiion Handlers as given in the below link. It is very simple and fast implementaion.
I have done this recently, so if you need more details, let me know.
But go thru' the following help.sap link on ACtion Handlers.
http://help.sap.com/saphelp_nw2004s/helpdata/en/7a/df014b037141ca9afc6433ed42b519/frameset.htm
Hope this helps.
Regards,
venu
Maybe you are looking for
-
I am having problems connecting my macbook air to an external display
I recently purchased a 2012 MacBook Air, and am currently running Mountain Lion. When I try to connect an external VGA overhead projector, for use in a conference room, using the Thunderbolt to VGA adapter, my screen resolution changes, but nothing i
-
JSF h:commandButton which renders as an html button rather then input
I've been struggling to find a way to create a jsf command button that will render as a <button>. The reason I want to do this is so that I can include content inside my button, as the html <button> tag allows. Is there a way to do this, or is this i
-
How to migratre Lightroom DB to another PC
Hi, I recently got a more powerful PC and would like to move my Lightroom DB and photos to that PC so I can work more efficiently. I've copied the photo files to the new hard drive (same path). I then copied the Lightroom DB over top of the default o
-
i would like to read a QUERY build from Query Manager via Peoplecode &sQryName = ""; &aRunQry = %Session.GetQuery(); &sQryName = "MY_QUERY"; If (&aRunQry.Open(&sQryName, False, False) <> 0) Then MessageBox(0, "", 0, 0, "failed to open query"); Else &
-
HELP PLEASE! Green marks near words on web browsers can't get rid of any ideas
I have as soon as i click on a link on the web pages - green marks appear near words and they open up a new tab which shows advertised pages - how do i get rid of them. I have run spy ware but does not remove or change anything ,,, Thanks