Back to project page OpenBCI-AndroidApp.
The source code is released under:
Copyright (c) 2014 OpenBCI(TM) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Softwa...
If you think the Android project OpenBCI-AndroidApp listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
/* Copyright (c) 2014 OpenBCI * See the file license.txt for copying permission. * *//* ww w.java2s.c o m*/ package com.openbci.BLE; public class FormatDataForFile { //Helper function to convert byte array to a string of hex values public static String convertBytesToHex(byte[] input){ StringBuilder sb = new StringBuilder(); int len = input.length; for(int i=0;i<len-1;i++){ sb.append(String.format("%02X", input[i])); sb.append(","); } sb.append(String.format("%02X", input[len-1])); return sb.toString(); } //Helper function to convert float array to comma separated string public static String convertFloatArrayToString(float[] input){ StringBuilder sb = new StringBuilder(); int len = input.length; for(int i=0;i<len;i++){ sb.append(Float.toString(input[i])); sb.append(", "); } return sb.toString(); } }