Search:

Type: Posts; User: baseball07

Search: Search took 1.11 seconds.

  1. Re: Using FileOutputStream to save array of bytes

    Guys, this was a great help thank you. The following code worked:




    PrintWriter save = new PrintWriter(myExternalFile);
    save.println(Arrays.toString(array));
    save.close();
  2. Re: Using FileOutputStream to save array of bytes

    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...
  3. Re: Using FileOutputStream to save array of bytes

    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...
  4. Re: Using FileOutputStream to save array of bytes

    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...
  5. Using FileOutputStream to save array of bytes

    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...
  6. Replies
    3
    Views
    647

    Re: Use of GraphView apenddata

    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,...
  7. Replies
    3
    Views
    647

    Use of GraphView apenddata

    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...
  8. Replies
    21
    Views
    363

    Re: Help with serial read-in

    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,...
  9. Replies
    21
    Views
    363

    Re: Help with serial read-in

    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,...
  10. Replies
    21
    Views
    363

    Re: Help with serial read-in

    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...
  11. Replies
    21
    Views
    363

    Re: Help with serial read-in

    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...
  12. Replies
    21
    Views
    363

    Re: Help with serial read-in

    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...
  13. Replies
    21
    Views
    363

    Re: Help with serial read-in

    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...
  14. Replies
    21
    Views
    363

    Re: Help with serial read-in

    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 <=...
  15. Replies
    21
    Views
    363

    Re: Help with serial read-in

    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...
  16. Replies
    21
    Views
    363

    Re: Help with serial read-in

    Hi, I have attached a picture of the logcat to my original post.
  17. Replies
    21
    Views
    363

    Help with serial read-in

    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...
Results 1 to 17 of 17