3
votes
1answer
72 views

Reading values from a file and assigning to another class

I'm assigning values to an object by passing it to another class. Basically, I'm reading values from a file and assigning it by passing it to another class. This is the POJO class for the details in ...
3
votes
1answer
52 views

Convert MQTT messages and publish them to Rabbit MQ

I'm looking for advice on how to find a balance between keeping this code flexible/maintainable, while also keeping it readable. It reads MQTT messages in JSON format from four different topics, ...
3
votes
2answers
118 views

Spring Boot RESTful service

I have developed this restful service using spring boot. Please look at the code if there is something to change to be more consistently. Resource ...
4
votes
2answers
455 views

Java/Kotlin JSON parsing improvement

I consume an API which gives me this type of JSON: ...
3
votes
2answers
142 views

Parse a JSON file in Java

I am using Java to parse a JSON file into a hash map so that i can search by typing a date and then get the cost, tax and profit for that date. So that if i write: ...
1
vote
0answers
55 views

Filtering listview results when spinner values get selected

I have 3 spinners in my project named standard, division and age. They contain values from json data. When I select a value from each individual spinner it shows all data of students in a listview who ...
-1
votes
1answer
45 views

possible code optimizations while using JSONObject

I have following JSONArray object from a jsonobject key "elements" ...
2
votes
1answer
68 views

Gson to Model containing several return types for one key

i just had a problem converting the JSON from Phillips Hue Lights (Response) to a Model. Since it may contain several "unknown" keys in success and/or may contain just a String for success i had to ...
5
votes
1answer
89 views

Keep parsing JSON response until a field becomes false using GSON

I have JSON which is coming by executing a URL. I want to store all the value of id field in a List<String> by parsing ...
4
votes
0answers
80 views

Dynamically creating login screen on Android devices

This has been an experience. I'm well above "hello world" java is not a language I use often when programming and I don't program too much. I find myself a lot on Google.... basically just about for ...
4
votes
1answer
478 views

Writing CSV file from huge JSON data

I am writing a program that reads from DB and outputs to a CSV file. Besides the regular columnar data there are 2 JSON fields data as well. The table layout looks like this (other fields removed for ...
2
votes
2answers
99 views

Generic data converter for one type of data to another

I wrote a generic data converter that takes one kind of data and converts to JSON and XML types of file. Now, it reads data from the given ...
2
votes
0answers
52 views

JSON schema using Java objects

I have this JSON schema: ...
2
votes
2answers
106 views

Loading attributes of cars and orders from JSON

I am creating an application that deals with cars and orders. A order contains a car and other information (BUYER, OWNER, ...), which constructs an orderObject. ...
1
vote
0answers
20 views

Wikipath stack in Java - Part II/IV - The implicit Wikipedia article graph

This question is the continuation of the Wikipath stack series: the two classes that - given a Wikipedia article \$A\$ - return the lists of neighbour articles. The forward node expander return the ...
1
vote
1answer
68 views

Java password encryption based on time and string

I have a program that: Takes a user specified string Creates password from the string and previous, current, and next day Encrypts the strings Chops some middle characters from the strings (needed to ...
4
votes
2answers
174 views

ToDoApp with persistence (using JSON)

This is a simple ToDoApp with a CLI that is made useful by adding persistence. A shout out to @Phrancis and @syb0rg for guiding this little project to where it is now. The structure is rather simple. ...
4
votes
1answer
32 views

Invoking API calls with parameters specified using JSON

I have an instance of a Java class that I need to call some functions on, using the API exposed by another party. For each call, I need to both check for thrown exceptions, and check the value of the ...
0
votes
0answers
1k views

Loading autocomplete text view adapter dynamically using async task in Android

I am working on an app in which I need to get destination list from server and set it in autocomplete text view. I am using text watcher and on its onTextChanged event I am fetching destinations data ...
5
votes
2answers
108 views

Tracking Containers in a Train Station

This is a time line for control over the events of some containers in a train station. It gets all the data to build the time line by getting a JSON from a database via REST service. The app resets ...
2
votes
2answers
114 views

RSS to JSON for insertion into MongoDB

In my code, there is a chain of functions call where the deepest function may throw an exception. I catch and handle it according to the business logic. The problem is that all other functions in the ...
7
votes
1answer
207 views

Parse JSON data of upcoming fixtures of Chelsea FC

This program makes a call to an API (http://api.football-data.org/) and obtains data for fixtures of Chelsea FC for the next 100 days in JSON format. The JSON is parsed into a Java object and then ...
4
votes
2answers
386 views

Tic-Tac-Toe machine learning

I recently started getting into machine learning and I wanted to write a "beginner program" which would learn to play Tic Tac Toe. This code was inspired by a different program I saw, meaning some ...
1
vote
1answer
382 views

Google Maps coordinations JSON to object

I am trying to write a parser from JSON data which I get from Google requesting coordinates of a city, which will create my specified object structure. For parsing, I've written a custom ...
-1
votes
1answer
72 views

Proper Use of Keep Alive For Loop

I'm working to make a thread that monitors a web API to get the latest announcement via JSON. I cannot test this currently, so I'm unsure if anything needs to be changed with this. I've read through ...
4
votes
2answers
557 views

App to list books from JSON data

I recently submitted the code for this for an 2 hour interview but I was rejected. The app shows book information with a image, title, and author. Each entry has a title but some entries have no ...
3
votes
2answers
6k views

CSV to JSON conversion in Java

Since I've looked far and wide for a good example of this to no avail, I have created my own using the JSONArray and JSONObject ...
7
votes
1answer
116 views

Configuration concept and implementation

I created an API to load, save and read user configuration in my application. I've a Configuration interface which provides the basic methods to read, save and read ...
5
votes
3answers
1k views

Login for desktop application

I am building a login using an API call to a URL that returns JSON data. The login works and is functional but in terms of "correctness" and "professionalism", I am looking to get input from some of ...
1
vote
1answer
39 views

Testing class that transforms JSON into a spreadsheet

I am creating unit tests but the class uses objects that have long JSON. What can I do to improve the readability of this? In tests, only insert those JSON really needed for the test. The class I ...
4
votes
1answer
116 views

Create Java object from from page content or plain text

My job is to make a specified java objects from web page that contains following text: Companies: ...
6
votes
1answer
5k views

Java JSON Stringifier with the Nashorn API

I have written a Java JSON stringifier with the Nashorn API. Since this code is slow, I wanted to ask if I can improve it. My target is the highest possible performance to make it an alternative to ...
8
votes
1answer
6k views

Java JSON parsing with the Nashorn API

Some time ago I found a website about the Java Nashorn API which allows you to run JavaScript from Java code. I thought about creating a JSON parser in pure Java (without external libraries) which ...
5
votes
1answer
264 views

Fetch and Save Weather Data as JSON

This is part 2 to Fetch, Parse, and Save JSON. As the code evolved, I wanted to post the program with changes for review again. The objective of the program is to fetch JSON information from a ...
10
votes
3answers
947 views

Fetch, Parse, and Save JSON

I've written a program in Java that will fetch JSON information from a service through their API and save it. As I'm new to Java, I want my code looking clean as possible and to understand the ...
4
votes
2answers
298 views

Data Persistence

I was wondering if I could get some feedback on the library I created to persist data online. JitterPushDemo.java ...
15
votes
1answer
898 views

Parsing log files of HearthStone: Loading card data without external libraries for JSON

I'm still working on a parser that can parse log entries from a game called HearthStone, the overall idea is that it will read the log file live when the game is running, parses the log file and show ...
3
votes
1answer
113 views

JSON extraction

Given the code below, is there a better way to essentially create different native objects without changing the native constructor or the nativeList.json file? The only option I can see is adding a <...
3
votes
1answer
4k views

Recursively parsing JSON response using GSON

I have a URL which I am executing it and it is returning the below string as a JSON response. I am using GSON to parse JSON. In the below JSON, "resourceId" ...
0
votes
1answer
5k views

Serializing big JSON using GSON without loading everything in memory

Here is my JSON in which I have only three reportRecords just for demonstration purpose but in general sometimes we are getting pretty huge JSON, then it doesn't ...
2
votes
1answer
2k views

Filtering JSONArray by Branding & Modelling

I have a small function that takes in a list of JSON objects that has the format below. The function below that wants to see if the brand and model of car passed to it can be matched against the List ...
-5
votes
2answers
2k views
4
votes
2answers
156 views

Serializing data from two URLs in the same object efficiently

This is a follow-up to: Serializing JSON data coming from two URLs in the same object I have two URLs (urlA and urlB) and they ...
0
votes
1answer
549 views

Android export browser history as JSON

I wrote a simple android app to export the browsers history as JSON, but I do not know if the resulting JSON is a format that the user will easily be able to parse and use. Is there any way that i ...
6
votes
1answer
1k views

Populate views in Android application

I wrote these classes and I would like to know if this is a correct way. I created a new Project with Blank activity and "Scrollable Tabs + Swipe" as Navigation type. My main activity: ...
2
votes
1answer
624 views
3
votes
1answer
1k views

Parsing JSON from file in Java [closed]

This is a quick question. I am reading a mass amount of JSON from a variety of text files. The JSONs are tweets, in this format: ...
2
votes
1answer
169 views

Json whitespace formatter

I couldn't quickly find Java code with googling to make serialized Json easier to read (this is a debugging library, obviously implementation code wouldn't use this as it's just more characters). This ...
4
votes
1answer
925 views

Finding potential thread safety issues and race conditions in my multithreading code

I am working on a project in which I have two tables in a different database with different schemas. So that means I have two different connection parameters for those two tables to connect using JDBC-...
1
vote
2answers
2k views

Simple JSON writer

I am working on a way to quickly build JSON strings in Java. To this end, I have created the following two files. Assuming that I do not need to parse JSON strings for Java, is this an efficient ...