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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:29:08+00:00 2026-06-17T12:29:08+00:00

Consider the scenario: I made two android Apps, say A & B. B Scans

  • 0

Consider the scenario: I made two android Apps, say A & B. B Scans an NFC tag, stored a string “nfcservice” and I stored that string in a byte array, say TEMP_MSG as hex. After that I converted that array into String and sent it to App-A. In App-A I tried to match it, but it fails everytime. What is the problem? Can you suggest something?

App-B code:

//nfcservice
byte[] TEMP_MSG = {(byte)0x6E, (byte)0x66, (byte)0x63, (byte)0x73, (byte)0x65,
                   (byte)0x72, (byte)0x76, (byte)0x69, (byte)0x63, (byte)0x65}; 

String nfcservicestring = new String(TEMP_MSG);
Intent intent = new Intent("com.android.apps.metromanager.MetroManagerActivity");
intent.putExtra("keyword", nfcservicestring);
startActivity(intent);

App-A code:

public class MetroManagerActivity extends Activity 
{
    TextView myText;
    String myString;    
    protected void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_metro_manager);
        Bundle bundle = getIntent().getExtras();
        if(bundle!=null) {
            myString = bundle.getString("keyword");
            Toast.makeText(getApplicationContext(), myString, Toast.LENGTH_LONG).show();
            if(myString.equals("nfcservice")) {
                LinearLayout lView = new LinearLayout(this);
                myText = new TextView(this);
                myText.setText("Welcome");
                lView.addView(myText);
                setContentView(lView);
            } else {
                LinearLayout lView = new LinearLayout(this);
                myText = new TextView(this);
                myText.setText("Bye Bye");
                lView.addView(myText);
                setContentView(lView);
            }
        }
    }
}
  • 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-06-17T12:29:09+00:00Added an answer on June 17, 2026 at 12:29 pm

    Your byte initialization has a fault, at the 5th byte you have:

     , byte)0x65,
    

    Instead of:

      ,(byte)0x65,
    

    However, why don’t you try to get some other attributes from your bundle object, and examine them by debugging and watching?

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

Sidebar

Related Questions

If we consider a std::string implementation that uses reference counting, consider this scenario: int
I have doubt with android backstack , please consider the scenario I have two
please consider this scenario: we have two web page. a simple page that contains
Consider this scenario that two WCF clients connect to one WCF service(server), this service
Consider this scenario. I have my own website, that I use as my identifier,
Consider following scenario: I have RESTful URL /articles that returns list of articles user
Consider this scenario: I have a project with two modules and one common module
Consider my scenario of a model consisting of two aggregate roots, Customer and Order
Consider this scenario. I have some business logic that now and then will be
Consider the following scenario: I have a ListView that is bound to an ObservableCollection

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.