Loading a JSON file from inside the Android APK

Just starting out? Need help? Post your questions and find answers here.
Quin
Posts: 118
Joined: Wed Nov 08, 2023 4:38 pm

Loading a JSON file from inside the Android APK

Post by Quin »

I'm writing a game in SB that will load its levels from a JSON file. I plan to mainly publish the game as an APK file, and don't want to have to pull the file down from a server. How can I go about storing the needed JSON data inside my APK ,and loading it at runtime? In PureBasic, I do this with a DataSection, but we don't have IncludeBinary in SB.
Thanks.
Fred
Site Admin
Posts: 1820
Joined: Mon Feb 24, 2014 10:51 am

Re: Loading a JSON file from inside the Android APK

Post by Fred »

You can just put your file amongst your assets and you should be able to load it
Post Reply