Skip to content

Instantly share code, notes, and snippets.

@Elrhino
Created August 28, 2015 15:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Elrhino/ce55dfedfca724e8fe0e to your computer and use it in GitHub Desktop.
Save Elrhino/ce55dfedfca724e8fe0e to your computer and use it in GitHub Desktop.
Code snippets from ToasterLauncher - GWTP Beginner's Tutorial Part 1
private boolean validateFields(String coordinates, String power) {
return coordinates.matches("[0-9]{3};[0-9]{3};[0-9]{3}") && power.matches("[0-9]");
}
@Override
public void onLaunch(String coordinates, String power) {
if (validateFields(coordinates, power)) {
// TODO: Do something with the values. Process with service.
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment