Sana Bokhari

Greenhorn
+ Follow
since Jan 12, 2012
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sana Bokhari


AOA, hello
this is my code for start service .... but i get an exception here and that is

org.smslib.GatewayException: Comm library exception: java.lang.RuntimeException: gnu.io.NoSuchPortException


and the other thing is



and i fail to understand how to get rid of it.
i have installed rxtx , first i got just the mismatch error with that the pc atleast use to prompt that phone has been connected, but the problem then was that it use to get disconnected after a short time. but now the phone does even connect not even by using default parameters

[/code]
[/code]

Please do let me know what to do ???
8 years ago

Walter Gabrielsen Iii wrote:I'm not sure if I understand the question correctly, so correct me if I'm wrong.

Though I don't know if it is even possible since I don't know about sms, My thought is that maybe the best way to transfer the contents of a file here is for Java on the mobile to somehow open an IO input connection stream through the serial cable to the PC and then connect that to an outbound SMS connection through the wireless network connection. Then, just do a read/write cycle until it reaches the end of the file and post that to the SMS connection.

\

What i mean by file transfer through sms was...
i break the file in datapackets....i.e.

1 datapacket = 1 sms (164 bytes)
and then send the file sms by sms.
8 years ago

Srinath Gamage wrote:hi,
Search for gammu. It includes a SMS Daemon which can be used to SMS through the connected phone.
After getting it configured, just only a matter of calling command line utility with right parameters.



hey... i did check it out.. but the problem is .... it is limited to sending and recieving sms etc ... what i plan to do is file transfer through sms eventually... which gammu wont support.... and i dont whether gammu and java can be implemented side by side!!
8 years ago

Winston Gutkowski wrote:

Sana Bokhari wrote:hey i am reading a file byte by byte..., then storing it in a byte array and lastly converting it to a string...


First mistake. Bytes and characters are not the same thing. They can be converted; though this is usually done by using either
(a) a BufferedReader, or
(b) one of the String constructors that takes a byte array.
but this really only works if what you are reading in is text. If it's binary, you really DON'T want a String.

but i want to convert values on every index of the byte array individually..... i.e. what ever bytes i have on index one should be converted to string.....


And here's where my confusion starts. Are you saying that if you read in a byte that contains an ascii 'a', you want it to print out as '97'?
Because that's what your code will do.

Furthermore, if you simply concatenate all those numbers together, you will never be able to get your original values back, because the strings produced may be of different lengths. You could zero-fill them to some uniform length, but it seems like an awful lot of "noise code" to me.

My suggestion is this: back up and explain exactly what it is you're trying to do (NOT what you've done) and why. That might help us suggest a solution.

Also: provide some examples of what you want, because at the moment your requirements mystify me.

Winston







hey thank you for explaing it ....and i got it right now
8 years ago
hey ....i tried a lot but cant figure out what to do .
what i want is
1. Connecting cell phone to pc through data cable
2. Sending a plain text message from pc to someone... the cell phone is acting like a gsm modem here.

i am able to detect the ports... but i fail to use them... i even googled it but the codes i get mostly dnt work... or i think i can get,what they do ... so any help will be appreciated ...
thank you.
8 years ago
hey i am reading a file byte by byte..., then storing it in a byte array and lastly converting it to a string... but i want to convert values on every index of the byte array individually..... i.e. what ever bytes i have on index one should be converted to string.....the problem here is, i convert the whole byte array into a string at one time. plus i am concatenating the bytes in "data" in string form which means even if i convert "data" back to string i will let get the same result i.e. the bytes .. rather then the data in readable form...
Please help:)




8 years ago