Android Question How to submit data with Json

Discussion in 'Android Questions' started by Daniel-White, Jul 2, 2015.

  1. Daniel-White

    Daniel-White Active Member Licensed User

    Hi guys, I have been around in the forum learning about B4A from 6 months. now is the time to put one simple question for you.

    Can some one share with me a very small example where json submit data to website, save info. I read back and forward all the forum all day :). and found partially info. I need something very simple to start to understand.


    Thanks you so much.
    Daniel W
     
    Last edited: Jul 2, 2015
  2. Erel

    Erel Administrator Staff Member Licensed User

    Is there any specific web service that you are trying to work with?

    Creating a json string is simple:
    Code:
    Dim jg As JSONGenerator
    jg.Initialize(CreateMap(
    "field1""value1""field2"Array("a""b""c")))
    Dim jsonString As String = jg.ToPrettyString(4)
    Log(jsonString)
    Sending the string with HttpUtils2 is also simple: http://www.b4x.com/android/forum/threads/18992/#content
     
    lemonisdead likes this.
  3. Daniel-White

    Daniel-White Active Member Licensed User

    WordExpress
     
Loading...