<commit_before>package au.edu.unimelb.boldapp;

import java.io.StringWriter;

import android.util.Log;
import android.content.Intent;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;

import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;

import au.edu.unimelb.boldapp.sync.Client;

public class SyncActivity extends Activity {

	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.sync);
	}

	public void onResume() {
		super.onResume();

		// Load previously set router info.
		JSONParser parser = new JSONParser();
		String jsonStr = FileIO.read("router.json");
		try {
			Object obj = parser.parse(jsonStr);
			JSONObject jsonObj = (JSONObject) obj;
			String routerIPAddress = jsonObj.get("ipaddress").toString();
			String routerUsername = jsonObj.get("username").toString();
			String routerPassword = jsonObj.get("password").toString();

			EditText editText = (EditText) findViewById(R.id.edit_ip);
			editText.setText(routerIPAddress);
		} catch (Exception e) {
			e.printStackTrace();
		}<commit_msg>ensured all data in router.json can be viewed in the editTexts<commit_after>package au.edu.unimelb.boldapp;

import java.io.StringWriter;

import android.util.Log;
import android.content.Intent;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;

import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;

import au.edu.unimelb.boldapp.sync.Client;

public class SyncActivity extends Activity {

	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.sync);
	}

	public void onResume() {
		super.onResume();

		// Load previously set router info.
		JSONParser parser = new JSONParser();
		String jsonStr = FileIO.read("router.json");
		try {
			Object obj = parser.parse(jsonStr);
			JSONObject jsonObj = (JSONObject) obj;
			String routerIPAddress = jsonObj.get("ipaddress").toString();
			String routerUsername = jsonObj.get("username").toString();
			String routerPassword = jsonObj.get("password").toString();

			EditText editText = (EditText) findViewById(R.id.edit_ip);
			editText.setText(routerIPAddress);
			editText = (EditText) findViewById(R.id.edit_router_username);
			editText.setText(routerUsername);
			editText = (EditText) findViewById(R.id.edit_password);
			editText.setText(routerPassword);
		} catch (Exception e) {
			e.printStackTrace();
		}
{'fraction_non_alphanumeric': 0.11843107387661843, 'fraction_numerical': 0.0, 'mean_word_length': 5.025229357798165, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7386289', 'n_tokens_mistral': 866, 'n_tokens_neox': 788, 'n_words': 172}