Created
August 28, 2015 15:17
-
-
Save Elrhino/ce55dfedfca724e8fe0e to your computer and use it in GitHub Desktop.
Code snippets from ToasterLauncher - GWTP Beginner's Tutorial Part 1
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
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