package com.ardrumoid;

import com.facebook.drawee.backends.pipeline.Fresco;
import com.hoho.android.usbserial.driver.UsbSerialPort;

import android.app.Application;
import android.content.Context;
import android.hardware.usb.UsbDeviceConnection;

public class MainApp extends Application {

	public static double syncTime = 0.075;

	private static Context mContext;
	private static UsbSerialPort mPort = null;
	private static UsbDeviceConnection mConnection = null;

	@Override
	public void onCreate() {
		super.onCreate();
		mContext = this;
		Fresco.initialize(mContext);
	}
	
	public static Context getContext() {
		return mContext;
	}

	public static UsbSerialPort getPort() {
		return mPort;
	}

	public static void setPort(UsbSerialPort port) {
		mPort = port;
	}

	public static void setConnection(UsbDeviceConnection connection) {
		mConnection = connection;
	}

	public static UsbDeviceConnection getConnection() {
		return mConnection;
	}

}

@@ -125,16 +125,81 @@
 ialPort;
+%0Aimport com.hoho.android.usbserial.util.SerialInputOutputManager;
 %0A%0Aimport
@@ -256,16 +256,58 @@
 ontext;%0A
+import android.content.SharedPreferences;%0A
 import a
@@ -351,91 +351,330 @@
 on;%0A
-%0Apublic class MainApp extends Application %7B%0A%0A%09public static double 
+import android.preference.Preference;%0Aimport android.util.Log;%0A%0Apublic class MainApp extends Application %7B%0A%0A%09public static final String PREFERENCE_SHARED_FILENAME = %22SharedPrefs%22;%0A%09public static final String PREF_SYNC_ID = %22
 sync
-Time = 0.075
+_time%22;%0A%09public static final float SYNC_TIME_DEFAULT = 0.075f;%0A%09%0A%09public static float syncTime
 ;%0A%0A%09
@@ -806,16 +806,17 @@
 = null;%0A
+%09
 %0A%09@Overr
@@ -915,16 +915,179 @@
 ntext);%0A
+%09%09%0A%09%09SharedPreferences pref = getSharedPreferences(PREFERENCE_SHARED_FILENAME, Context.MODE_PRIVATE);%0A%09%09syncTime = pref.getFloat(PREF_SYNC_ID, SYNC_TIME_DEFAULT);%0A
 %09%7D%0A%09%0A%09pu

Update MainApp.java