I have wrote a json file with data I will get it to recycleview in android but I don't know where can I upload this file to access it into android project
Asked
Active
Viewed 9,076 times
1
-
if you need it in the internet you simply have to make it in web space provider and retrieve it – Yagami Light Aug 22 '16 at 06:46
5 Answers
1
There are 2 ways you can do that:
- Local Storage: You can save a JSON file in your project locally. (already answered by others)
- Upload your JSON: You can upload your JSON at jsonbin.io and it will generate an API that you can use in your project.

Tomerikoo
- 18,379
- 16
- 47
- 61

Zohaib Brohi
- 576
- 1
- 7
- 15
0
You can store JSON file in your assets folder......

Akshay Panchal
- 695
- 5
- 15
-
Use this http://www.json-generator.com/ You can upload your json here and they will also provide URL to access your JSON – Akshay Panchal Aug 22 '16 at 06:47
-
ok .. how can I sent images or videos in JSON file ?? where can I save my data to sent it with JSON – ǾṧMäñ Ê ǾṧMäñ Aug 22 '16 at 06:58
-
You can save images/data on server and then just save link in your json you use http://tinypic.com/ to save images on server – Akshay Panchal Aug 22 '16 at 07:00
-
in json-generator.com I can't edit my JSON file the site generate a new JSON file with new url path – ǾṧMäñ Ê ǾṧMäñ Aug 22 '16 at 08:45
0
void saveStringToFile(String path, String content) {
try {
File newFile = new File(path);
newFile.createNewFile();
FileOutputStream fos = new FileOutputStream(newFile);
fos.write(content.getBytes());
fos.flush();
fos.close();
Constant.logD("File "+ newFile.getName()+ " is saved successfully at "+ newFile.getAbsolutePath());
} catch (Exception e) {
Constant.logE("Unable to save file", e);
}
}
Mention a path in a mobile sdcard like Environment.getExternalStorageDirectory().getAbsolutePath()+"/" + System.currentTimeMillis()+".jpg" as path

Athul
- 801
- 7
- 16
0
You can put your json file in the assets folder and best option is host the json file on the server and use the data (API) in your project.

Force Bolt
- 1,117
- 9
- 9