This file contains hidden or 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
@GET | |
@Path("/getMyInfoXML") | |
@Produces("application/xml") | |
public String getMyInfoXML(@QueryParam("name") String name) | |
{ | |
StringBuilder sb = new StringBuilder(); | |
String firstName = name; | |
String lastName = "Greene"; |
This file contains hidden or 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 static String itostrx(int hex) | |
{ | |
String result = ""; | |
String[] hexes = {"0", "1", "2", "3", "4","5","6","7","8","9","A", | |
"B","C","D","E","F"}; | |
while(hex >= 0){ | |
if(hex < 16){ | |
result = hexes[hex] + result; | |
break; |
This file contains hidden or 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 static String itostrb(int binary) | |
{ | |
String result = "0"; | |
int scalar = 1; | |
int placeHolder = 1; | |
while(binary>0){ | |
if((binary - scalar*2)>=0){ | |
scalar*=2; | |
placeHolder++; | |
}else{ |
This file contains hidden or 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 static int strxtoi(String hex) | |
{ | |
int result = 0; | |
for(int i = 0; i<hex.length();i++) | |
{ | |
int scalar = 0; | |
if(hex.charAt(i)>57) | |
{ | |
scalar = hex.charAt(i) - 55; | |
} |
This file contains hidden or 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 static int strbtoi(String binary) | |
{ | |
int result = 0; | |
for(int i = 0; i<binary.length() ; i++){ | |
if(binary.charAt(i)==49){ | |
if(i==binary.length()-1){ | |
result += 1; | |
}else{ | |
int scalar = 2; | |
for(int j = i + 1; j < binary.length()-1;j++){ |
This file contains hidden or 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 static int strdtoi(String decimal) | |
{ | |
int scalar = 1; | |
int result = 0; | |
for(int i=decimal.length()-1;i>=0;i--){ | |
result += (decimal.charAt(i) - 48) * scalar; | |
scalar*=10; | |
} | |
return result; | |
} |
This file contains hidden or 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 ExampleActivity extends Activity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
//Tells Android which XML file holds this class' information | |
setContentView(R.layout.ExampleActivityXMLFile); | |
//Sets up the chosen button | |
Button demo = (Button) findViewById(R.id.exampleButton); |
NewerOlder