Hi
Made a comment on the thread with .apk-build issues, but recommended to make separate thread for my issue.
I am building an app to let users input their meals, and to calculate kcal, protein, fat and carbo, and a balance between these.
The user can also enter personal data, and from these the app will calculate daily recommended balance of kcal.
There will also be a day and week menu option.
All data is saved as JSON and when running the app within DroidScript everything workes fine.
However, when building the app with APK builder, the app gives an error about a JSON-file,
that I had during development, but rectified, and now working as it should (within DroidScript that is...).
All JSON-files has been tested within the app; userdata.JSON, food.JSON, meal.JSON, and they work as intended,
data appears as it should, and values/text is correct according to what the files contain.
I have tried several times to make an .apk but same issue. Tried deleting the old APK, of course uninstalling app, before installing new .APK
I have narrowed (probably) the problem,
by copying all code/data from all files into a new project, and when making an .apk in the new project
the same problem appears. By this I am tempted to conclude that there is a difference in how DroidScript
interprets .JSON-data and how APK-builder does, since the app works well within DroidScript.
the meal.JSON-file looks like this (merely a test-file for now):
[{"ID":105,"vekt":35},
{"ID":203,"vekt":31},
{"ID":150,"vekt":69},
{"ID":300,"vekt":90},
{"ID":590,"vekt":120},
{"ID":592,"vekt":250}
]
and all the others files have the same format, and all the .JSON-files is loaded with this function:
function getJSONfil(filnavn) {
return JSON.parse(app.ReadFile(filnavn));
}
Enclosed also the error message.
Any idea of possible solutions or known issues that might cause this behaviour?
best regards
Rune Thelen, Norway