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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:27:36+00:00 2026-06-10T04:27:36+00:00

Possibly a noob question but hopefully I can learn how to do this for

  • 0

Possibly a noob question but hopefully I can learn how to do this for the future as well.

I’ve connected to a mysql database on my server, connects fine, everything works. The problem is I don’t know how to get that data into a table for me to use in the layout (Is a tablelayout the best way? I don’t want it to fill up an entire layout, I want to be able to add text above the table and below). The code below prints the data into the logcat. You can see for yourself, it’s quite basic. I’ve been learning to do this via various tutorials. Obviously it’s not what I want though.

Does anyone have any advice on what code I should be putting here so that I can actually use my data once the app has received it. It’s already in the JSON format as you can see below. The code below works, it’s just not what I want it to do. The tutorials I’ve seen have implemented the HTTP connection and use ArrayAdaptors together but I’ve already done the HTTP POST bit and don’t want to change it since it took me ages.

// PARSE STRING
            try {
                jArray = new JSONArray(result);
                JSONObject json_data = null;

                System.out.println("Length " + jArray.length());
                Log.d("DB", "Length " + jArray.length());

                for (int i = 0; i < jArray.length(); i++) {

                    json_data = jArray.getJSONObject(i);
                    drivername = json_data.getString("Driver_full_name");
                    drivesfor = json_data.getString("Drives_for");

                    System.out.println(drivername + "&" + drivesfor);
                }
            } catch (JSONException e1) {
                Log.d("DB", "Error somewhere");
                CurrentSeasonDrivers.this.runOnUiThread(new Runnable() { 
                    public void run() {
                        Toast.makeText(CurrentSeasonDrivers, "Could not convert data to string", Toast.LENGTH_LONG).show(); } });
            }

Any advice is appreciated! My full code including the HTTP connection to show you how I’ve set things up: http://pastebin.com/MsKc1xPg

  • 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-10T04:27:37+00:00Added an answer on June 10, 2026 at 4:27 am

    If you got tabular data with common schema, you may want to use ListView to display it. Each row can be literally whatever you want and using ListView automatically solves your problem is you got more rows of data to display. And HTTP POST got nothing do to with it at all. Once you got your data it is irrelevant where it came from. Put it in database, put it in array, ArrayList etc. And display. ListView may be the way.

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

Sidebar

Related Questions

Hey guys, This could be a noob question, but I really can't find any
Hey guys, I can only apologise for asking such a noob question, but this
There is another possibly related question on this but it didn't have answers and
This is probably a noob question, but how I've implemented the appendTo() function below
This is probably a noob question that I will get slated for but here
Tricky question for a bash noob like me, but i'm sure this this easier
I guess this is a bit of a noob question but I haven't seen
This is a complete noob question, but I gotta ask it anyway I started
This is a noob question, but I forked a project and made few edits
I am a total NOOB in programming (but this is only my second question

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.