How to start an App Inventor app after a Trigger SMS has been received

2,082 views
Skip to first unread message

Taifun

unread,
Dec 14, 2012, 5:21:52 PM12/14/12
to ai...@googlegroups.com
currently I'm playing around with Java and created a small Java app which can start an App Inventor app after a trigger SMS with the text puravida has been received...
note: I'm Java beginner and in case you have suggestions on how to improve that example, hints are very appreciated...
see here: http://puravidaapps.com/sms-receiver.php
Taifun

Gary

unread,
Dec 15, 2012, 6:45:17 AM12/15/12
to ai...@googlegroups.com
Very Nice.

And pretty good for a Java 'beginner'. Was it hard getting started?

and now that you are using Android with all those good tools, will it be harder to go back to App Inventor? ;-)

Gary

Gary

unread,
Dec 15, 2012, 6:52:26 AM12/15/12
to ai...@googlegroups.com
The only thing I could think of was you are using Log.w. You may want to consider using Log.d.

-----
  private static final String TAG = "smsreceiver";

  Log.d(TAG, strMessage);
-----

That makes it more obvious where the log is coming from, useful when you filter.
Debug messages are stripped in production. You can use Log.i (info) if you want the log to be in production.

Hmmm
You could add a menu item that set the trigger message.

BUT

It looks very good. Congratulations.

Gary


Jos Flores

unread,
Dec 15, 2012, 8:13:06 AM12/15/12
to ai...@googlegroups.com
Taifun,

this is fantastic, Congrats! If this is your first piece of Java, I
can't wait to see what you'll be doing when you get comfortable with
it!

I agree with Gary that having a TAG makes easier to keep track of
things, and using the class name also. w is generally used for
warnings, and d for debug, but it's not a big deal.

The only thing I would say is actually not about the code itself but
about the functionality. It's one of those things that can be
discussed for ever and never get to an agreement, but in my (personal)
opinion an app should not be able to do things that affect the UI by
itself, unless it is something really important like a phone call. Let
me explain with an example... you are playing a game, really into it
(or reading an email, would be the same case), a text comes in with
the word 'puravida' and then you are taken out of your game and the AI
app comes to the foreground... I would personally hate that! :)
This is why the Texting component creates an notification instead of
doing things straight away.

But in any case, this is debatable. If you are using a work phone that
needs to trigger an action, then you shouldn't be playing games in
first place... But what if a text comes while you are on a call... Or
if two texts come in in a row? I don't know, it can be very tricky.

In any case, congrats again, amazing work indeed!

cheers,
José

Taifun

unread,
Dec 15, 2012, 8:42:53 AM12/15/12
to ai...@googlegroups.com
thank you guys ;-)
well, as already mentioned, I copied the source together and adjusted it only a little bit...


you are playing a game, really into it
(or reading an email, would be the same case), a text comes in with
the word 'puravida' and then you are taken out of your game and the AI
app comes to the foreground... I would personally hate that! :)
I didn't think about that... I guess I would hate that, too ;-)
yes, there is a lot to consider...

> The only thing I could think of was you are using Log.w. You may want to
> consider using Log.d.
thank you, will add that...

> You could add a menu item that set the trigger message.
 or to set the package name of the app which needs to be triggered...
will have to look for the "TinyDB" in Java... ;-)

and: I have seen this morning that my Java app was not running anymore...
I thought, it will stay in the background?

Taifun

Jos Flores

unread,
Dec 15, 2012, 8:50:37 AM12/15/12
to ai...@googlegroups.com
That's weird, if you register the receiver in the manifest (as you are
doing) the app should pretty much stay... there is no way to make a
100% sure that the device will not kill the app if it needs the
resources, but it shouldn't be the case unless you were using your
phone a lot.
Any chance you went in a close it inadvertently?

cheers,
José

Jose Mª Martin

unread,
Dec 15, 2012, 10:03:22 AM12/15/12
to ai...@googlegroups.com
And I say, it would not be better to create the app and start the bot's phone so that if it is itself the sms app which does all the work.

But I have to install this stuff to work I see a little sloppy, I think being able to create components and guidelines, everything we do in this way will be right, so you do not need to install applications to run one application.

Do you think this.

Taifun

unread,
Dec 15, 2012, 2:43:06 PM12/15/12
to ai...@googlegroups.com
so that if it is itself the sms app which does all the work.
of course, you are right, this is the best solution...
but as beginner I have to make very small steps ;-)
and this was the first step...
Taifun

Taifun

unread,
Dec 16, 2012, 4:24:36 PM12/16/12
to ai...@googlegroups.com

Update in Version 2: Now you can configure the trigger text and the App Inventor app to be started... http://puravidaapps.com/sms-receiver.php
Taifun
puravidaapps.com


Steve

unread,
Dec 16, 2012, 4:29:31 PM12/16/12
to ai...@googlegroups.com

Genius!

Barre

unread,
Dec 17, 2012, 6:00:21 AM12/17/12
to ai...@googlegroups.com
ooo i love these, thanx

Anthony Barnes

unread,
Dec 17, 2012, 6:42:45 AM12/17/12
to ai...@googlegroups.com
Good Job Tai!


On Mon, Dec 17, 2012 at 6:00 AM, Barre <bmcb...@gmail.com> wrote:
ooo i love these, thanx



--

Jose Mª Martin

unread,
Dec 21, 2012, 12:45:33 PM12/21/12
to ai...@googlegroups.com

Of course, any progress is good wherever it comes from, and I appreciate any progress on these issues, just my appreciation of things nothing to do with all the jobs that have slowly been enrriqueciendo AppInventor and community.

Greetings.

Pauline Dela Cruz

unread,
Jan 4, 2013, 11:38:18 PM1/4/13
to ai...@googlegroups.com
hi. .can you help me in my thesis. .i relly dont know how to work on java but i can handle App inventor very wel. .the problem is. .that when i install the apk (after i finished programming it in the app inventor)and then run it ,it flawlessly run but when i press home it cannot run in background. .anyway  my app is like a sensitivity alarm so it really needs to run in background, it's like an anti theft alarm . .im just a beginner can you or any one here help me. .tnx:D


Noong Sabado, Disyembre 15 2012 06:21:52 UTC+8, si Taifun ay sumulat:

Gary

unread,
Jan 5, 2013, 7:55:14 AM1/5/13
to ai...@googlegroups.com

David Sanborn

unread,
Jan 5, 2013, 5:39:20 PM1/5/13
to ai...@googlegroups.com
I can see an excellent way for parents who give their children Android devices to know where they are. Simply write an AI app with screen.ini to text back a location where the receiver is at. Great way to find where your child is at if they are not answering they device.

James Hancock

unread,
Jan 9, 2013, 5:41:11 PM1/9/13
to ai...@googlegroups.com
You need to be careful Taifun,
At this rate there will be no issues left on the issue list,
well done.:)

ikechukwu Christopher

unread,
Jun 8, 2013, 5:43:28 PM6/8/13
to ai...@googlegroups.com
i want to start my own application instead of puravida app. How do i go about it?

Taifun

unread,
Jun 8, 2013, 7:20:13 PM6/8/13
to ai...@googlegroups.com
start learning Java with the Android SDK http://developer.android.com/sdk/index.html
do some tutorials http://developer.android.com/training/index.html
and take a look at this sample code http://mobiforge.com/developing/story/sms-messaging-android
Taifun

Taifun

unread,
Jun 11, 2013, 3:01:27 PM6/11/13
to ai...@googlegroups.com
Update in Version 3:
  • Now it is also possible to start the defined App Inventor app for all messages. To start the App Inventor app only if a trigger message has been received, this of course still works.
  • SMS Receiver will now acquire a wake lock for 1 minute, which means, in case the device is sleeping, it will wake up to be able to run the App Inventor app. Therefore additionally the permission System tools: prevent phone from sleeping is now required.
  • SMS Receiver now also will start the App Inventor app, if the phone is locked. Therefore additionally the permission System tools: disable keyguard is now required.

more info see here http://puravidaapps.com/sms-receiver.php

Taifun



Jeff Nash

unread,
Oct 23, 2019, 4:03:03 PM10/23/19
to App Inventor for All
Hello

Sorry for my poor english, good job but i woud like to open my app in a specific screen like i do with "ActivityStarter" when i receive a trigger message, i have an app with 9 screens an only one of them should be open by this way, and this is not "Screen1" wich is a menu.

Regards

Taifun

unread,
Oct 30, 2019, 6:36:45 PM10/30/19
to App Inventor for All
what about adding the following if statement in the Screen1.Initialize event:

if not is empty get plain start text
then open another Screen "your screen you like to open"

you can find the not block in the Logic drawer and the is empty block in the Text drawer

Taifun

Trying to push the limits of App Inventor! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.        

Jeff Nash

unread,
Oct 31, 2019, 7:25:23 AM10/31/19
to App Inventor for All
Hello

That is what i did with Alarmmanager, i am a newbie and i discover trics step by step, it seems to work but in fact i didnt receive anymore other SMS on my phone,  unfortunnately  this app seems to block other incomming SMS, not good, i am disapointed because i need this App to awke appli on a request of my friend.

Taifun

unread,
Oct 31, 2019, 10:53:35 AM10/31/19
to App Inventor for All
unfortunnately  this app seems to block other incomming SMS
sorry, but what you are describing is technically not possible
you are disappointed, that's fine... feel free to create your own solution. thank you

Taifun

Jeff Nash

unread,
Oct 31, 2019, 2:13:53 PM10/31/19
to App Inventor for All
Hello

Sorry, the problem happened when testing app, very strange, but it sems you are true, i made a new test and all was good, i didnt saw the notification to buy the full version, is it the full version that i have downloaded named "SMSRceiver3test.apk" ?

Regards

Taifun

unread,
Nov 27, 2019, 9:31:15 PM11/27/19
to App Inventor for All
is it the full version that i have downloaded named "SMSRceiver3test.apk
no, this obviously is the test version
Taifun
Reply all
Reply to author
Forward
0 new messages