I am developing an app to send Infrared Codes in the form of int[]. I have a String of hex code: "0000 0048 0000 0018 00c1 00c0 0031 0090 0031 0090 0031 0030 0031 0090 0031 0090 0031 0090 0031 0090 0031 0090 0031 0030 0031 0030 0031 0030 0031 0030 0031 0030 0031 0090 0031 0030 0031 0030 0031 0030 0031 0030 0031 0030 0031 0090 0031 0090 0031 0090 0031 073b" and I need to convert it to an int[] split at the spaces in decimal form.
String hexCode = "0000 0048 0000 0018 00c1 00c0 0031 0090 0031 0090 0031 0030 0031 0090 0031 0090 0031 0090 0031 0090 0031 0090 0031 0030 0031 0030 0031 0030 0031 0030 0031 0030 0031 0090 0031 0030 0031 0030 0031 0030 0031 0030 0031 0030 0031 0090 0031 0090 0031 0090 0031 073b"
String decimalCode = hex2dec(hexCode); //I don't know how to convert this and keep the spaces
String[] decArray = decimalCode.split(" ");
int[] final = decArray; //Not sure how to do this. Maybe a for loop?
I have been working at this for a few hours and am getting frustrated. I can't convert from hex to decimal string successfully and then I can't put it into an int[].
Please help!