Texting and Phonecall

Hi,
I’m writing an app which is intended to call and send message to a list of phone numbers when a certain event (in this case, a free fall of phone).

I don’t understand why when the intended event occurs, my phone will show the msg and phone number as well, even though my phone number is not included in the list of phone numbers. And worse still, there is no way to clear away the msg and phone numbers on my phone other than to re-start my phone. I’m using a Samsung Note 8.

I’ve attached below part of the app.

Could somebody advise me what is the problem?

Thank you!

-you are using Location changes apparently (offsetGPS ???) as part of your app to determine if a phone is falling. Did you read the section about Accuracy in Using the Location Sensor ? The GPS** cannot detect small changes in location with any reliability at all.

  • you are using an Accelerometer and comparing it to what you call offsetGPS (whatever that is)

In some ways, the intent of your app is similar to this discussion of using a cell phone to determine falling and lack of movement

There is some advice and code there that you might find useful in your development. You might read that and also AccelerometerSensor and . Programming Your App to Make Decisions and Texting

Hmmm. Have you gone to your phone's Messaging app and tried to delete the messages there? You do not have to re-start your phone most likely. When you use the Texting component, the component uses the device's system messsaging app; so the messages appear there too automatically. It is how Texting works.

Your list varPhone comes from somewhere. It probably includes your data when you imported it. When you iterate through the List, you get what is there.

Do I know for sure? Of course not, you did not share all your code.

Hopefully the tools here will help you figure this out. Good luck.

Regards,
Steve

Thanks Steve for your immediate response.

I used accelerometer to detect free fall by comparing the absolute value of each of the x,y and z components against the variable GPSoffset value of 1.
I have in fact write a separate app just to test and be sure that it works.

Regarding the second part of your reply, I did go to the phone’s Messaging app to delete the msg but as I said, the same msg will keep appearing. The msg actually appears as draft each time.

As for the varPhone, I have checked that my app has only one phone entry before I simulate a freefall of the phone by dropping it.

Regards,
TnJT

OK. Every time your if statement is satisfied in the AccelearationChanged event handler, the event handler will try to send both a Text message AND make a phone call. Requesting both could be a lot of text messages going out. :cry: and could be an issue (one might interfere with the other) without error control blocks. Are you sure you want to call Texting1.SendMessage instead of call Texting1.sendMessageDirect ? Do you really want to make a phone call and send a text simultaneously.

error

Oh well, have fun.

Thanks Steve.

I’ve decided to just send a message and forget about the phone call.

I have another query:
If I call Texting1.SendMessage to a list of phone numbers, is the number of recipients counted as the number of messages sent?

I am asking this because some telcos have mobile plans which limit the number of free messages that can be sent per month.

Thank you.

You can count them in your app (keep a log of tel no and no messages sent) then introduce a limit value to prevent sending of further texts until a time period is over ?

Thanks TIMAI2.
To set a limit for the number of texts sent will likely limit the usefulness of such an app.:sweat_smile:But I gather from your reply that the number of message sent is indeed equal to the length of phone list. Am I correct?

You said:

Therefore if a telco has a limit, the user will need to know what that limit is. They could enter this value to the app, which could then be compared to the count of the messages sent?

Indeed.:slight_smile: This is what you coded and told the app to do when you used the for each item in list .. varPhone . The app iterates through the List and sends each a text; spamming all your contacts. Is this really what you want to do? And you want to do this for free?

What a developer codes has consequences.

Of course, the list will be restricted, consisting of phone numbers of selected members who are invited to join a group outing by texting certain code.

No, I won’t be spamming all my contacts😅