Back to project page lifx-sdk-android.
The source code is released under:
MIT License
If you think the Android project lifx-sdk-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
// // LFXClient.java // LIFX/* w w w . j a va 2 s . c o m*/ // // Created by Jarrod Boyes on 24/03/14. // Copyright (c) 2014 LIFX Labs. All rights reserved. // package lifx.java.android.client; import android.content.Context; import lifx.java.android.internal.LFXWiFiObserver; import lifx.java.android.internal.LFXWiFiObserver.LFXWiFiObserverCallback; import lifx.java.android.network_context.LFXNetworkContext; import lifx.java.android.network_context.internal.transport_manager.lan.LFXLANTransportManager; public class LFXClient { private static LFXClient sharedInstance; private LFXNetworkContext localNetworkContext; public static LFXClient getSharedInstance( Context context) { if( sharedInstance == null) { sharedInstance = new LFXClient( context); } return sharedInstance; } private LFXClient( Context context) { super(); LFXWiFiObserver.getSharedInstance( context).addObserverObjectWithCallback( this, new LFXWiFiObserverCallback() { @Override public void run( Object context, LFXWiFiObserver observer) { LFXClient client = (LFXClient) context; client.getLocalNetworkContext().resetAllCaches(); } }); } public LFXNetworkContext getLocalNetworkContext() { if( localNetworkContext == null) { localNetworkContext = LFXNetworkContext.initWithClientTransportManagerAndName( this, new LFXLANTransportManager(), "LAN"); } return localNetworkContext; } }