Automatic reply message program (No texting while driving), how to test it?

http://www.appinventor.org/bookChapters/chapter4.pdf

A mobile phone, the mobile phone has two phone slots, can you test the automatic reply message program.

Use two phones
Run the app on phone 1
From phone 2, send a text to phone 1
Phone 2 should receive the response text from phone 1 with the location information.

If this is not what you are looking for please refine and/or elaborate your question.

With some (or most phone providers) you can send a text message (sms) to your own phone number.

This works for me; sending a text to your own phone number may work for you. Does it?

Send the text, then look for the message in you phone's texting app might work.

1 Like

if you send a message to yourself you could end up in an infinite loop

1 Like

@Luk_Stoops A good point. Sending a text to one's self does not end up in an infinite loop sending a single text message. Whether an app goes into a infinite loop using the MessaggeReceived block depends on your phone service and the code in the MessageReceived Block. On my service, the NtWD app repeats the message about six times when sending to my own cell number and then stops looping automatically. This method can be used to test the NTWD app.

@or_s The example you cite will not work unless you modify the Blocks to account for changes Google made in how texts are handled See the documentation in Texting

1 Like


A1

B1

problem:

  1. Component attributes: Message, PhoneNumber. Must I fill it out?
  2. Component attributes: Message, PhoneNumber. Fill in the phone number to call. Or the phone number to listen to the phone?
  3. When the mobile phone receives the information, the program will automatically obtain the phone number and information of the other party. And save it in variables: number, messageText.

1. Component attributes: Message, PhoneNumber. Must I fill it out? Yes. NTWD sends a text message to a phone number

2. Component attributes: Message, PhoneNumber. Fill in the phone number to call. Or the phone number to listen to the phone? The phone number to call. If you are going to test this should either be another phone other than you development Android or ... if you can live with the message posting several times... you own phone's number. The ideal way is as Luk posted (another phone you or a friend has).

3. When the mobile phone receives information, the program will automatically obtain the phone number and information of the other party. And save it in variables: number, messageText. No, the app will not save it in number, message Text. You save them to the TinyDb as described in the tutorial. You have to provide a way to save the information about who called etc., perhaps using a TinyDB. The tutorial provides a basic app and suggests ways to enhance the app.

As indicated in the tutorial:

Test your app To test this behavior, you need to restart your
app to see if the data is truly stored persistently and
retrieved correctly. In live testing, you can restart the app
by changing some component property in the designer,
such as the font size of a Label. This will cause the app to
reload and Screen.Initialize to be triggered. Of course,
you can also test the app by actually building it and
installing the .apk file on your phone. Once the app is on
your phone, launch it, type a message for the custom
response, close the app, and then reopen it. If the message
you entered is still there, things are working correctly.

It only saves the message you tell it to.

@or_s the topic's title seems to be misleading.
I first thought you want to send an reply message whenever you are driving and receive a message at that time.

not working on android 10, anyone have the same problem? and know how to fix it?

What is not working on Android 10 Devin? The Not texting while driving tutorial is obsolete as it it appears in the literature. Have you looked at the advice provided here in https://community-appinventor-mit-edu.ezproxy.canberra.edu.au/t/no-text-while-driving-compiling-not-working/32231/3\? It tells how to modify the original tutorial. You will have to use a Companion version with a u in it. For example do not use Companion that downloads from Google Play. (2.62) to compile the app. Use Companion 2.62 u. The u version contains the SendMessageDirect Block required to make the tutorial work since Google required additional security precautions.

Does that advice help? .

1 Like

Can something like this be done for a phone call and not just for sms?