first i have succes to write XML file on PC
here is the thread http://forums.livecode.com/viewtopic.php?f=8&t=28836
Now I'm trying to Write an XML file from Android apps over WiFi connection
here what i've done:
1. Create Android apps and Deploy it in Stand alone (succes)
2. Create Windows apps and Deploy it in Stand alone (succes)
3. on PC, create a share folder on C (//DRACO-PC/DracoXpression/)
4. Trying Win application on local host succes to create an XML file.
5. Trying Android apps from my phone (fail)
Here is button "GENERATE" XML
Code: Select all
on mouseUp
startXML
startTag "DracoFootballXpression"
startTag "Statistic"
startTag "Title"
writeNode "category_1", line 1 of field "scat_fld" of card 002
writeNode "category_2", line 2 of field "scat_fld" of card 002
writeNode "category_3", line 3 of field "scat_fld" of card 002
writeNode "category_4", line 4 of field "scat_fld" of card 002
writeNode "category_5", line 5 of field "scat_fld" of card 002
writeNode "category_6", line 6 of field "scat_fld" of card 002
writeNode "category_7", line 7 of field "scat_fld" of card 002
writeNode "category_8", line 8 of field "scat_fld" of card 002
writeNode "category_9", line 9 of field "scat_fld" of card 002
closeTag
startTag "Value"
startTag "Home_Value"
writeNode "HValue_1", line 1 of field "ValueStatA_fld" of card 002
writeNode "HValue_2", line 2 of field "ValueStatA_fld" of card 002
writeNode "HValue_3", line 3 of field "ValueStatA_fld" of card 002
writeNode "HValue_4", line 4 of field "ValueStatA_fld" of card 002
writeNode "HValue_5", line 5 of field "ValueStatA_fld" of card 002
writeNode "HValue_6", line 6 of field "ValueStatA_fld" of card 002
writeNode "HValue_7", line 7 of field "ValueStatA_fld" of card 002
writeNode "HValue_8", line 8 of field "ValueStatA_fld" of card 002
writeNode "HValue_9", line 9 of field "ValueStatA_fld" of card 002
closeTag
startTag "Away_Value"
writeNode "AValue_1", line 1 of field "ValueStatB_fld" of card 002
writeNode "AValue_2", line 2 of field "ValueStatB_fld" of card 002
writeNode "AValue_3", line 3 of field "ValueStatB_fld" of card 002
writeNode "AValue_4", line 4 of field "ValueStatB_fld" of card 002
writeNode "AValue_5", line 5 of field "ValueStatB_fld" of card 002
writeNode "AValue_6", line 6 of field "ValueStatB_fld" of card 002
writeNode "AValue_7", line 7 of field "ValueStatB_fld" of card 002
writeNode "AValue_8", line 8 of field "ValueStatB_fld" of card 002
writeNode "AValue_9", line 9 of field "ValueStatB_fld" of card 002
closeTag
closeTag //Value
closeTag//Statistic
closeTag // Draco Football Xpression
put the xml of card STAT into tXMLFinal
put textencode(tXMLFinal,"UTF8") into url "binfile://DRACO-PC/DracoXpression/Statistic.xml"
end mouseUp
Here is the Stack Code
Code: Select all
on preOpenStack
set the fullscreenmode of me to "exactFit"
set the fullscreen of this stack to true -- fullscreen mode
end preOpenStack
on closeStackRequest
quit
end closeStackRequest
on closeStackRequest
if revXMLTrees() is not empty then revDeleteAllXMLTrees
quit
end closeStackRequest
//================================================ UPDATE XML DracoData.XML
local _tags
local _xml
local _level
local _tabs
function q pText
return quote & pText & quote
end q
on startXML
put "<?xml version=" & q("1.0") & " encoding=" & q("UTF-8") & "?>" & return into _xml
put 0 into _level
put empty into _tabs
put empty into _tags
end startXML
on startTag pTag
put _tabs & "<" & pTag & ">" & return after _xml
add 1 to _level
put pTag into _tags[_level]
put tab after _tabs
end startTag
on closeTag
delete char 1 of _tabs
put _tabs & "</" & _tags[_level] & ">" & return after _xml
# Do a 'delete variable _tags[_level]' if you really want to clean the array as you go
subtract 1 from _level
end closeTag
on addAttribute pAttribute, pValue
# This should go into the last tag, but as we have "proper XML" so far we can backtrace two chars (">" and newline)
put space & pAttribute & "=" & q(pValue) before char -2 of _xml
end addAttribute
on writeContent pContent
put _tabs & pContent & return after _xml
end writeContent
on writeNode pNode, pValue
put _tabs & "<" & pNode & ">" & pValue & "</" & pNode & ">" & return after _xml
end writeNode
getProp xml
return _xml
end xml
//================================================ UPDATE XML DracoData.XML
Comment and help would be appreciate
Gilar Kadarsah