How to send data back to the server

i create a program to send data back to ther server using j2me.
its work well on emulator but when i install the application on sony ericsssin p910i or k700i or nokia 7710 then its not working and simply hang.
here is sample code which is run well on emulator but not on mobile.
what is the problem in that or how can this code run in mobile is there any mobile specific setting or internet setting.
Pls reply asap.
import java.io.*;
import javax.microedition.io.*;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
* An example MIDlet to invoke a CGI script.
public class ThirdExample extends MIDlet {
private Display display;
// String url = "http://www.javacourses.com/cgi-bin/getgrade.cgi?idnum=182016";
String url = "http://sampler.infopro.stpn.soft.net/midletdata.asp?name=name";
public ThirdExample() {
display = Display.getDisplay(this);
* Initialization. Invoked when we activate the MIDlet.
public void startApp() {
try {
getGrade(url);
} catch (IOException e) {
System.out.println("IOException " + e);
e.printStackTrace();
* Pause, discontinue ....
public void pauseApp() {
* Destroy must cleanup everything.
public void destroyApp(boolean unconditional) {
* Retrieve a grade....
void getGrade(String url) throws IOException {
HttpConnection c = null;
InputStream is = null;
OutputStream os = null;
StringBuffer b = new StringBuffer();
TextBox t = null;
int x = 5, y =7;
try {
c = (HttpConnection)Connector.open(url);
c.setRequestMethod(HttpConnection.GET);
c.setRequestProperty("IF-Modified-Since", "10 Nov 2000 17:29:12 GMT");
c.setRequestProperty("User-Agent","Profile/MIDP-1.0 Confirguration/CLDC-1.0");
c.setRequestProperty("Content-Language", "en-CA");
os = c.openOutputStream();
String str = "?idnum=182016";
byte postmsg[] = str.getBytes();
for(int i=0;i<postmsg.length;i++) {
os.writeByte(postmsg);
os.flush();
is = c.openDataInputStream();
int ch;
while ((ch = is.read()) != -1) {
b.append((char) ch);
System.out.println((char)ch);
t = new TextBox("Final Grades", b.toString(), 1024, 0);
} finally {
if(is!= null) {
is.close();
if(os != null) {
os.close();
if(c != null) {
c.close();
display.setCurrent(t);
}>

i create a program to send data back to ther server using j2me.
its work well on emulator but when i install the application on sony ericsssin p910i or k700i or nokia 7710 then its not working and simply hang.
here is sample code which is run well on emulator but not on mobile.
what is the problem in that or how can this code run in mobile is there any mobile specific setting or internet setting.
Pls reply asap.
import java.io.*;
import javax.microedition.io.*;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
* An example MIDlet to invoke a CGI script.
public class ThirdExample extends MIDlet {
private Display display;
// String url = "http://www.javacourses.com/cgi-bin/getgrade.cgi?idnum=182016";
String url = "http://sampler.infopro.stpn.soft.net/midletdata.asp?name=name";
public ThirdExample() {
display = Display.getDisplay(this);
* Initialization. Invoked when we activate the MIDlet.
public void startApp() {
try {
getGrade(url);
} catch (IOException e) {
System.out.println("IOException " + e);
e.printStackTrace();
* Pause, discontinue ....
public void pauseApp() {
* Destroy must cleanup everything.
public void destroyApp(boolean unconditional) {
* Retrieve a grade....
void getGrade(String url) throws IOException {
HttpConnection c = null;
InputStream is = null;
OutputStream os = null;
StringBuffer b = new StringBuffer();
TextBox t = null;
int x = 5, y =7;
try {
c = (HttpConnection)Connector.open(url);
c.setRequestMethod(HttpConnection.GET);
c.setRequestProperty("IF-Modified-Since", "10 Nov 2000 17:29:12 GMT");
c.setRequestProperty("User-Agent","Profile/MIDP-1.0 Confirguration/CLDC-1.0");
c.setRequestProperty("Content-Language", "en-CA");
os = c.openOutputStream();
String str = "?idnum=182016";
byte postmsg[] = str.getBytes();
for(int i=0;i<postmsg.length;i++) {
os.writeByte(postmsg);
os.flush();
is = c.openDataInputStream();
int ch;
while ((ch = is.read()) != -1) {
b.append((char) ch);
System.out.println((char)ch);
t = new TextBox("Final Grades", b.toString(), 1024, 0);
} finally {
if(is!= null) {
is.close();
if(os != null) {
os.close();
if(c != null) {
c.close();
display.setCurrent(t);
}>

Similar Messages

  • Send Data back to the Server

    Hi.
    how to send data back to the server using J2ME or how to communicate with server using J2ME

    i am using http its work well on emulator but when i install the application on sony ericsssin p910i or k700i or nokia 7710 then its not working and simply hang.
    here is sample code which is run well on emulator but not on mobile.
    what is the problem in that or how can this code run in mobile is there any mobile specific setting or internet setting.
    Pls reply asap.
    import java.io.*;
    import javax.microedition.io.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.midlet.*;
    * An example MIDlet to invoke a CGI script.
    public class ThirdExample extends MIDlet {
    private Display display;
    // String url = "http://www.javacourses.com/cgi-bin/getgrade.cgi?idnum=182016";
    String url = "http://sampler.infopro.stpn.soft.net/midletdata.asp?name=name";
    public ThirdExample() {
    display = Display.getDisplay(this);
    * Initialization. Invoked when we activate the MIDlet.
    public void startApp() {
         try {
    getGrade(url);
         } catch (IOException e) {
         System.out.println("IOException " + e);
         e.printStackTrace();
    * Pause, discontinue ....
    public void pauseApp() {
    * Destroy must cleanup everything.
    public void destroyApp(boolean unconditional) {
    * Retrieve a grade....
    void getGrade(String url) throws IOException {
    HttpConnection c = null;
    InputStream is = null;
    OutputStream os = null;
    StringBuffer b = new StringBuffer();
    TextBox t = null;
    int x = 5, y =7;
    try {
    c = (HttpConnection)Connector.open(url);
    c.setRequestMethod(HttpConnection.GET);
    c.setRequestProperty("IF-Modified-Since", "10 Nov 2000 17:29:12 GMT");
    c.setRequestProperty("User-Agent","Profile/MIDP-1.0 Confirguration/CLDC-1.0");
    c.setRequestProperty("Content-Language", "en-CA");
    os = c.openOutputStream();
    String str = "?idnum=182016";
    byte postmsg[] = str.getBytes();
    for(int i=0;i<postmsg.length;i++) {
    os.writeByte(postmsg);
    os.flush();
    is = c.openDataInputStream();
    int ch;
    while ((ch = is.read()) != -1) {
    b.append((char) ch);
    System.out.println((char)ch);
    t = new TextBox("Final Grades", b.toString(), 1024, 0);
    } finally {
    if(is!= null) {
    is.close();
    if(os != null) {
    os.close();
    if(c != null) {
    c.close();
    display.setCurrent(t);

  • How to send data back to publishing stream

    Hi,
    Environment: ActionScript3.0, FMS, Flash Project created in Flash Develop
    How to send data back to publishing stream? I need to send data back to publishing stream.
    Using NetStream.send() we can send data to subscribers but is it possible to send data from subscriber back to publisher using any NetStream method.
    One other solution to this is remoteSharedObject, but if it is possible with NetStream class then let me know.
    Thanks

    There are a number of ways to extract data from CRM On Demand including:
    * Export - manual process, generate CSV file containing CRM On Demand data
    * List/Analytics - manual process, export the contents of a report of list to a CSV
    * Web Services - programmatic, develop an application that queries for data within CRMOD
    * Integration Events - programmatic, use workflow to trigger event creation and then poll for events to know when an operation occurs on a record (i.e. Insert of new Account record)
    As for getting that data into another system, that will depend on the system and the methods available for inserting data that it makes available.
    Hope this helps.
    Thanks,
    Sean

  • There was an error while writing data back to the server: Failed to commit objects to server : Duplicate object name in the same folder.

    Post Author: dmface15
    CA Forum: Administration
    I am working in a new enviorment and i am trying to save a report to the Crystal Server via the CMC. I am uploading the report from the objects tab and attempting to save to a folder. The report has 1 static defined parameter and that's it. When i click submit to save the report i receive the following error message: "There was an error while writing data back to the server: Failed to commit objects to server : Duplicate object name in the same folder." There is not a anothe report within the folder with that name. What could be causing this error message and equally important, what is the solution.

    hte message you received about duplicate user probably means something hadn't fully updated yet. Once it did then it worked...
    Regards,
    Tim

  • How to put messages back on the server

    by accident, I set up an account that deleted received messages from teh server. I believe that I set this up as a pop account. Is it possible to put messages back on the server? I couldn't see an option for this and it is important that I be able to check these messages via webmail.
    any help would be greatly appreciated.
    thanks
    m

    Before doing anything, I encourage you to make a backup copy of the entire ~/Library/Mail folder, in case something goes wrong (quit Mail first). You can do this in the Finder by dragging the folder to the Desktop while holding the Option (Alt) key down, for example. This is where all your mail is stored.
    You cannot have two accounts of the same type in Mail with the same username and incoming mail server. You can, however, set up two mail accounts with the same username and incoming mail server IF the account type is different.
    That is, if you really did set up this account as POP, you can set it up also as IMAP in Mail without deleting the POP account first. You should, however, disable Preferences > Accounts > Advanced > Include when automatically checking for new mail (but keep Enable this account checked) for the POP account, to avoid it interfering with the IMAP account. You can then move any messages to the mailboxes of the IMAP account where you want them to be.
    EDITED: The above assumes that the provider of this account allows you to access it as either POP or IMAP, and that you chose POP by mistake. If POP is your only option and the mistake is just that the account was configured to remove messages from the server when in fact you didn't want to do that, then that's a different problem...
    Note: For those not familiarized with the ~/ notation, it refers to the user's home folder, i.e. ~/Library is the Library folder within the user's home folder.

  • How to send signal back to the scanner.

    Hi all, In my project I'm supposed to send the signal back to the scanner to force it make a serie of beeps , block the scanner or something like this. Does anyone know how to approach this ?
    Thanks for any help.
    Regards.

    Hi all, In my project I'm supposed to send the signal
    back to the scanner to force it make a serie of beeps
    , block the scanner or something like this. Does
    anyone know how to approach this ?
    Thanks for any help.
    Regards.Try a package named: JTwain, which is available at http://asprise.com/product/jtwain.
    JTwain supports all kinds of digital cameras and scanners.
    You can use Java to access, contorl digital cameras and scanners, and of course,
    to acquire images with flexible settings.
    The developers' guide is available @ http://asprise.com/product/jtwain/devGuide.php
    Here is the sample code:
    try {
       // the SourceManager manages and controls all the data(image) sources, eg. scanners, digital cameras,
       Source source = SourceManager.instance().getDefaultSource();
       source.open();
       // Enables or disables the UI
       source.setUIEnabled(false);
       Image image = source.acuqireImage();
       ... // Uses image here ...
       // Saves the image into a file
       source.saveLastAcquiredImageIntoFile("test.jpg");
    }catch(Exception e) {
       e.printStackTrace();
    }finally{
       SourceManager.closeSourceManager();
    }Good luck!

  • 9914 and sending data back across the bus.

    We are programming a device with the 9914 chip, and we can write commands to the device, but are having trouble getting the device to write data back. When using the interactive tool, by executing "ibrd 100" is the device addressed as the talker? What is a fairly straight forward method for passing 1 byte of data from the device to the controller? We have a routine that waits till the TA bit in ISR1 sets, before it placed the byte in the CDOR. But the TA bit never sets, even after we execute ibrd 100 with the interactive tool. Is there something else we need to do? Any help would be appreciated.
    Thanks
    Rick

    Enabling interrupts should not have an affect. Can you give me a summary of how you are setting up the chip? For example, what are you setting in the ADR register? This register sets the addressing mode of the chip. If you are not setting it up correctly at address 3, you would, of course, not get an interrupt.
    So, lets assume you are setup correctly. There are a couple of different things to try.
    1) You can look at the MAC bit in ISR0. This is the My Address Changed bit, which should set everytime your addressing mode changes.
    2) Note that the NAT9914 does not have static bits in the ISR registers. If you read a register, the bit will clear automatically. Just in case something else asserted along with MA and you hand
    led it but forgot to check MA, you will lose it.
    3) You can try setting MA IE. This will not generate an interrupt if you have interrupts disabled, but it will cause an NDAC holdoff. In this case, the ibrd 100 should timeout on the host side if the device is actually doing the holdoff.

  • Using VBA from Excel, how to send datas into a SQL server

    Hi,
    How do you use VBA to provide the connection to insert datas into a table within a database.
    What kind of statements do we need. 
    The database, and table are for example already created.
    Thanks

    Hi
    I know this is an old thread but did you come right?

  • I send a cookie to the server, but it doesn't come back.

    Hey all:
    I'm attemping send a cookie via an application to the servlet, and then pull that cookie back out from the servlet's response. I want to do this whole process repeatedly while retaining the same cookie.
    Pulling the cookie out on the first request to the servlet works fine because I do not send a cookie to the servlet, and the servlet instantiates a new session. Next, the cookie is sent back to the servlet successfully because it is printed out on the server-side exactly as it appeared on the client side. However, after the servlet responds to that second request and on subsequent requests, I can not pull the cookie out again. On the method call, connection.getHeaderField("Set-Cookie"), the result is null. I've even inspected the connection object, and it seems empty of any cookies whatsoever. Why doesn't the cookie come back on requests after the initial request? Is there anything I can do to make it come back?
    Thanks a ton in advance. Have great day!!!

    you must check that cookie's path set by Tomcat is the one expected by your browser. Otherwise the former won't send it back to the server. I had the same problem because Tomcat sets the cookie path to "/webAppName" and the browser expected it to be "/".

  • Sup Error While Sending Date Parameter to SUP server?

    Hi Every one,
       I am developing an iOS app using Sybase Unwired Platform 2.1.3 I am getting error While sending Date parameter to Database. How to send DATE format to the sales_order table for order_date column  from iOS.
    I tried like this..
    @try {
            SUP105Sales_order *insertRow =[[SUP105Sales_order alloc]init];
            int32_t idValue =2671;
            int32_t custID =103;
            int32_t sales =506;
            insertRow.id_=idValue;
            insertRow.cust_id=custID;
            insertRow.order_date=[NSDate date];
            insertRow.fin_code_id=@"r1";
            insertRow.region=@"Hyd";
            insertRow.sales_rep=sales;
            [insertRow save];
            [insertRow submitPending];
            [SUP105SUP105DB synchronize];
        @catch (NSException *exception) {
            NSLog(@"Exception---%@",exception.description);
    In server log:
    2014-02-28 16:39:41.833 WARN Other Thread-182 [SUP105.server.SUP105DB]{"_op":"C","level":5,"code":412,"eisCode":"257","message":"com.sybase.jdbc3.jdbc.SybSQLException:SQL Anywhere Error -157: Cannot convert '' to a timestamp","component":"Sales_order","entityKey":"3210004","operation":"create","requestId":"3210005","timestamp":"2014-02-28 11:09:41.646","messageId":0,"_rc":0}
    I strongly believe the above error for because of Date format..i have tried different ways to send Date to Sup server ..but i didn't get any solution.. Can any one help me me how to send date to database in SUP in iOS??
    Message was edited by: Michael Appleby

    Hi Jitendra,
    Thanks for your Quick reply..Any way i have tried what you said,but i didn't get any solution.
    Here is my Code:
        NSDateFormatter *formatter = [[[NSDateFormatter alloc] init] autorelease];
        [formatter setDateFormat:@"dd-MM-YYYY HH:mm:ss"];
        NSDate *tempDate =(NSDate *) [formatter stringFromDate:[NSDate date]];
        NSLog(@"%@",tempDate);
    @try {
            SUP105Sales_order *insertRow =[[SUP105Sales_order alloc]init];
            int32_t idValue =2671;
            int32_t custID =103;
            int32_t sales =506;
            insertRow.id_=idValue;
            insertRow.cust_id=custID;
            insertRow.order_date =tempDate;
            insertRow.fin_code_id=@"r1";
            insertRow.region=@"Hyd";
            insertRow.sales_rep=sales;
            [insertRow save];
            [insertRow submitPending];
            [SUP105SUP105DB synchronize];
        @catch (NSException *exception) {
            NSLog(@"Exception---%@",exception.description);
    Error is :
    Exception---SUPPersistenceException: exception is in createCore: unexpected null value for 'order_date'

  • How to send data from internal table to the shared folder in ABAP

    Hi experts,
             My requirement is to transfer data from a file to shared folder. i just did reading data from a file to a internal table. Now i want to send this internal table data into a shared folder which is  "
    xxx\y\z....".
    I do not have any idea on how to send data from internal table to the shared folder path.
    can anybody please help me out how to do this?
    Thanks & Regards
    Sireesha.

    Where that folder is located, its on presentation server i.e. desktop or application server.
    If its on presentation server, use FM GUI_UPLOAD.
    If its on application server, then use DATASET functions. Have a look at below link.
    [File Handling in ABAP|http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3ca6358411d1829f0000e829fbfe/frameset.htm]
    I hope it helps.
    Thanks,
    Vibha
    Please mark all the useful answers

  • How can I submit the form back to the server, then reload the page again

    Hi
    I have 2 comboboxes, one is already populated with data by the time the page is loaded. The second combobox will be populated depending on the value chosen from the first combobox
    I need to know how can submit the form to go back to the server with the selected value from the first combobox, get some data from the database and then regenerate the whole page again filling the second combobox with the collected data
    for example, here s my select tag:
    <select name="country" id="firstBox" onchange="populateSecondList()">
         <option value="" SELECTED>
         </select>
    <select name="city" id="firstBox">
         <option value="">
         </select>
    what should I have to add in the retrieveSecondOptions() function?

    declare a second combo box in a iframe and to iframe tag there is attribute to which you can sepcify the file name like one.jsp
    now call onchange event on first combo box and forward request to one.jsp

  • How can I safe my data back from the Time capsule to iphone and macbook?

    Hi,
    last weekend we were robbed while being on vacation and iphones and macbook air got stolen. Good thing was that at home we had a time capsule and our normal macbook. As soon as we get the new iphones and the new airbook we want to get our itunes and apps and datas back to the iphones and airbook ... can somebody tell us how to re-safe or back-safe stuff from the time capsule back to the equipment?
    Thank you ... I feel so "naked" without my phone :-(
    Virtualkate

    Sorry about your loss. Follow the directions here to use Time Capsule to restore your new Air to the state your old Air was in when stolen. When you first connect your new phones, you'll be given the option of restoring from the backup of your old phones or setting up as new. Restore from your previous backups, followed by syncing your content back to your phones. You should be good to go. Maintaining current backups makes this a piece of cake.
    http://support.apple.com/kb/HT1177

  • Hi, I have a new cell phone, I wanted to give my iphone to my father, instead of deleting the content on the iphone I have deleted the entire iphone. It starts up no more. iTunes will not recognize the iphone. How do I get my old data back onto the phone?

    Hi, I have a new cell phone, I wanted to give my iphone to my father, instead of deleting the content on the iphone I have deleted the entire iphone. It starts up no more. iTunes will not recognize the iphone. How do I get my old data back onto the phone?

    Place the device in DFU mode (google it) and restore as new.

  • After restoring my phone as New, how do I get my contacts and data back without the restrictions password

    I forgot my restrictions password so I restored my Iphone as a New phone.  Now, how do I get the contacts, apps and other data back on the Iphone? Can I restore my contacts & data without it also requiring a restrictions password again?

    Thanks for replying.  I had to do this process in order to get ICloud activated so I don't have it there.  I do have an external backup of the Itunes library, but it sounds like that would also restore the restriction password that I don't know.
    Why would ICloud be different (if I had backed up there?) Does it only save data?
    And It sounds like I need to keep my contacts in another source .... such as? ...  No, I don't use email much and my contacts arec the phone numbers I've captured in my phone.  After I have them backed up to ICloud, do I also need to make sure they are somewhere else to where I won't run into losing them again?
    appreciate your experience and help.

Maybe you are looking for

  • Copying OA page definition from MDS of 1 APPS instance to other

    Hi, Summary: How to copy page definition from MDS of one instance to other? In Detail I am moving my OAF application from one APPS instance(say A) to other(say B). In instance 'A' I have uploaded the OA pages using import command. But I can do the sa

  • MobileMe Galleries not showing up????

    Just wondering why when I goto drag a MobileMe gallery, say a video, onto one of my pages I get a message in the box telling me to upload stuff to my gallery - even though there are tons of things already in it.. Doesn't seem to be loading them. Yes

  • NCS Prime Ver 1.0.2.29

    Hi All, Does anyone have any idea is this is a bug or not? I am trying to access Monitor>Clients and Users on NCS. The error message received is There was an error while parsing and rendering the content. (Tried to register widget with id==clientTabl

  • SynchManager Business Object Synch Directions

    Is there a list of all of the business objects synching in SynchManager and which direction they go? For example, Orders are synched both ways, while Items are only synched from SAP to Web Tools.

  • I couldn't sunyc my iphone to itunes

    hi every body how can i sync my iphone to itunes by the way i used to do it but after i got mac os x snow lepard i tried many times but no way i tried all the way written in apple support but still same thing please i need some help i tried all these