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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:13:00+00:00 2026-05-27T21:13:00+00:00

I am having trouble with developing my Android application, I am currently using Eclipse

  • 0

I am having trouble with developing my Android application, I am currently using Eclipse and a Phidget RFID. My aim is to display the ID of the RFID in a piece of text on the Android device.

I have managed to display the ID through a println in the following pieces of code.

   package myFood.myFood;

import com.phidgets.*;
import com.phidgets.event.*;
public class RFID {
static String x ="NULL";
public static final Object main(String args[]) throws Exception {
    RFIDPhidget rfid;
    rfid = new RFIDPhidget();
    rfid.openAny();

    //Begin the TagGained event, allowing for users to read the RFID values
    rfid.addTagGainListener(new TagGainListener()
    {
        public void tagGained(TagGainEvent oe)
        {
            Object y = (oe.getValue());
            x= y.toString();
        }
    });

    long StartTime,RunTime;
    StartTime=System.currentTimeMillis();
    do{
        RunTime=System.currentTimeMillis();
        if (x.equals("NULL")) {
            //Continue waiting for input
            }
        else
        StartTime = 10000; //Overload the result so the loop ends
    }
    while (RunTime-StartTime<5000);

    rfid.close();
    return x;
}

}

and then.

package myFood.myFood;

public class RFIDresult {

public static final Object main(String args[]) throws Exception {
    System.out.println("Results");
Object x = RFID.main(args);
System.out.println(x);
return x;
}
}

However I want the ID to be displayed in a piece of text so I tried to develop the second piece of code into Android.

package myFood.myFood;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class AddFood  extends Activity {
    /** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.addfood);



    Button mybutton = (Button) findViewById(R.id.Button1);
    mybutton.setOnClickListener(new View.OnClickListener() {
        public void onClick(View view) {

            String[] args = null;
            Object x = null;
            try {
                x = RFID.main(args);
            } catch (Exception e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }

    TextView mytext=(TextView)findViewById(R.id.widget96);
    mytext.setText((CharSequence) x);


    }


    });
}

}

And this just generates a force close. I am a bit of a novice at this and will appreciate all the advice I get.


LogCat Report;

ERROR/AndroidRuntime(519): FATAL EXCEPTION: main
ERROR/AndroidRuntime(519): java.lang.ExceptionInInitializerError
ERROR/AndroidRuntime(519):     at myFood.myFood.RFID.main(RFID.java:9)
ERROR/AndroidRuntime(519):     at myFood.myFood.AddFood$1.onClick(AddFood.java:26)<br/>
ERROR/AndroidRuntime(519):     at android.view.View.performClick(View.java:2408)
ERROR/AndroidRuntime(519):     at android.view.View$PerformClick.run(View.java:8816)
ERROR/AndroidRuntime(519):     at android.os.Handler.handleCallback(Handler.java:587)
ERROR/AndroidRuntime(519):     at android.os.Handler.dispatchMessage(Handler.java:92)
ERROR/AndroidRuntime(519):     at android.os.Looper.loop(Looper.java:123)
ERROR/AndroidRuntime(519):    at     android.app.ActivityThread.main(ActivityThread.java:4627)
ERROR/AndroidRuntime(519):     at java.lang.reflect.Method.invokeNative(Native Method)
ERROR/AndroidRuntime(519):     at java.lang.reflect.Method.invoke(Method.java:521)
ERROR/AndroidRuntime(519):     at om.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
ERROR/AndroidRuntime(519):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
ERROR/AndroidRuntime(519):     at dalvik.system.NativeStart.main(Native Method)
ERROR/AndroidRuntime(519): Caused by: java.lang.ExceptionInInitializerError: Library phidget21 not found
ERROR/AndroidRuntime(519): Could not locate the Phidget C library (libphidget21.so).
ERROR/AndroidRuntime(519): Make sure it is installed, and add it's path to LD_LIBRARY_PATH.
ERROR/AndroidRuntime(519):     at com.phidgets.Phidget.<clinit>(Phidget.java:34)
ERROR/AndroidRuntime(519):     ... 13 more
  • 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-27T21:13:01+00:00Added an answer on May 27, 2026 at 9:13 pm

    You need to get myText from ‘view’ parameter. Try this:

    TextView mytext=(TextView)**view**.findViewById(R.id.widget96);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm now to android. And I'm having trouble in developing application in which I'm
I am developing a site using kohana 2.3 and am having trouble with a
I am developing an application in C# (.NET), and am having trouble dealing with
I've got an windows mobile 6.5 application I'm developing and am having trouble with
I am currently developing an application using the Flashbuilder 4.5 framework and I am
im having trouble developing using chrome as my preview browser, it doesnt seem to
I'm having trouble associating my custom file extension to my android application that I
I'm developing a RESTful WCF, and am currently having trouble getting nice, clean JSON-serialized
I'm developing a Flex application and am having some trouble working with asynchronous calls.
Having trouble linking the Stomp.framework into an iPhone SDK application. http://code.google.com/p/stompframework/ I follow 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.