Results 1 to 3 of 3
  1. #1
    Member
    Join Date
    Oct 2011
    Location
    SWEDEN
    Posts
    2

    Device(s)
    SGS5

    http request,threding, json, mysql, json to class

    Hi all.
    First, I have programming knowledge from C#, VB and some small stuff in PHP but am totally new to Android and Java.

    I've been trying to get a simple test run with an App for Android working without luck. I've been reading and checking UT links for examples that I've tested but I can't find anyone that has all these things in one example.
    What I'm trying to to (well first as a small test) is to login to a mysql-db server and run a PHP file which returns a list of items, right now just a list of order heads and resp. rows.
    I then encode that into JSON and wants to return that back the the mobile device asking for it. In there I want to decode the JSON string into an array of those orders.
    (Later when all information is to be returned I want them each into it's own classes like in C# or such making it more easy to handle the information, if that even is possible or if you can show me a better way to handle the data.)
    This data is later to be shown in a listview with columns (I tried tables but couldn't get that to work)
    Right now I'm using a listview with columns added and in those columns' different objects, like spinner, text, image etc but mostly just text.

    I've seen somewhere that from a certain version of Android is not possible to do a http request on the main thread so I'm creating a background task that will handle that.
    My problem now is how I should go on with this. Either I need to wait for the http request to end before I continue the mainactivity code but that seems so wrong and would ruin the idea of threading.
    What I think of is, start the http-thread and continue loading the graphics for the listview and then show that typical loading activity (can't recall the name of it, hope you get it) and when the thread is done
    get the data into the listview somehow.

    So, I've been fiddling with this for almost 3 months now and either I just don't get it or have understood something wrong.

    I wonder if there is an extremely kind person that could do all these (for me important) steps of coding but much simpler but I do need the parent/child objects back to the mobile device cos I can't even get that correct it seems.
    By just reading that code I would learn so much instead of trying to understand all the separate examples I've seen with different approach to each and then try to get that into my own project.

    Later there is much more stuff I need to do but if I can't get this working there's no need for that but if I see this code I know I'll figure it all out.


    //Thanks In Advance.

  2. #2

  3. #3
    You are asking so many stuff with single post. we can help if you get any error.


    Looking for security app? Try Leo Privacy Guard 3.0.

    Join Our Christmas Contest by visiting our Facebook page "LEO Privacy Guard"

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •