Broadcast hub (solved)

I’m sorry but there are not any receiving enabled properties to set to ‘1’,‘2’ or ‘3’

This is the tutorial you modified Herin http://www.appinventor.org/BroadcastHub2 .It uses the Texting component. The ReceivingEnabled properties can be set using words using the Designer.

TextingReceivingEnabled

You can also set the values using Blocks. image
If you use Blocks …1 maps to Off; 2 to Foreground, 3 to Always as shown on the Designer. Sorry, how this property is set is confusing but this is MIT’s documentation. What you do depends whether you set the property using the Designer or using Blocks within the code.

Does this help?

Another problem i’m having is that it doesn’t send messages directly, sometimes it doesn’t send at all.
It either needs my permission and that was before I used the send message direct block now it doesn’t even send again

Are you compiling the app with a version of Companion that has a " u " in its version number (for example Companion 2.58au )? To send messages directly you must be using a real device (not an emulator).

I’m using an Android phone not emulator and I compile the app with companion ‘2.58au’

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.