Answering Machine for Android.

Service Manual.

Overview


This is the only Android Phone Answering Machine that really SPEAKS in-line during a phone call. You can receive incoming calls, record voice messages, enter numbers in tone dialing, and answer all this with pre-recorded phrases or tones according to the Java script program.

The versions of the Application are used to increase the difficulty level:

Demo - A classic telephone answering machine with ready-made phrases. Simple interface Free version.

Home - A classic telephone answering machine with the ability to record your own phrases. Simple interface

Professional - 10 ready-made scripts and the ability to create new ones are used. Built-in Java compiler. Sophisticated interface for advanced users.

Expert - You can create your own or modify the language of Java scripting programs by editing the language syntax file (in the current simplified version of the language there are only 160 lines). Very sophisticated interface for advanced users.

If a user installed Expert version, a residents of the Russian Federation can receive a beautiful adapter (red with text RICH TECH ). Please contact email.

You can use the standard headset that comes with your phone See the Headset Adapter section for instructions.

The application requires four permissions. If you do not agree, the application will not work correctly:

  • Storage - access your internal, external and SD card storage.
  • Microphone - required for voice recording.
  • Contacts - needed to determine the caller name.
  • Phone - receive data about an incoming call.

In a telephone conversation, a special adapter is used, which is inserted into the headphone jack. Without an adapter, the application will not talk in line. Take out the adapter - it becomes a regular phone, insert the adapter - the phone turns into an answering machine. To quickly check whether the application is working or not, you can use a regular headset, you just need to attach the left channel headphone to the microphone with tape. The sound will be worse than with the adapter.

The application is quite complex, contains 10 examples, an answering machine is just the simplest example. PLEASE! Read the detailed description on the developer's website: https://sites.google.com/view/answering-machine-ru. It is also in the Appendix in the Help section.

Unfortunately, on some models the application may not work properly. In this case, just uninstall the Application and accept my apology for the inconvenience. But in 90% of cases, users simply did not read the description, and poked the wrong buttons. Spend 5 minutes so you don’t end up in a “not working” position when in fact you were one step away from success. If it didn’t work on one phone model, you can try on another.

There are no ready-made phrases in the Appendix except answering.java, all phrases need to be voiced. After pressing the Record button and an audio signal, speak loud and clear - phrases will be highlighted automatically and then repeated. The threshold can be changed in the settings.

In Android, you cannot programmatically pick up the handset, so you must set the mode to “Pick up automatically when using the headset”. It is in almost all phones. If you do not have this mode, then the Application will not be able to work correctly.

If you really need your own script program, but you are not a programmer, you can turn to the author for help.

You write a script program from scratch, modify a ready-made example, or use it unchanged. Start by the Start command, first test in text mode, then sound all the texts in a monotone voice by the Voice command, test already with sound without an adapter, finally insert the adapter and your Android works as an answering machine.

The script program can be quite complicated. One user wrote a 450-line reality quest program with tasks, passwords, appearances, riddles, and a grand prize. Such an unexpected application.

In general, the author was counting on commercial use in small shops and companies. Such examples, of course, exist, but they are fewer than we would like.

You can close the application or turn off the display. As soon as they call you, the phone will pick up the phone and the program will start working. Everything that the caller entered or said is fixed and then you can view and listen to it with the Log command.

To exit the answering machine mode, you must either remove the adapter or select the Stop command.

Thank you for using the Android Answering Machine (Answering Machine) application.

Successes.

Sincerely, Vladimir Yukhlin.

Headset Adapter

A special headset adapter inserted into the headset audio jack is used. The adapter contains a 4-pin Jack Audio and two resistors. This is a very simple device. See the Headset Adapter diagram. In some cases, a more complex universal design may be required.

Adapter will need to make yourself or order the manufacture in the electronic laboratory.

To quickly try and test applications instead of the adapter, you can use the standard headset that comes with your phone, but the sound will be worse. You just need to tape the left channel earphone to the microphone as shown in the picture. If this option works for you, you can certainly make an adapter.

Another, in my opinion, the best option is to rework the headset. To do this, open the microphone compartment, find the points between the pins of the connector 1 and 4 using the tester, and add ONE 4.7 kOhm resistor.

Simple interface

Demo and Home versions use a very simple interface. If the adapter is removed - this is a regular phone, if inserted - an answering machine. You can listen to messages in any of these modes.

In the Home version, you can voice your own phrases Hello, Unknown and Goodbye, in the Demo version all phrases are recorded by default in a pleasant female voice and you can’t change them. The versions are no differences.

You can overwrite phrases with the Hello, Unknown and Goodbye commands. After the beep, say any phrase you want. Speak clearly and confidently - the phrase will be record automatically. The best quality is obtained when recording from the headset.

You can check how the application works without a call on the Test command and listen to all available messages on the Log command.

All messages can be deleted using the Clear command.

Phrases Hello and Goodbye are used if the subscriber is on your contact list and you want to record his message. If the subscriber is not in the list of your contacts, you can configure the answering machine to say the phrase Unknown and imitate short beeps.


Menu structure

You can control the application using the menu.

The Top menu consists of 4 tabs:

  • Log - it displays the results. One file with the .log extension corresponds to one start of the program. This may be in test mode when you press the Start button or when you automatically receive a phone call. You can select any file - just click on the desired place. Press again to play a file. A long press selects all files. You can delete files or make a call back.

Edit - allows you to edit the text of the script program. The program is written in a simplified language similar to C or Java with automatic type detection. Files have the extension .java. A brief description of the language will be given in the Script Programming Language section.

Code (Code) - allows you to compile and edit Java Virtual Machine code directly. Files have the extension .jvm.

Voice - allows you to voice the texts used in the program by voice. You can select any phrase (file), listen to an already voiced version, record again using the Record command, or select all the phrases and voice all at once. The selection of the beginning and end of the phrase occurs automatically. Just speak.

The bottom menu changes depending on the operation mode and contains the commands: Stop, Start, Load, Save, Delete, Record, Callback.

The main menu consists of the following items:

  • Welcome.
  • Help - this document is available on the Internet.
  • Syntax - script programming language syntax file.
  • Example - ready tutorials scripts.
  • Update - options for updating the program.
  • Settings - everything is already set up in an optimal way and it is better not to touch anything at first.


Script example

Ready examples for training.

  • answering.java - Answering machine (classic).
  • cinema.java - Cinema schedule (information about the cinema, movies, session time).
  • control.java - Test call (as in some voice messaging programs).
  • melody.java - Moscow suburb nights (simple melody by notes).
  • novella.java - Text story (game with a choice of options).
  • number.java - Numbers from zero to a million (a complex example of the account of parrots with endings and cases of Russian numerals).
  • repeater.java - Repeater (repeats everything you say).
  • security.java - Object safety (temperature, humidity and object sounds).
  • verselet.java - Poem in lines (either voiced or listened to what was voiced).
  • voice.java - Voicemail (receive your messages and send messages to others).
  • chat.java - Voice chat (speaks last 10 messages).

Start with melody.java and then answering.java.

Steps for answering.java

1. Main menu - Examples.

2. Answering.java.

play("Hellow. This is Vlad. I’m sorry I’m not available to take your call. Please leave a message, and I’ll get back to you as soon as I can.");
pause(1);
beep(1000,0.5);
record();
play();
play("Thanks! Bye.");

You can see from the script that the phrase "Hello". is played first, then after a pause of 1 second and beep, a message is recorded, which is immediately played back. At the end, the phrase "Bye" is played.

3. Check in text mode while without adapter. Click Start, the program should start and print "Hello". After a pause of 1 s and beep, say some appropriate phrase, for example, "Hello, this is Vlad." The phrase should be recorded and repeated.

4. Voice the phrases used, go into the Voice mode, and after the Record command and the beep, say the phrases "Hello ..." and "... Bye"

5. Check in voice mode, without adapter. Click Start, the program should start and say "Hello ...". Please note that the inscription "answering.java - service started" appeared. The program is ready to receive phone calls.

6. Set the mode to "Automatic off-hook when using a headset." He is in almost all phones. You can close the application or turn off the display. With an incoming call, the application picks up the phone itself and the program starts. All that the caller entered or said is fixed and then you can view and listen to it with the Log command.

7. To exit the answering mode, you must either remove the adapter or select the Stop command

8. After the received call, a notification appears with an Application icon, a phone number and the name of the caller. Click on the notification, the application will start.

9. At the Log command, listen to the received messages, if necessary, make a call back by selecting the Callback command.

10. Delete the log entry using the Delete command.

The following two sections are for programmers only. You can skip them if you are not going to create your own scripts.

Scripting programming language.

The language of the script program is similar to C or Java. Files have the extension .java.

Comments are used;

  • /* comment */
  • // comment to the end of the line

The types of data defined in the calculation process are used:

  • bool - for logical values 0 and 1 (any integer not equal to 0);
  • long - for integer numbers 1234567890, 79139139999;
  • double - for real numbers 3.1415926, 1.6e-19;
  • string - string literals "Hellow, world. \ n" in UTF-8

The type of the variable is determined during initialization: n = 10; a = 3.14; Type conversion occurs during calculations.

One-dimensional arrays of any size are used. If the value of the array element is not assigned, then the value 0 is returned. The index can take any long values, including negative ones.

array[-999999] = 123456; // допустимое выражение

Functions can be used. a = sum (b, c); ... sum (x, y) {return (x + y);} Arrays in the function are not passed. The scope of the variables corresponds to the scope of the function. The main () function may be missing.

Used operators:

  • assignment: =, +=, -=, *=, /=, %=;
  • ariphmetic: +, -, *, /, %, ^- exponentiation;
  • increment/decrement: ++, --;
  • logical: !, &&, || ;
  • comparison: ==, <, >, <=, >=;
  • indexing: []

The following branch and loop constructions are used, where c is a condition, p is an operator:

if(c1) p1; 
else if(c2) p2; 
else if(c3) p3; 
else p4;

switch(c0) {
case c1: p1;
  break;
case c2: p2;
case c3: p3;
  break;
default: p4;
}

for(p1, ..., p2; c1; p3, ... ,p4) {
  p5; 
  break;
  continue;
  return;
  p6;
}

while(c1) {
  p1; 
  break;
  continue;
  return;
  p2;
}

There is a label and can use goto :)

The following built-in functions are used:

record (); // write voice to yyyyMMdd-HHmmss.pcm
record ("String"); // write voice to xxxxxxxx.pcm file
record (123456); // record voice to file 123456.pcm

play (); // play the file yyyyMMdd-HHmmss.pcm
play ("String"); // play the file xxxxxxxx.pcm
play (123456); // play the file 123456.pcm

yn = exist (); // 0 or 1 there is a file yyyyMMdd-HHmmss.pcm
yn = exist ("String"); // there is a file xxxxxxxx.pcm
yn = exist (123456); // file 123456.pcm exists

delete (); // delete the file yyyyMMdd-HHmmss.pcm
delete ("String"); // delete the xxxxxxxx.pcm file
delete (123456); // delete the file 123456.pcm

n = number (); // caller's number

n = input (); // input using tone dialing
// 10.0 - time to the first digit, seconds
// 5.0 - time after entering the last digit, seconds
n = input (10.0, 5.0);
n = input (10.0);
// if nothing is entered, returns 0

pause (1.0); // delay for 1.0 seconds

beep (); // tone signal
// 1000.0 - frequency, Hz
// 0.5 - duration, seconds
// 0.005 - the duration of the fronts, with
beep (1000.0);
beep (0.5);
beep (1000.0, 0.5);
beep (1000.0, 0.5, 0.005);

You can also use the simplified printf function for debugging:

printf ("Text"); // one parameter
printf ("Long=%d", i); // second parameter is long
printf ("Double=%f", d); // second parameter is double
printf ("String=%s", s); // second parameter is a string

To avoid errors, built-in functions are not recommended for use in complex expressions.

See ready examples.

Java Virtual Machine

A simplified version of the JVM virtual machine is used. The text can be viewed after compilation by the command Code.

In the Professional version, the JVM text can be compiled, corrected and saved. In the Home version, the text can be corrected and saved text phrases. In the Demo version, the examples are precompiled without any possibility of change.

There are comments:

// comment to the end of the line

The virtual machine is based on stack operations. List of all operators:

Label: L1      // Address label
Function: Sum  // Address of subroutine 
call Sum       // Call the subroutine
invoke PLAY    // Invoke the standard method
ret            // Return from subroutine 
goto L1        // Branch to address  

nop            // Do nothing 
pop            // Pop the top operand stack value 
dup            // Duplicate the top operand stack value 
swap           // Swap the top two values on the operand

const 1        // Push bool constant    
const 123456   // Push long constant    
const 3.1415   // Push double constant    
const "String" // Push string constant    
load v1        // Load from local variable 
store v1       // Store into local variable 

index          // Store index of array
aload a1       // Load from array 
astore a1      // Store into array 

// Ariphmetic instructions the top two values
add, sub, mul, div, rem, pow, neg, inc, dec

// Compare the top two values 
cmplt, cmple, cmpgt, cmpge, cmpeq, cmpne, and, or, not, 

// Branch if  
if_case, if_null, if_nonnull