Broadcast hub (solved)

Sorry. I have no additional ideas. You appear to be using the correct tools. Early in the discussion I explained there were known issues with that tutorial that dates from 2014 Herin. Someone else might have suggestions about how to get this working.

Accept what the app can do (you have had some success) or do something different. Perhaps create a chat app on a CloudDB or FirebaseDB . A chat app would provide similar communications functionality for a group of users, but in a very different way.

Regards,
Steve

1 Like

Thank u for u suggestion but I have a lot of faith in the work i’m doing and I can’t back out.you have helped thoroughly and I am greatful

1 Like

This the codes

You did not provide your code Blocks Herin.

I suspect the Runtime Error … Invalid destinationAddress might be a problem with accessing your database of registerd phone numbers.

How are you testing this? Using Companion or a compiled app? Here is what the tutorial says
" The app works great so far, but if you’ve completed some of the earlier tutorials, you’ve probably guessed that there’s a problem: if the administrator closes the app and relaunches it, the broadcast list will be lost and everyone will have to reregister. To fix this, you’ll use the TinyDB component to store and retrieve the BroadcastList to and from a database." You might not be doing that.

Also, this could be an issue with communication to your database. Are you using a TinyWebDB or something else?

What were you doing when the Runtime Error appeared? Loading the app? Sending a Text from the app or something else.

I am using a compiled app and i’m using the **Tiny DB ** component to store and retrieve the broadcast list and it works perfectly but only if the app is running even after setting the receiving enabled properties to 3.
The app wasjust received a member onto my phone when the error showed.
The picture is not uploading for reasons unknown

How to post an image of your Blocks to the Forum:
1- right-click on an empty area of your Block screen. You will see this MENU


2- left-click Downlaod Blocks as Image . Doing this will download an image of all your Blocks to your computer downloads folder.

3 - drag that image from the downloads folder into the Forum Reply text area

I deleted your images you made with a camera… sorry they are unreadable .

Now, try to make a copy of your blocks and post them please.

(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)

You modified the original tutorial a lot. I can’t test your code so for whatever it is worth, here are some comments:

  • The cause of the Runtime Error when “The app was just received a member onto my phone when the error showed.” is probably related to using a text block in the Screen1.Initialize tinydb1.GetVAlue valueIfTagNotThere instead of a required create empty list Block. Do I know for sure? Of course not. I can’t test your app; not having a second phone to test with among the issues. This also could be your failure to check if the valueFromDB is a List.

  • You use a TextToSpeech Block in your addNumberToGroup Procedure; sometimes using that block causes timing issues. As an experiment, I would disable it and see if performance improves.

  • You said "
    I am using a compiled app and i’m using the **Tiny DB ** component to store and retrieve the broadcast list and it works perfectly" - obviously not.

  • I am surprised to see you use a call textingSendMessage instead of a textingSendMessageDirect. The purpose in using a Companion with a u in it is to be able to send texts automatically; isn’t it?

  • " but only if the app is running even after setting the receiving enabled properties to 3." does ‘app is running’ mean when the device is turned off or when it goes to sleep. The tutorial was written for use in a seminar; I guess the intent of the app was to keep the app active so others could use the hub. To use your cell as a hub, you might need to code a StayAwake routine to prevent it from going to sleep. Why a ‘3’ is not working I do not know…it might not be working because of other coding issues identified.

Change some things and you might get this to work the way you want yet.

-Steve

Is there any tutorial to code a stay awake routine??

Either use a Stay Awake block routine using a Notifier

or you use Taifun’s Tools Extension: https://puravidaapps.com/tools.php

Using either an extension or a block routine drains your device battery rapidly . These work around methods are not running the app in the Background, they force the app
screen to stay open.

How do u upload the extension??i’ve already downloaded it.Thank u for the help

http://ai2.appinventor.mit.edu/reference/other/extensions.html


Do I have to click on the legacy connection when download my app onto and my phone and if it is needed, why is it necessary?

Pls help with the above questions


As long as this window is visible to the user, keep the device’s screen turned on and bright.
Note: If the screen of the device is on, this will obviously drain battery of your device! Please use this method wisely! You might want to use this method together with the Settings extension to adjust the brightness of the screen.
Sponsor of this method is Joerg. Thank you!


Calling this method will cancel the KeepScreenOn flag.

The recommended option is to Leave Use Legacy Connection unchecked. Some users have difficulty using the Companion if they do not use Legacy. Legacy provides the Companion behavior that existed prior to several months ago. Most users do not need to check that Block.

Thank u for the reply but in respone to this pic, what are the necessary things to pick or do i need to experiment??

You do not need to pick any of the options shown for Taifun Tools. Just go to the Block editor now that the extension is installed. Use the indicated blocks to keep the screen awake.

If you are not comfortable doing this with Taifun’s extension, you can use blocks ( How to keep the screen on ) instead of the extension. I use the Blocks for StayAwake and it works great. No need for the extension.

Yes, you need to experiment. Make a new Project as a test to learn the too. Experiment, just to keep the screen from sleeping and see how the tool works . Once you are confident it works, finish programming your Broadcast hub app.

Apart from keeping the screen on, will the app carry out it’s functions with the help of this code

A stayawake routine might allow you to set ReceivingEnabled properties to 2 instead of 3 . The app will ‘run’ constantly, especially if you keep your device’s charger plugged in. The app will not go to sleep while stayawake runs so ReceivingEnabled Foreground (2) should work fine instead of Always (3). Experiment to see what works for you.

Let us know what happens. Good luck.