<commit_before>var win = Titanium.UI.currentWindow;

var uploadGPS = '';
var latitude;
var longitude;
var coordinates = 'coordinates';
Titanium.Geolocation.purpose = "Recieve User Location";
Titanium.Geolocation.accuracy = Titanium.Geolocation.ACCURACY_BEST;
Titanium.Geolocation.distanceFilter = 10;

//Creation of a new Directory
var newDir = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory,'mydir');
newDir.createDirectory();
Titanium.API.info('Path to newdir: ' + newDir.nativePath);

var gps_recorded = Titanium.Filesystem.getFile(newDir.nativePath, 'coordinates');
var uploadGPS = gps_recorded.read();

//
// Geolocation Text
//

var updatedLocationLabel = Titanium.UI.createLabel({
	text:'Updated Location',
	font:{fontSize:12, fontWeight:'bold'},
	color:'#111',
	top:280, //Base number
	left:100, //same
	height:15, //same
	width:300 //same
});
win.add(updatedLocationLabel);

var updatedLocation = Titanium.UI.createLabel({
	text:'Updated Location not fired',
	font:{fontSize:11},
	color:'#444',
	top:300, // + 20 difference
	left:100, //same
	height:15, //same
	width:300 //same
});
win.add(updatedLocation);

var updatedLatitude = Titanium.UI.createLabel({
	text:'',
	font:{fontSize:11},
	color:'#444',
	top:320, // + 40 difference
	left:100, //same
	height:15, //same
	width:300 //same
});
win.add(updatedLatitude);

//
// Get current position - This fires once
//


Titanium.Geolocation.getCurrentPosition(function(e){
		if (!e.success || e.error)
		{
			currentLocation.text = 'error: ' + JSON.stringify(e.error);
			alert('error ' + JSON.stringify(e.error));
			return;
		}
		var longitude = e.coords.longitude;
		var latitude = e.coords.latitude;
		
		//Titanium.App.Properties.setDouble('longitde',longitude);
		//Titanium.App.Properties.setDouble('latitude',latitude);
		
		//Establishes a JSON array
		var datatoWrite = {"usersgps" : [{"latitude":latitude, "longitude":longitude}]};
		//Data to write?
		var newFile = Titanium.Filesystem.getFile(newDir.nativePath,'coordinates');
		newFile.write(JSON.stringify(datatoWrite));
});
Titanium.Geolocation.addEventListener('location', function(e){
		if (!e.success || e.error)
		{
			updatedLocation.text = 'error:' + JSON.stringify(e.error);
			updatedLatitude.text = '';
			updatedLocationAccuracy.text = '';
			updatedLocationTime.text = '';
			return;
		}
		longitude = e.coords.longitude;
		latitude = e.coords.latitude;
		updatedLocation.text = 'long:' + longitude;
		updatedLatitude.text = 'lat: '+ latitude;
		
		//Titanium.App.Properties.setDouble('longitde',longitude);
		//Titanium.App.Properties.setDouble('latitude',latitude);
		
		var datatoWrite = {"usersgps" : [{"latitude":latitude, "longitude":longitude}]};
		
		//Data to write? This is apparent overkill
		var newFile = Titanium.Filesystem.getFile(newDir.nativePath,'coordinates');
		newFile.write(JSON.stringify(datatoWrite));
});


//var datatoWrite = {"latitude":latitude, "longitude":longitude};
//datatoWrite.write(JSON.stringify(datatoWrite));

var gps_coordinates = {
	"coords": uploadGPS,
	"name": coordinates
};

//
//Button - Coords Upload
//

var upload_coords = Titanium.UI.createButton({
	title:'Coords Upload',
	height:40,
	width:145,
	right:80,
	top:220
});<commit_msg>Fixed the JSON array to export latitude, longitude<commit_after>var win = Titanium.UI.currentWindow;

var uploadGPS = '';
var latitude;
var longitude;
var coordinates = 'coordinates';
Titanium.Geolocation.purpose = "Recieve User Location";
Titanium.Geolocation.accuracy = Titanium.Geolocation.ACCURACY_BEST;
Titanium.Geolocation.distanceFilter = 10;

//Creation of a new Directory
var newDir = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory,'mydir');
newDir.createDirectory();
Titanium.API.info('Path to newdir: ' + newDir.nativePath);

var gps_recorded = Titanium.Filesystem.getFile(newDir.nativePath, 'coordinates');
var uploadGPS = gps_recorded.read();

//
// Geolocation Text
//

var updatedLocationLabel = Titanium.UI.createLabel({
	text:'Updated Location',
	font:{fontSize:12, fontWeight:'bold'},
	color:'#111',
	top:280, //Base number
	left:100, //same
	height:15, //same
	width:300 //same
});
win.add(updatedLocationLabel);

var updatedLocation = Titanium.UI.createLabel({
	text:'Updated Location not fired',
	font:{fontSize:11},
	color:'#444',
	top:300, // + 20 difference
	left:100, //same
	height:15, //same
	width:300 //same
});
win.add(updatedLocation);

var updatedLatitude = Titanium.UI.createLabel({
	text:'',
	font:{fontSize:11},
	color:'#444',
	top:320, // + 40 difference
	left:100, //same
	height:15, //same
	width:300 //same
});
win.add(updatedLatitude);

//
// Get current position - This fires once
//


Titanium.Geolocation.getCurrentPosition(function(e){
		if (!e.success || e.error)
		{
			currentLocation.text = 'error: ' + JSON.stringify(e.error);
			alert('error ' + JSON.stringify(e.error));
			return;
		}
		var longitude = e.coords.longitude;
		var latitude = e.coords.latitude;
		
		//Titanium.App.Properties.setDouble('longitde',longitude);
		//Titanium.App.Properties.setDouble('latitude',latitude);
		
		//Establishes a JSON array
		var datatoWrite = {"usersgps" : [{"latitude":latitude}, {"longitude":longitude}]};
		//Data to write?
		var newFile = Titanium.Filesystem.getFile(newDir.nativePath,'coordinates');
		newFile.write(JSON.stringify(datatoWrite));
});
Titanium.Geolocation.addEventListener('location', function(e){
		if (!e.success || e.error)
		{
			updatedLocation.text = 'error:' + JSON.stringify(e.error);
			updatedLatitude.text = '';
			updatedLocationAccuracy.text = '';
			updatedLocationTime.text = '';
			return;
		}
		longitude = e.coords.longitude;
		latitude = e.coords.latitude;
		updatedLocation.text = 'long:' + longitude;
		updatedLatitude.text = 'lat: '+ latitude;
		
		//Titanium.App.Properties.setDouble('longitde',longitude);
		//Titanium.App.Properties.setDouble('latitude',latitude);
		
		var datatoWrite = {"usersgps" : [{"latitude":latitude}, {"longitude":longitude}]};
		
		//Data to write? This is apparent overkill
		var newFile = Titanium.Filesystem.getFile(newDir.nativePath,'coordinates');
		newFile.write(JSON.stringify(datatoWrite));
});


//var datatoWrite = {"latitude":latitude, "longitude":longitude};
//datatoWrite.write(JSON.stringify(datatoWrite));

var gps_coordinates = {
	"coords": uploadGPS,
	"name": coordinates
};

//
//Button - Coords Upload
//

var upload_coords = Titanium.UI.createButton({
	title:'Coords Upload',
	height:40,
	width:145,
	right:80,
	top:220
});
{'fraction_non_alphanumeric': 0.1588785046728972, 'fraction_numerical': 0.019610847249885092, 'mean_word_length': 4.870503597122302, 'pattern_counts': {'":': 16, '<': 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': '343079', 'n_tokens_mistral': 2449, 'n_tokens_neox': 2204, 'n_words': 403}