How to create a layout dynamically using Json in android and get value from it ? Here is the Json -


{   layout:[    {     tag :"edittext",     name :"name",     hint :"type name here"    },    {     tag :"checkbox",     name :"is married",     hint :""    },    {     tag :"button",     name :"submit",     hint :""    }  ] } 

i describing want . first of above json change every time. structure same , tag, name , hint value change . above jsonarray has 3 jsonobject . might number(4/5/6 number of jsonobject) . can 1 plz suggest me how solve issue ?

its better divide question in small small parts, here have your

  1. parse json , fetch value : suggest follow how parse json in android link , have json.
  2. check whether control edittext or button or else : suggest use switch case better coding structure

    switch (tag ){     case "edittext":         //add edittext         break;     case "button":         //add button         break; } 

follow links add controls dynamically

generating edit text programatically in android
add button layout programmatically
how add checkboxes dynamically in android


Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -