Android Open Source - OpenHueSdk Utils






From Project

Back to project page OpenHueSdk.

License

The source code is released under:

Apache License

If you think the Android project OpenHueSdk listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.t3hh4xx0r.openhuesdk.sdk;
//  w  w w . jav a2  s  .c o m
import android.content.Context;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

public class Utils {
  public static class DeviceType {
    String type;

    public DeviceType() {
      this.type = "LOL NOOB";
    }

    public String getType() {
      return type;
    }

    public void setType(String type) {
      this.type = type;
    }

  }

  //
  public static DeviceType getDeviceType(Context c) {
    PackageManager pm = c.getPackageManager();
    DeviceType t = new DeviceType();
    try {
      t.setType(pm.getApplicationLabel(
          pm.getApplicationInfo(c.getPackageName(), 0)).toString());
    } catch (NameNotFoundException e) {
      e.printStackTrace();
    }
    return t;
  }
  
  public static boolean isWifiConnected(Context c) {
    ConnectivityManager connManager = (ConnectivityManager) c.getSystemService(Context.CONNECTIVITY_SERVICE);
    NetworkInfo mWifi = connManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
    return mWifi.isConnected();
  }

}




Java Source Code List

com.t3hh4xx0r.hueopensdkexample.BulbManagerActivity.java
com.t3hh4xx0r.hueopensdkexample.DashboardLayout.java
com.t3hh4xx0r.hueopensdkexample.MainActivity.java
com.t3hh4xx0r.openhuesdk.sdk.ColorPickerView.java
com.t3hh4xx0r.openhuesdk.sdk.CountDownTimer.java
com.t3hh4xx0r.openhuesdk.sdk.NumberToWords.java
com.t3hh4xx0r.openhuesdk.sdk.PreferencesManager.java
com.t3hh4xx0r.openhuesdk.sdk.Utils.java
com.t3hh4xx0r.openhuesdk.sdk.bridge.BridgeRegistrar.java
com.t3hh4xx0r.openhuesdk.sdk.bridge.IBridgeRegistrar.java
com.t3hh4xx0r.openhuesdk.sdk.bulb.AlertCodes.java
com.t3hh4xx0r.openhuesdk.sdk.bulb.BulbManager.java
com.t3hh4xx0r.openhuesdk.sdk.bulb.BulbStateRequestFactory.java
com.t3hh4xx0r.openhuesdk.sdk.bulb.CustomAlert.java
com.t3hh4xx0r.openhuesdk.sdk.bulb.IBulbManager.java
com.t3hh4xx0r.openhuesdk.sdk.bulb.StateCodes.java
com.t3hh4xx0r.openhuesdk.sdk.objects.Bridge.java
com.t3hh4xx0r.openhuesdk.sdk.objects.BulbState.java
com.t3hh4xx0r.openhuesdk.sdk.objects.Bulb.java
com.t3hh4xx0r.openhuesdk.sdk.objects.RegistrationRequest.java
com.t3hh4xx0r.openhuesdk.sdk.objects.RegistrationResponse.java