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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T02:21:25+00:00 2026-06-04T02:21:25+00:00

{ Platforms: [ { PlatformNo: 1, SerialNumbers: [ { Aplilevel: 1, Version: 1.0 },

  • 0
{
  "Platforms": [
    {
      "PlatformNo": "1",
      "SerialNumbers": [
        {
          "Aplilevel": "1",
          "Version": "1.0"
        },
        {
          "Aplilevel": "2",
          "Version": "1.1"
        },
        {
          "Aplilevel": "3",
          "Version": "1.5"
        },
        {
          "Aplilevel": "4",
          "Version": "1.6"
        }
      ]
    },
    {
      "PlatformNo": "2",
      "SerialNumbers": [
        {
          "Aplilevel": "5",
          "Version": "2.0"
        },
        {
          "Aplilevel": "6",
          "Version": "2.0.1"
        },
        {
          "Aplilevel": "7",
          "Version": "2.1.x"
        },
        {
          "Aplilevel": "8",
          "Version": "2.2.x"
        },
        {
          "Aplilevel": "9",
          "Version": "2.3"
        },
        {
          "Aplilevel": "10",
          "Version": "2.3.3"
        }
      ]
    },
    {
      "PlatformNo": "3",
      "SerialNumbers": [
        {
          "Aplilevel": "11",
          "Version": "3.0.x"
        },
        {
          "Aplilevel": "12",
          "Version": "3.1.x"
        },
        {
          "Aplilevel": "13",
          "Version": "3.2"
        }
      ]
    },
    {
      "PlatformNo": "4",
      "SerialNumbers": [
        {
          "Aplilevel": "14",
          "Version": "4.0"
        },
        {
          "Aplilevel": "15",
          "Version": "4.0.3"
        }
      ]
    }
  ]
}

The JSON shown above is the output that I need to show in the PlatformNo’s spinner. When I select one item, then do I need to get the corresponding API levels in another spinner? Can anyone help me please to get this solved? I’m trying below to get it, but I’m unable to get it correct. I’m getting the last values only in the next spinner. Is there a way to check this? Please help me.

String[] platfromno,apilevel;
Spinner splatform,sapilevel;  
JSONObject obj = json.getJSONObject("Result");
JSONArray platformObject = customerObject.getJSONArray("Platforms");
String parray = customerObject.getString("Platforms");
System.out.println("String of Platforms array is " + parray);

for (int i = 0; i < productNameObject.length(); i++) {
    JSONObject e = productNameObject.getJSONObject(i);
    platformno[i] = e.getString("PlatformNo");
    ArrayAdapter<String> spinnerPlatfromNo =
        new ArrayAdapter<String>( this,
                android.R.layout.simple_spinner_dropdown_item,
                platformno);

    splatform.setAdapter(spinnerPlatfromNo);
    JSONArray serialNumberObject = e.getJSONArray("SerialNumbers");
    apilevel= new String[serialNumberObject.length()];
    splatform.setOnItemSelectedListener(
        new OnItemSelectedListener() {
            public void onItemSelected(AdapterView<?> arg0,
                            View arg1, int arg2, long arg3) {
                System.out.println("selected Item position is  " +
                    splatform.getSelectedItemPosition());
            }

            public void onNothingSelected(AdapterView<?> arg0) {
                // TODO Auto-generated method stub
            }
    });

    // if (splatform.getSelectedItemPosition()) {

    for (int j = 0; j < serialNumberObject.length(); j++) {
        JSONObject e1 = serialNumberObject.getJSONObject(j);
        apilevel[j] = e1.getString("Aplilevel");
    // }
    }
  • 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-04T02:21:26+00:00Added an answer on June 4, 2026 at 2:21 am

    After trying alot i got solved the twister.

    String[] platfromno,apilevel;
    Spinner splatform,sapilevel;
    
    
        JSONObject obj = json.getJSONObject("Result");
        JSONArray platformObject = customerObject
                            .getJSONArray("Platforms");
    
                    for (int i = 0; i < platformObject.length(); i++) {
    
                        JSONObject e = platformObject.getJSONObject(i);
    
                        platformno[i] = e.getString("PlatformNo");
    
    
                        ArrayAdapter<String> spinnerPlatfromNo = new ArrayAdapter<String>(
                                this,
                                android.R.layout.simple_spinner_dropdown_item,
                                platformno);
    
                        splatform.setAdapter(spinnerPlatfromNo);
    
                        JSONArray serialNumberObject = e
                                .getJSONArray("SerialNumbers");
    
                        apilevel= new String[serialNumberObject.length()];
    
    
                        splatform.setOnItemSelectedListener(new OnItemSelectedListener() {
    
                            public void onItemSelected(AdapterView<?> arg0,
                                    View arg1, int arg2, long arg3) {
                                System.out.println("selected Item position is  "
                                        + splatform.getSelectedItemPosition());
    
                    fillApiLevel();
    
                            }
    
                            public void onNothingSelected(AdapterView<?> arg0) {
                                // TODO Auto-generated method stub
    
                            }
                        });
    
    
            public void fillApiLevel(){
    
                    JSONArray serialNumberObject = null;
            try {
                serialNumberObject =platformObject .getJSONObject(
                        splatform.getSelectedItemPosition()).getJSONArray(
                        "SerialNumbers");
            } catch (JSONException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
    
            platfromno = new String[serialNumberObject.length()];
            apilevel = new String[serialNumberObject.length()];
    
            for (int j = 0; j < serialNumberObject.length(); j++) {
    
                JSONObject e1 = null;
                try {
                    e1 = serialNumberObject.getJSONObject(j);
    
                    platfromno[j] = e1.getString("Aplilevel");
                    apilevel [j] = e1.getString("Version");
    
    
                } catch (JSONException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
    
                ArrayAdapter<String> spinnerSerialNumer = new ArrayAdapter<String>(
                        this, android.R.layout.simple_spinner_dropdown_item,
                        platformno);
    
                sSerialNo.setAdapter(spinnerSerialNumer);
                        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

On most common platforms (the most important being x86; I understand that some platforms
I have a project that necessarily spans several databases. One database has tables: CREATE
As shown at: How to limit an SQL query to return at most one
I have copy JSON.framework in my Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk/System/Library/Frameworks /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.0.sdk/System/Library/Frameworks both folder and importing #import <JSON/SBJsonParser.h>
I want to use NSCalendarDate, which exists in /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.2.1.sdk/ System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSCalendarDate.h but is not present
Today building platforms is extremely quick with JPA, Guice, JSR 303 bean validation. It's
Which of these two platforms/ecosystems are better for writing web applications/websites? I am not
What are the preferred platforms to implement TCP socket communication ? I'm interested in:
I write applications for various platforms, but chiefly OS X and Windows. On both,
I would like to run APIDemos under platforms\android-1.5\samples directory on Android emulator but I

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.