Guys, this was a great help thank you. The following code worked:
PrintWriter save = new PrintWriter(myExternalFile);
save.println(Arrays.toString(array));
save.close();
Type: Posts; User: baseball07
Guys, this was a great help thank you. The following code worked:
PrintWriter save = new PrintWriter(myExternalFile);
save.println(Arrays.toString(array));
save.close();
Ok thanks, actually I had used: fos.write(array); in my initial post and it resulted in a series of "?". This is a test code, however I will design a test code which executes on the desktop to see...
Thanks for all the suggestions, I actually have done that initially (converted bytes to String) and still did not come out as numbers, which is what prompted my initial post. When I convert to String...
I am able to create a text file and save it to the external storage on the device. I use the file explorer on the device to locate and open the file. I updated the original post with this...
Hi, I am having trouble implementing FileOutputStream to save an array of data. In this code, I implement a loop which counts to 9, stores the counter values in a byte array, then writes the array...
I'm not sure what is null, the values of X and d1 are defined. True is boolean. I even tried defining int numx = 10, so that it now becomes
data.appendData(new GraphViewData(X, d1), true,...
I am using GraphView appenddata to plot incoming data in real-time in Android.
Android GraphView - official Project Homepage
However, my program crashes when loading it onto my device...
The read function seems to be working fine, it is reading packetBytes as 0,
byte[] packetBytes = new byte[bytesAvailable];
and per the description on the oracle site, if len is zero,...
This is the code and Logcat. I believe my indexing is correct. I am reading buffer position 0 which is the first index of the buffer where my data should be. I changed the initial Buffer read to 1,...
Hi yes thank you. I have actually tried many different array values and I still get the same thing. The code is reading it fine from the array, as the value of "b" is correct. It is just in that...
Thank you I was unaware of that. Something is still not right though. The buffer value is showing up as [] and the final string is blank in logcat. I confirmed that the buffer position is OK, as...
Thanks for the feedback, its lots of help, I have used println() on many variables to see what is going on, and I found that I was indexing incorrectly as per your suggestion. I am now having issues...
I have printed the variable "i" and "b" at various locations, see the attached logcat and updated code. My bluetooth device is broadcasting 1 byte of data every 1 sec (the value 0x02). "i" is...
Thanks Norm. My initial thought was a problem with the readbuffer array size and/or for loop, however any array size throws an exception, and I also tried changing the loop to for(int i=0;i <=...
Hey guys, my appologies, I was not aware my attachment was so small. Here is logcat. Note the code doesn't reach the if statement
03-08 14:29:02.240: D/libEGL(1652): loaded...
Hi, I have attached a picture of the logcat to my original post.
Hi I have the following code which reads in data from a bluetooth transmitter, however the program is crashing upon read-in. The bluetooth connects to the device just fine, as indicated by the...