Itai Landau

unread,
Apr 21, 2019, 9:31:30 AM4/21/19
to mitappinv...@googlegroups.com
Hello all,

I would like to share with you my first app created as part of an online course I'm taking at my work place.
The task was to develop a Map Location App that sends a text message to your chosen contact with your current location. 
We also needed to share our app to the App Inventor community.

So let's start :)

There are 3 main part for my app:
  1. The phone number - 
    1. So I gave the user 2 options in this part: 
      1. Enter manually the number - as it sounds, user just need to type in the number of his chosen contact
      2. Or Choose from your contact list - I used the "Social option of "PhoneNumerPicker", which when pressed, shows you the contact list on your device, from which you can choose
      3. I also added a "Clear" button in case user want the option to send several times, without the need to manually delete the number/contact he chose. 
      4. Screenshot_20190421-160428__01.jpg
    2. And the code behind all of that:


      1. Choose from contact Choose contact from devide.PNG
      2. Clear button              Clear your choise.PNG
  2. The Map - 
    1. I used the "Maps" -> "Map" option as to show my map. Very basic I think, nothing special here
    2. I choose to show the location of the user on the map and a compass.
    3. In order to be able to get the location on the map, I had to add the "Sensors" -> "LocationSensor" option. 
    4. This one enables the map to actual show the user and to refresh the map according to the refresh time interval of your choice.  
    5. This is how the map looks in the app: Screenshot_20190421-160428 (2).jpg
    6. And this is the code to "Initialize location"        Initialize Location.PNG
  3. The "Send" button - 
    1. It use is very simple: 
      1. At first, I choose the "send Message" option, which turned out to be very annoying. As each time I pressed the button, I was transfer to my default texting app, where there I needed to press again the "Send" button of the app, in order for my message to send out.
      2. So after some digging, I found out there is a better option (at least for me) which is "sendMessageDirect". This option enables you to send the text message directly from your app. Only difference, is that it needs a special permission to read/write messages. I saw no issue in my case, as I built a very simple app. Of course, this should be a concern when you are building an app which you want others to use.
      3. If there is a number in the designated place - send the message and show a success message on screen Screenshot_20190421-160722__01.jpg
      4. If there is no number - show an error message on screen and don't send anything Screenshot_20190421-160434.jpg
      5. And the code behind it: Send Location.PNG
That's it. 
I hoped you enjoyed my post, and that it was helpful for you :)

TimAI2

unread,
Apr 21, 2019, 1:28:50 PM4/21/19
to MIT App Inventor Forum
Thank you and well done :)
Reply all
Reply to author
Forward
0 new messages