2014년 12월 16일 화요일

"Pager"-App


I am building an Pager-App for my Red Cross medical Unit (Non-Budget and Non-Commercial). This App has two Screens. The first screen is the "Pager" wich receives messages, display them and playing a Sound for new messages wich include presetted words. The second screen is the "Alarm sender" wich sends messages to the selected groups or persons. The Alarm sender is still working fine, but the "Pager" screen has a little Problem. When the message arrives and the App is opened everything is working fine but when the App is in background nothing happens.

I Know, get apps to run in background is very difficult so I searched in Forum for a Solution.

The "10 sec. Timer Solution" from Piotr isn´t working and Taifuns SMS receiver isn´t usable for this Project.

Has anyone an Idea how I can fix this Problem?

--
Well, the problem is that AI apps cannot work in the background.  The only way to make it hapen would be to do something constantly in the app that makes it stay awake and in the foreground, but even with advanced techniques, the app can always be destroyed by the Android OS.   

Normally, background operations are done with a service, but AI has no facility for services.

You MIGHT be able to send a regular text message to alert to pen the app though, and then once you open it up, check the messages from the server. 

--
why do you think, the SMS Receiver helper app can't help you?
Each time a SMS is received, SMS Receiver checks if the defined App Inventor app needs to be started depending on the stored settings (start for all messages or start only for trigger message).

--
The SMS Receiver supports only one Trigger, for this app I need at least 4 Triggers. Further this is an Non-Budget Project, so I can´t buy your SMS Receiver App. There are many apps in the Store (Alarmbox, FireAlert etc...) wich can do that, but this Project should be an All-In-One solution.

--
@Daniel...be aware, Taifun's SMS Receiver is not free.  He provides a demo version with limited capabilities so you can figure out whether you want to buy the full version for it appears to be 10$.   Is it worthwhile?   Only you can be the judge.

His project requires that SMS Receiver be loaded on your device.   Kind of clunky but it might get you the response you need.

Alternatives?    Code using the free Java based Eclipse or Android Studio which can build apps that run in the background.  If you have Visual Basic experience, search for Basic4Android to get a very low coast Android compiler.  Yes, Java is difficult for most people to learn, why many people turn to the less featured AI2 (which still can code some neat apps but does not have all the features of a professional compiler).

AI2 is an entry level compiler, primarily intended for teaching programming on Android devices.   Sorry it can not do all you want it to.

--
the SMS Receiver app has 2 modes
1. start your App Inventor app only for the trigger message, or
2. start your App Inventor app for all messages
I would suggest you to use option 2 for your purposes, then just have some logic inside your app to decide what needs to be done

btw. the SMS Receiver app is available for only 10 USD...

--
Thanks for your Answer, SteveJG

Taifun, ich werde mal schauen, ob sich das nicht irgendwie auch anders bewerkstellingen lässt. Wenn eine All-in-one-Lösung so nicht umsetzbar ist, muss ich umdenken. Trotzdem danke für deine Hilfe, Thread kann geschlossen werden.

--
alternatively you also can take a look into a Tasker solution
How to start an App Inventor app using Tasker by Gekko

--
Meanwhile I found out how to keep the App alive in Background and "listening" to incoming SMS. Now there is the Problem, that the App displays every incoming SMS, not only the "contains Text"-Messages, so I think I made an mistake in the Blocks Editor wich I don´t find out.

Can you see where it is?


--
Meanwhile I found out how to keep the App alive in Background and "listening" to incoming SMS.
how do you keep the app alive?

--
At first I used a 10 Second Timer that prevents the app from going to "sleep" - And at least, there is a function in "Texting" where you can set "Display all SMS", "Display SMS only when App is Opened" and "Display no SMS" ;-)

Did you see my Screenshot? Maybe you can find the mistake.

--
Maybe you intended to use:

--
Thanks a lot, Ghica. Now it´s working :-)

--

댓글 없음:

댓글 쓰기