I have searched and watched numerous youtube videos on parsing XML for Android, but I still find it hard to understand. Reason being that none really focus on the problem I have.
I have this calculator to calculate prices on a given service. The calculator uses several int variables but I want to get the value for these variables from a XML file hosted on my Dropbox (this is only for private use).
The code and tutorial I find usually either focus on setting the value from the XML file to GUI or just getting value from a local stored XML file. Does anyone have a good and easy to understand code/info on how to just access the value from the XML file and store it in variables?
My XML looks like this :
<timepris>200</timepris>
<marsipanlite>100</marsipanlite>
<marsipanmiddels>150</marsipanmiddels>
<marsipanmye>200>200</marsipanmye>
<sjokoladebunn>200</sjokoladebunn>
<sukkerbunn>150</sukkerbunn>
My code for summarize is :
private void regneUtSum() {
int kakeBunnTotal = antallKakerBunner * kakebunnpris;
int timerTotal = antallTimer * timepris;
int totalSum = kakeBunnTotal + timerTotal + marsipanpris;
String totalSumText = String.valueOf(totalSum);
sum.setText(totalSumText);
}