Commit 91f718fc authored by kirk's avatar kirk

app startup initialization optimizations

parent da85b37e
......@@ -6,3 +6,4 @@
**/.classpath
**/.project
**/libs/*
lint.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="us.rader.wyfy"
android:versionCode="18"
android:versionName="1.18" >
android:versionCode="19"
android:versionName="1.19" >
<uses-sdk
android:minSdkVersion="10"
......
<?xml version="1.0" encoding="UTF-8"?>
<lint>
<issue id="ExportedContentProvider">
<ignore path="AndroidManifest.xml" />
</issue>
</lint>
\ No newline at end of file
......@@ -28,7 +28,6 @@
<string name="failed_to_write_protect_tag">Failed to write-protect tag</string>
<string name="unrecognized_result_code">Unrecognized result code %1$d</string>
<string name="canceled">Canceled</string>
<string name="unrecognized_connection_outcome">Unrecognized connection outcome %1$s</string>
<string name="null_message">Status OK but message is null</string>
<string name="empty_message">Empty message</string>
<string name="unparseable_payload">Unparseable payload</string>
......
This diff is collapsed.
......@@ -56,7 +56,7 @@ public final class QrCodeFragment extends Fragment {
/**
* Return the {@link Bitmap} for the QR code image representing
* <code>settings[0]</code>
* <code>wifiSettings[0]</code>
*
* @param params
* ignored
......@@ -76,7 +76,7 @@ public final class QrCodeFragment extends Fragment {
if (size > 0) {
return WifiSettings.getInstance().getQrCode(size);
return wifiSettings.getQrCode(size);
}
......@@ -111,10 +111,21 @@ public final class QrCodeFragment extends Fragment {
}
/**
* Cache the singleton instance of {@link WifiSettings}
*/
private static WifiSettings wifiSettings;
static {
wifiSettings = WifiSettings.getInstance();
}
/**
* QR code image
*/
private ImageView qrCode;
private ImageView qrCode;
/**
* Inflate the {@Link View}
......@@ -158,8 +169,8 @@ public final class QrCodeFragment extends Fragment {
}
/**
* Update the QR code bitmap now that the settings have, presumably, been
* restored and the view is, hopefully, ready
* Update the QR code bitmap now that the wifiSettings have, presumably,
* been restored and the view is, hopefully, ready
*
* @see android.support.v4.app.Fragment#onResume()
*/
......@@ -198,8 +209,7 @@ public final class QrCodeFragment extends Fragment {
try {
FragmentActivity activity = getActivity();
Bitmap bitmap = WifiSettings.getInstance().getQrCode(
getQrCodeSize());
Bitmap bitmap = wifiSettings.getQrCode(getQrCodeSize());
File file = activity.getFileStreamPath("wyfy_qr.png"); //$NON-NLS-1$
FileOutputStream stream = activity
.openFileOutput(file.getName(), 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment