• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Recent content by amirihana

  1. A

    Apps nanoTime() method output

    i am using nanoTime() as timestamps to create an interval to execute a certain method like this: long start=System.nanoTime(); Log.d("time", "time "+start); Log.d("time", "time "+start/1000000); while(true) { long end=System.nanoTime(); Log.d("end", "end "+end)...
  2. A

    Apps Microphone doesnt emit sound after running for some time

    i am developping an application that takes use of an android phone microphone to emit sound at a 15-17KHz frequencies, every 3 seconds. The problem is, after running for some time (more than 30 loops) sound doesnt go out at all, but the application still running normally. I need this sound...
  3. A

    Apps connect two devices and send automatically via bluetooth

    i need bluetooth operations to be automatic as much as possible. I used xxxxUsingInsecureRfcommWithServiceRecordto avoid authentification windows. but after pairing them, i used this code but its not working (i want one device to fetch for the other in his paired devices list and establish a...
  4. A

    AudioRecorder not recording right

    I am trying to use AudioRecorder to record a wav file for a certain interval of time (corresponding to a certain number of samples). to stop the recording i used Timer().schedule(delay) to stop after a while. but no matter what is the value of that delay the file is always the same size, and not...
  5. A

    Apps Stop thread after a certain time

    i am writing a code to record audio input using AudioRecorder a,d stop it automatically after a certain time. But it doesnt stop, it continues trying to record, and gives a NullPointerException error. here's the code, plz point out what is wrong with it. public void onCreate(Bundle...
  6. A

    Apps time interval loop

    i want to write a code that sets an interval of time for a certain method and run it 4 times for specific time, inside that interval. for exemple: i have to generate a sound from the smartphone's speaker. the sound's length is 10 ms, and i want to generate that sound every 50 ms in an...
  7. A

    Apps write to a wav file

    i m new to Aandroid. I wanted to write the audio stream i created into a wav file but it didnt work. here's my code: public class MainActivity extends Activity { int duration=1; int sampleRate=44100; int numSample=duration*sampleRate; double sample[]=new double[numSample]; double...
  8. A

    save audio files

    Hello,i wrote a code that generates a sound and plays it. i wanna know if i am able to save it into a wav file. what should i do?
  9. A

    Apps self Audio Record

    Hello, I am trying to run some audio tests on smartphones. what i want to do is to generate a tone from the phone's speaker AND record it by the same phone's microphone at the same exact time. the tone generations runs pretty well, but is it possible to self record? any ideas?