Broadcast hub (solved)

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.

The texting component is working perfectly.Although I do not have many phones to test it’s capability due to the current happenings in the world.I will like to add some additional features such as only people from a particular country can join.Any ideas on how to do that??

Congratulations . Would you like to share your aia with the forum? Others certainly are interested in what finally worked.

How to restrict usage depends partly on your existing code.
Restrict phone numbers to those with a particular country code or area code possibly. Only allow those to 'register' if their phone number's first several digits matches particular criteria perhaps. The Texting.MessageReceived event handler can identify the number of the phone registering. Use a conditional statement ... if number contains xxxx then it is ok, if not then cannot register.

Sorry butthe coding is confusing.Explain howdy will write such

Sorry for all the typographic errors.I was asking how it should be written.for the number to be compared

Sorry Herin. I don’t know what your code looks like at the present time after all the modifications you made.

Here is how you would code what you want using the original Broadcast Hub example only234
assuming your are in Nigeria ( where the country code is +234) and that code is a required part of the phone number. Will it work? I have no idea.

You also could provide similar code elsewhere (perhaps in your registration section) that checks whether a number does not contain +234 and if it does contain 234, the person cannot register. Without seeing your code, this stuff is only a guess.

Can u send the full piece of the code

I don’t understand. You have the complete code. Use an If Block.

If contains text get number piece +234 That If block should exclude execution of all the following blocks that are within the then part. i.e. if is in list? thing get number… unless +234 (the country code) is part of the texting number. If 234 is part of the phone number, the If code allows the code in the then part to execute.

If you need more advice, please post your aia here.

I have been able to solve the problem.If I want the app to be programmed for National use.Any advice??
I was also thinking if u want the messages sent to be filtered by keywords and stored in groups based on a particular topic.What do u think can be done ??

And am I allowed to use the app for public use??

You solved the problem filtering allowed phone numbers based on the national country code that is part of the phone number :slight_smile: .

I don't know. The messages user sent go to all users who sign up. What you do to restrict use depends on how you store the messages and what you expect to do with them. At present, the app does not store the actual messages, it only stores the phone numbers ... How to work with Lists by Sajal may give you ideas. The original tutorial assumes that after the messages are sent, the messages on the app just are thrown away. All that is retained is a List of those numbers texting messages.

This is what MIT says about apps created using App Inventor Privacy Policy and Terms of Use . You must determine if your local telecommunication laws allow re-broadcast of text messages. What the app does is if the text message is sent from a number already in the broadcast list, the message is broadcast to all numbers in the list.

Re-read the original tutorial. The tutorial explains what the app does and offers suggestions for modification.

Your original question was answered Herin (the Hub is working for you). Please start a new forum topic for your additional programming questions. Thank you.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.