hello,
actually i want to read a simple file and write it to a array. I have worked in java but j2me is completely new, can anyone please help me.
Printable View
hello,
actually i want to read a simple file and write it to a array. I have worked in java but j2me is completely new, can anyone please help me.
So.
What happened when you moved the J2SE code, that you imply you understand, to your J2ME environment?
Errors?
Exceptions?
The main thing I can think of is I think the Collections framework isn't on J2ME, so you'd need to use the older stuff (Vector, Hastable).
The file handling techniques used in J2SE are totally different from J2ME, there are many errors.
I cant get help online also., its becoming difficult..
If anyone knows how to do it, please help..
Moved from New to Java.
Have you gone through the File Connection API (JSR 75)?
db
not yet, will go through it. Thank you.
thank you DarrylBurke, i used jsr 75 for firl reading.
i have 1 more doubt i want to plot some points , but they are double and J2ME has normal integer functions, does any1 have any idea of how to plot double values in j2me?
You can't *plot* fractional values on a screen that is composed of integral pixels.
db
but i did plot the same in j2se..
ofcourse there is a way.
Nope. You can fake it with anti-aliasing, but there are no sub-pixel coordinates on a screen.
db
okay....but a simple question can i draw a line of double values:
like draw(double,double,double,double);
i did this in j2se., but the same method is not working in j2me, but of course there is some method ...
Java ME doesn't have anti-aliasing built in. If you want to fake it, you're going to have to write your own routines that determine the colors to apply to adjacent pixels to simulate sub-pixel positioning. But why bother?
What specifically is your problem with drawing using integral coordinates?
db
mu problem statement is:
i have to plot a ECG graph in j2me.
the ECG values belong to double.
So round them to int?
db
okay, but actually in my application accuracy matters a lot!..
Thank you
but if anyone gets a better idea please help..
Accuracy? After all this discussion, are you still under the impression that you can draw to the screen at a point in between two pixels?
Do you understand what a pixel is? Do you understand anything at all about how pixels are rendered to a screen? Think of a sheet of graph paper, in which you can shade any of the squares -- but nowhere in between. That's it.
Also, J2ME and J2SE are outdated terms. The platforms are now known as Java ME and Java SE. And you might need to fix your <Shift> key to be able to program in Java. It seems to not work most of the time.
db
Mr DarrylBlurke,
you are no 1 to question about my understanding!
For your kind information
Do you understand what a ECG signal is? Do you understand anything at all about how ECG values are?
here's a example for you :
Time voltage
0.000 -0.145
0.003 -0.145
0.006 -0.145
0.008 -0.145
0.011 -0.145
0.014 -0.145
i had already tried rounding it off and plotting it.
it gives a straight line between o and 1.
there are live projects who have done it. I asked help, if you know do so, otherwise please leave the forum question unanswered.That's it.
Good Bye.
Then you need to define your scale on each axis.
The final number you use will be an integer (a number of pixels) where each pixel represents a voltage (or time).
Sure, throw a hissy fit. That won't get you fractional pixels though.
And use proper words, don't pollute the forum with 'abbreviations' like "no 1" for no-one.
db