I am new here. So first let me say that B4A is a great advance for my effort in building Android apps. I startet first with Eclipse trying to get into that "very special" Java world. Well.. after several days fiddeling around I even manged to customize the "Hello World" application. Not that encouraging... at least for me. Then I came across to that B4A and it was like a flash. It didn't take even one hour to feel familiar with it. That's the way... great stuff... Absolutely worth the money.
Now - what I want to build is some app that stays awake in the background listening to incoming SMS, processing their content, and calling (by intent) GoogleMaps accordingly.
Until now I couldn't figure out how put a running (not pausing or sleeping) B4A app in the background and how to connect some activity to the phone event that I would describe as "New SMS received"
As a workearound I used "SmsMessages.GetAllSince(...)" in a polling loop - but that's a quite uncool approach - and it falls asleep once you click that app in the background.
Any advice - even the smallest one - would be greatly appreciated!
Services are used instead of activities to handle tasks while the application is in the background. Basic4android doesn't support services yet. The Services concept is pretty complicated. Much more than creating an activity.
I believe that support for services will be available soon.
Thanks for your quick reply, Erel. Now I got some clue about the different behavior of "services" and "activities" and your link shed a little more light on the back stage scene of that Android system. Ok, so let's wait a bit for the coming B4A support for "services" . Chances are it comes earlier than I would manage to accomplish that task in Java
I beleive so, but I cannot say for sure.
As now planned, the first step will include support for scheduled tasks. Which means that you can run some code every interval or at a specific time.
You should start by reading Klaus' Beginner's guide.
I think it should include Services (form where it works in the background) somewhere. Otherwise for Services, you can start reading here.