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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:51:08+00:00 2026-05-31T08:51:08+00:00

As I am not the best in android development, I tried something that works

  • 0

As I am not the best in android development, I tried something that works for me and for friend’s mobile, but i have some reports from market that it doesn’t work for all devices maybe and do wrong compare. Anyway. the project is simple, it grabs an order from sql and in the game the player try to finish it. So I have 2 arrays. I call this at start:

    final String[] combo = new String[] {"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"}; 
    final String[] order1 = new String[] {"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"};


    for(int i = 0; i < combo.length; i++) {
        combo[i] = new String();
        combo[i] = "0";
        order1[i] = new String();
        order1[i] = "0";
    }

and during the game if the player clicks a button it changes the value of combo, for example, combo[7] = “1”;

When he click the final button I check that 2 arrays with this

String IsSame = compareOrder(combo, order1);

and then

   if (IsSame.equals("TRUE")) {

   // commands  

   }
   else if (IsSame.equals("FALSE")) {

   // commands                    

  }


private String compareOrder(String[] a, String[] b){
String n1 = "TRUE";
for (int i = 0; i < 13; i++) {
         if (a[i].equals(b[i])==false) {n1 = "FALSE";}
   }
return n1;  
}

It looks ok for me, and it’s working for my mobile, but maybe the code is not so normal and it cause wrong results in other devices. So, I need help, if you see something strange and not working in my code, tell me. Thank you!

  • 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-31T08:51:10+00:00Added an answer on May 31, 2026 at 8:51 am

    Don’t write what is provided already. 🙂

    import java.util.Arrays;
    
    TextView tv = (TextView) findViewById(R.id.text_view);
    tv.setText(Arrays.equals(order1, combo)? "Equal" : "Unequal");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have heard that it's best not to actually have any html in your
I am new to Android development and am not sure of the best way
I know this sort of code is not best practice, but nevertheless in certain
It may not be best practice but are there ways of removing unsused classes
The question is probably not the best one to describe my issue but I
Edited: SOLUTION FOUND. This is strange and not the best solution, but I just
I'm pretty new to Android Development, i'm following some Youtube tutorials currently. I'd like
I know it's 'technically' not the best practice to be hard coding strings; but
I'm new in Android development and I have been making a tutorial for a
I'm writing an Android app that is parsing RSS feeds from different sources. What

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.