This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Net; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Hosting; | |
using Microsoft.AspNetCore.Hosting.Internal; | |
using Microsoft.AspNetCore.Hosting.Server; | |
using Microsoft.AspNetCore.Http; | |
using Microsoft.AspNetCore.Http.Features; | |
using Microsoft.AspNetCore.Server.Kestrel.Core; | |
using Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions.Internal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// convert three r,g,b integers (each 0-255) to a single decimal integer (something between 0 and ~16m) | |
function colourToNumber(r, g, b) { | |
return (r << 16) + (g << 8) + (b); | |
} | |
// convert it back again (to a string) | |
function numberToColour(number) { | |
const r = (number & 0xff0000) >> 16; | |
const g = (number & 0x00ff00) >> 8; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BatteryActivity extends Activity { | |
//UI Elements | |
private TextView mTextViewLevel; | |
private TextView mTextViewTemperature; | |
private TextView mTextViewVoltage; | |
private TextView mTextViewHealth; | |
//Battery details | |
private int level; |