android-json

Nested maps in Firebase and custom objects

十年热恋 提交于 2019-12-11 15:21:53
问题 Apologies for the rather basic question but I am having a little trouble with my code. I intended to create a database of events and I wanted the flexibility of retrieving an entire day's worth of events, or a month's worth or even a years worth. So I decided to store the data under 'year'>'month'>'day'. Initially I tried to do it using custom java objects that I thought would be easier to work with, but unfortunately this adds an extra child node between each object with the name of the

JSON Parsed Data not showing in ListFragment

余生颓废 提交于 2019-12-11 15:06:35
问题 I have used a MYSQL Database and connected it to my Android App using PHP. I added a sample row in the table and the PHP Script is returning JSON. I have tried my best in parsing the JSON and displaying it in a list. But it does not seem to be working. Able to run the App - But does not display content - Only shows the Dialog. It seems to work in Case of an Activity - What changes should be made to make it work for a Fragment. Here is my LogCat when I open up the fragment - http://prntscr.com

Load new data when refresh RecyclerView

最后都变了- 提交于 2019-12-11 11:13:18
问题 I want develop android application for one website. I read website posts from json and show its in RecyclerView every 10 posts and when user scrolling on RecyclerView show more 10 post and go to end! in this project i use okHTTP v3 and RecyclerView ! I want gonna put a button and when click on this button, load new data (if there was new data). Button codes: // Refresh Data toolbar_refresh.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { LoadData(); } })

Android org.json.JSONException: Value of type java.lang.String cannot be converted to JSONObject

瘦欲@ 提交于 2019-12-11 08:22:50
问题 try { File yourFile = new File(Environment.getExternalStorageDirectory(), "textarabics.txt"); FileInputStream stream = new FileInputStream(yourFile); String jsonStr = null; try { FileChannel fc = stream.getChannel(); MappedByteBuffer bb = fc.map(FileChannel.MapMode.READ_ONLY, 0, fc.size()); jsonStr = Charset.defaultCharset().decode(bb).toString(); Log.d("Noga Store", "jString = " + jsonStr); } finally { stream.close(); } Log.d("Noga Store", "jString = " + jsonStr); JSONObject jsonObj = new

Upload image with Ion android library

一个人想着一个人 提交于 2019-12-11 06:56:22
问题 I've got an app that is connected to a server through a restful API, but I need to upload an image to the server and I'm using Ion library, is there anyway to upload this image to the server? 回答1: You can use .setMultipartParameter("key","value") to upload image along with other text values as well.. If you need to upload many images, You can use the "Part" class to add multiple images. ArrayList<Part> fileParts = new ArrayList<>(); for (int i = 0; i < myImages.size(); i++) { Part part = new

I trying to send this json data form android to php server

北城以北 提交于 2019-12-11 04:50:39
问题 I trying to send this json data form android to php server. this my json data{email:"user111@gmail.com",password:"00000"}, any one help how the decode this json data in php server this my php server code <?php $response = array();` require_once __DIR__ . '/db_connect.php';` if(!isset($_POST['params'])){ $decoded=json_decode($_POST['params'],true) $email=json_decode['email']; $pass=json_decode['password']; // connecting to db $db = new DB_CONNECT();` $result = mysql_query("SELECT *FROM user

Getting JSON Exception no value for?

核能气质少年 提交于 2019-12-10 11:34:39
问题 I am trying to handle the json response, that is like {"Status":true,"UserId":111,"FirstName":"dev","LastName":"dev","Gender":-1,"BirthdayDate":"0000-00-00","Phone":"","ProfilePicture":"","ProfilePicture60px":"","ProfilePicture120px":"","CountryId":-1,"Email":"droidwithmxxmail.com","Password":"******123","RegisterDate":"2015-05-08 20:08:07","SessionId":"fce248fe6499b7a9338a1b64554509eb77841"} but getting org.json.JSONException: no value for exception My code is this. if (jsonStr != null) {

Android: Dynamically Get JSON Array Key Name From JSON

陌路散爱 提交于 2019-12-08 09:23:54
问题 I have a json link, if we open it I get a following result { "Status": "Success", "All_Details": [{ "Types": "0", "TotalPoints": "0", "ExpiringToday": 0 }], "First": [{ "id": "0", "ImagePath": "http://first.example.png" }], "Second": [{ "id": "2", "ImagePath": "http://second.example.png" }], "Third": [{ "id": "3", "ImagePath": "http://third.example.png" }], } What I need is, I want to dynamically get all the key names like status, All_details, First etc. And I also want to get the data inside

Retrieve JSON data returned from GOOGLE FINANCE API URL in android

拟墨画扇 提交于 2019-12-08 05:17:29
问题 I am using the following URL to get quotes information of any company. http://finance.google.com/finance/info?client=ig&q=bom:ranbaxy (here ranbaxy is the company). what website or url returns is given below. [ { "id": "672832" , "t" : "500359" , "e" : "BOM" , "l" : "859.90" , "l_fix" : "859.90" , "l_cur" : "Rs.859.90" , "s": "0" , "ltt":"3:50PM GMT+5:30" , "lt" : "Apr 1, 3:50PM GMT+5:30" , "lt_dts" : "2015-04-01T15:50:23Z" , "c" : "" , "c_fix" : "" , "cp" : "" , "cp_fix" : "" , "ccol" : "" ,

How to display json response in android CalendarView?

孤街醉人 提交于 2019-12-07 23:43:25
问题 I have a MaterialCalendarView in a android app and I have a json response like this: {"Table": [ {"userid":4,"eventname":"Aditya","eventdate":"\/Date(1479974400000-0800)\/","eventcolor":"5986FF","autoid":1011}, {"userid":4,"eventname":"dfgdgdgs","eventdate":"\/Date(1478678400000-0800)\/","eventcolor":"AD3D1F","autoid":1005}, {"userid":4,"eventname":"dfgdgdgs","eventdate":"\/Date(1478678400000-0800)\/","eventcolor":"AD3D1F","autoid":1006} ] } How to display this JSON response in my