Hello everyone,
I am new at Java(android)-before I have little information about Java lang- and in particular socket programming -before I do not know nothing about socket client server programming-, previously I wanted to write simple chat program by using Threads and now I pass this step, two android emulators can talk each other, to success -just for test even I parse whether it is string or integer- that I use ObjectInputStream and ObjectOutputStream classes with writeObject(obj: MyClass) (in Client Thread class) and readObject() (in Server Thread class). MyClass -just for now I hope with your help- contains only string attribute which implements Serializable interface. Yes it is my history, no problem BUT NOW I am asking to you how can I use and modify MyClass according to sending/receiving sound record, NOT FROM A FILE. Here my ideas -thanks to my chief-
Primitive Algorithm
1-> yes I have MyClass and it is needed to this purpose so go to step 2
2-> I want to add buffer array typed byte named audio_array ok no problem go to step 3
now my class contains string literal and byte array
3-> I should fill MyClass's byte array with voice -starting this part, it is very hard to me :(- my question is that how it will understand that sending data is voice call and how byte array is filled ??!! I should NOT have a file with extension .wav or .pcm format :( Also I should responsible to adjust size of this array but how? step 4
4-> Receiver class (In my program it is server thread class) It should understand of type of data and go to 5
5-> Yes Receiver class understands the type and calls the new Threads -i.e If I send text call the Thread which is responsible for showing text or If I send voice stream then It should call the Thread which is responsible for playing this record. Ok just for this part, I start threads for different purposes no problem.
Also my chief talks about junking i.e. in a for loop just for 2 seconds I send sound data after 2 second wait and re-start again and again I do not understand :(
To sum up, In fact, It is no difference sending text or sending voice call -it should be!!- because I do not use any file whether sending text or sending voice in fact I want to send/receive serializable objects (I already but just for string literals). I only want to extend MyClass ability but how? It sounds easy for my ears but to implement it seems very hard ? Please help me where I should start how to use google efficently by true keywords and true java classes for this purpose, I want to do this before my intern period ends :(
Thanks for previous posting , in particular Moderator JamesChyrelll...