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

  • SEARCH
  • Home
  • 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 6879951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:54:43+00:00 2026-05-27T04:54:43+00:00

I am working with OS 5.0 and I am trying to get some info

  • 0

I am working with OS 5.0 and I am trying to get some info from a wcf.
On the emulator it works like a champ, but on a device, with wifi connected, I get the error:

APN is not specified

my code:

    HttpConnection con = null;
    InputStream is = null;

    try {
        con = (HttpConnection) Connector.open(url);
        final int responseCode = con.getResponseCode();
        if (responseCode != HttpConnection.HTTP_OK) {
            System.out.println(responseCode);
        }
        is = con.openInputStream();
        byte[] responseData = new byte[10000];
        int length = 0;
        StringBuffer rawResponse = new StringBuffer();
        while (-1 != (length = is.read(responseData))) {
            rawResponse.append(new String(responseData, 0, length));
        }
        final String result = rawResponse.toString();
        _labelField.setText(result);

    } catch (final Exception ex) {
        System.out.println(ex.getMessage());
        _labelField.setText(ex.getMessage());

    } finally {
        try {
            is.close();
            is = null;
            con.close();
            con = null;
        } catch (Exception e) {
        }
    }
  • 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-27T04:54:44+00:00Added an answer on May 27, 2026 at 4:54 am

    Check this article "Different ways to make HTTP Socket Connection". This article would help you understand how to make network connections if you are on BES network or BIS or WiFi or 3G network etc.

    Getting back to your problem, if you want to connect through Wi-Fi, you will need to modify your connection url. Replace the following:

    con = (HttpConnection) Connector.open(url);

    With this:

    con = (HttpConnection) Connector.open(url+";interface=wifi");

    Now it would work on device with Wi-Fi connectivity.

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

Sidebar

Related Questions

all. We're trying to get some intersect collisions working, but the problem experience is
Im trying to get this working but for some reason it's just not right.
I'm trying to get our login portal working, but for some reason it won't
I'm trying to get pre/post annotations working with a web application, but for some
I am trying to get some Javascript working in my Rails app. I want
I am trying to get this working in Scala: class MyClass(some: Int, func: AnyRef*
I'm trying to get log4net working for a Windows service. It works fine for
I am trying to get the Aruco AR library working by trying out the
Im trying to get debugging working without an app.config. I have the following code:
Im trying to get a form working in Internet Explorer. I see that when

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.