移動(android、IOS)App伺服器開發入門:第一個json,androidjson
建立一個副檔名json的檔案,如one.json()
然後錄入如下內容
{"item":{<chtml><!-- 資料準備部分,您可以從資料庫中查詢 --><bag id=item suffix=0> <we name=name>馬鈴薯</we> <we name=price>1.24</we> <we name=unit>KG</we></bag><bag id=item suffix=1> <we name=name>T恤</we> <we name=price>68</we> <we name=unit>件</we></bag><bag id=item suffix=2> <we name=name>可樂</we> <we name=price>2.20</we> <we name=unit>瓶</we></bag><bag id=item suffix=3> <we name=name>書</we> <we name=price>51.24</we> <we name=unit>本</we></bag></chtml><chtml><!-- 正式json格式的內容 --> <name>@{item:name}</name> <price value>@{item:price}</price><!-- value屬性參數表示輸出不帶引號的值 --> <unit>@{item:unit}</unit></chtml>},"sort":@{int:@{item:getSuffix}+1}}
在EditPlus的效果如
用瀏覽器查看的效果如
例子檔案_samples/app/one.json在輕開平台的_samples/app/目錄下
相關資源下載:
移動App應用伺服器開發從入門到精通:http://download.csdn.net/detail/tx18/8741611
快速搭建移動App伺服器 :http://download.csdn.net/detail/tx18/8737507
輕開平台會不定期升級為大家提供更多強大而Easy的功能,請留意下載最新的版本:http://download.csdn.net/user/tx18