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 6366073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:22:34+00:00 2026-05-25T00:22:34+00:00

On testing my application in Simulator, my app runs perfectly. But on the real

  • 0

On testing my application in Simulator, my app runs perfectly. But on the real device i get Null for BasicEditField, so I’m not able to execute my application. Following is my code snippet.

public class Login extends MainScreen {

    private UiApplication application = UiApplication.getUiApplication();
    private BasicEditField _email = null;
    private PasswordEditField _pwd = null;
    private ButtonField login = null;
    String imei = GPRSInfo.imeiToString(GPRSInfo.getIMEI(), false);

    public Login(){

        try {
            _email = new BasicEditField("Email: ", "", 100, EditField.NO_NEWLINE);
            _email.setFont(font);
            add(_email);

            _pwd = new PasswordEditField("Password: ", "", 100, EditField.NO_NEWLINE);
            _pwd.setFont(font);
            add(_pwd);

            login = new ButtonField("Login", ButtonField.CONSUME_CLICK);
            login.setChangeListener(new FieldChangeListener() {
                public void fieldChanged(Field field, int context) {
                    String e = _email.getText();
                    String xmlUrl = "http://********:9090/com.infra.rest/rest/todo?email='"+ e +"'&dId='"+ imei +"';deviceside=true";

                    String[][] urlData = XmlFunctions.getUserFromXml(xmlUrl);
                }
            });
            login.setFont(font);
            add(login);
        } catch (Exception e) {
            System.out.println("Failed to create user interface components");
        }
    }
}

On inspecting the email and imei values i get NULL and an exception saying Method “toString” with signature “()Ljava/lang/String;” is not applicable on this object

It has been a whole day but i’m not able to overcome this problem.

  • 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-25T00:22:35+00:00Added an answer on May 25, 2026 at 12:22 am

    I suspect it has something to do with accessing non-static outer class fields from an anonymous inner class. Try:

    String e = Login.this._email.getText();
    

    Have a read through this wikipedia page.

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

Sidebar

Related Questions

Currently, my Iphone application is not released yet. When I worked with the simulator/device
I'm testing my application as grails run-app. I have read How to remove app
I am testing an application on iPad Simulator and I need it to start
I am testing ipad camera application with ipad simulator I used below code, change
I am building a Web application. When I am testing it on a simulator,
I am testing my iphone application in the real phone and when my program
I am facing quite strange problem. Application ~80.Mb Testing on simulator using Allocations Instrument,
I have to automate the testing for an iOS Simulator application using Applescript. I
I was testing my app on the simulator when it crashed on clicking a
I develop with xcode 4.1 and I'm testing my app with the iphone simulator

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.