Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7660841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:31:10+00:00 2026-05-31T13:31:10+00:00

i have the following problem. This midlet works fine when i execute it in

  • 0

i have the following problem. This midlet works fine when i execute it in the emulator, but when i upload it to my motorola i290 (with nextel company), and i start it, it freezes. So never starts (the program starts doing a request to a php page)

Here is the code, if anyone knows why my program work fine in the Wireless Toolkit emulator and not in the phone, please let me know. Thanks

This is my “Connection” method

String 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,Connector.READ,true);
      c.setRequestMethod(HttpConnection.GET);
      c.setRequestProperty("IF-Modified-Since", "10 Nov 2000 17:29:12 GMT");
      c.setRequestProperty("User-Agent","Profile/MIDP-2.0 Confirguration/CLDC-1.1");
      c.setRequestProperty("Content-Language", "en-CA");
      os = c.openOutputStream();
      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);
    return b.toString();
}     
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T13:31:11+00:00Added an answer on May 31, 2026 at 1:31 pm

    I had the same issue with Sony Ericsson and what i found out is that there URL is sometime truncated when its too long. Try USING POST Instead

                c = (HttpConnection) Connector.open(serverURL, 3);
    
                c.setRequestProperty("IF-Modified-Since", "20 Jan 2001 16:19:14 GMT");
                c.setRequestProperty("User-Agent", "Profile/MIDP-1.0 Configuration/CLDC-1.0");
                c.setRequestProperty("Content-Language", "en-US");
                c.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
                c.setRequestProperty("Content-Length", packet.getSentLength());
                c.setRequestProperty("Cache-Control", "no-store no-cache");
                c.setRequestProperty("Pragma", "no-cache");
                c.setRequestMethod(HttpConnection.POST);
                c.setRequestProperty("Content-Length", packet.getSentLength());
    
                out = c.openOutputStream();
    
                if (out != null) {
                    out.write(packet.getSentBytes());
                }
    
    
                is = c.openInputStream();
                hcCode = c.getResponseCode();
    

    This worked for me ….. Note Change packet to the relevant information

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following problem Bundle bundle = new Bundle(); bundle.putString(url, someUrl); This works fine.
Never thought I'd have this problem :) The following snippet of code works in
This is a code review question more then anything. I have the following problem:
Never ran into this problem with jQuery before. I have the following: $(document).ready(function() {
I have the following problem with this code: <button id=delete>Remove items</button> $(#delete).button({ icons: {
In Programming Pearls I have met the following problem. The question is this: print
I have following problem. I use this tutorial to creating a multiple file uploader:
I have following problem. I have a team page like this example: http://www.social-markets.de/social-commerce-team.html small
I have following problem. I worked two days on a solution but I cannot
I have the following problem: This error appeared to me, when I compiled the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.