use of io.spark.core.android.cloud.api.Device in project android-app by spark.
the class NamingFragment method populateName.
private void populateName() {
Device device = DeviceState.getDeviceById(currentRenameAttemptHexId);
String name = null;
if (device != null) {
// use existing name
name = device.name;
}
// it could still be null if the device was never named
if (name == null) {
name = CoreNameGenerator.generateUniqueName(DeviceState.getExistingCoreNames());
}
coreNameText.setText(name);
}
use of io.spark.core.android.cloud.api.Device in project android-app by spark.
the class DeviceState method initialize.
public static synchronized void initialize(Context ctx) {
appContext = ctx.getApplicationContext();
String coresJsonArray = Prefs.getInstance().getCoresJsonArray();
Type listType = new TypeToken<List<Device>>() {
}.getType();
List<Device> devices = WebHelpers.getGson().fromJson(coresJsonArray, listType);
updateAllKnownDevices(devices);
}
Aggregations