This project is a template of an Android app that allows the user to manipulate a set of JSON parsed data through a UI and perform simple analytics such as chart view. The code can be modified to match any JSON data-set in any context, this repository contains a data-set that covers a website ranking based on number of visitors data-set as a sample to demonstrate the application capabilities.
- Chart view.
- Search data-set.
- Add data.
- Data-set sort and manipulation.
- Export modified version.
- To-Do list.
- Grocery list analytics behaviour.
- Analytics tool for 3rd party app/web service.
- The input stream for current repository context:
InputStream is = getAssets().open("websiteRanking.json");
- As the app creates a local copy of the file to allow the user to view it or modify it without affecting the original file. The local file name is defined as a string:
String fileName = "websiteRanking.json";
- The JSON Objects for current repository context:
public items jsonObjects(JSONObject jsonObject) throws JSONException {
...
String siteId = jsonObject.getString("id_website");
String siteName = jsonObject.getString("website_name");
String visitDate = jsonObject.getString("visit_date");
String visitors = jsonObject.getString("total_visits");
...
}
- Modify the JSON items array and adapter to match your source:
myRVA.java
items.java
- Arrays that will be used to initialize the chart:
public static String[] siteName;
public static float[] visitors;
- Function to fill the data accordingly into the arrays:
public void JSONtoArray () {
...
...
}
- In-order to change the chart design/look:
chartActivity.java
- The name of the folder that will be created in external storage:
String appFolder = "JSON-Manipulator";
- The folder path of the created folder:
filePath = Environment.getExternalStorageDirectory() "/" appFolder;
- The file that will be alterd within the folder:
fileJSON = new File(filePath, fileName);
There is no need to use any debug tools in-case of modification/enhancement to the application. As the application contains Logs before executing any function, were those logs will assist when facing any difficulty.
Log.d("ActivityName", "Executed Function/method");
Example of the applciation logs:
When using/modifying this application or the source code of this application always do give appropriate credit. In-case of using this application or the source code of this applciation in commercial or monetary situation(s) do always ask for permission and give appropriate credit.