Blackberry 10 - running app in background - blackberry-10

On the new blackberry 10 platform how can one develop a VoIP application which needs to contact a server every 10 minutes or so and receive incoming calls. I think there is no
option for background service like Android platform. Can the app be left running by the user, if so can the user start new apps like email etc without stopping an existing app.
Thanks

You can run BlackBerry 10 applications in the background, no problem at all. All you need to do is include the <permission>run_when_backgrounded</permission> in your bar-descriptor.xml. This makes the user aware that your app needs to run in the background and allows them to approve or deny it.
Check out: https://developer.blackberry.com/cascades/documentation/dev/fundamentals/index.html for more.

Related

How do I get notified when user starts messaging or mailing app in iOS

Actually I want to build such a iOS app which will give alert if user start sms application or messaging application when he is driving more than certain speed limit. As I am new in iOS development I don't know whether it is feasible or not?
Basically my id:
Q: How do I get notified when user starts messaging app?
Due to iOS sandboxing restrictions, you cannot get any information from your app regarding launching or usage of any other apps.
The only way to do this would be if you were the developer of both apps. In that case you could use an external server to log when each of the apps is launched and then get this information from the converse app.

Does an iOS app continue to run in the background after an App Store update?

For example: would a VOIP app, which has an open socket which is notified of incoming traffic before the App Store update, have a chance to re-establish that socket after an App Store update? Or does the App have to wait for the user to open the App first? I can't find any answer to this in any Apple documentation.
I believe that the app is shut down (terminated) before updating, and I don't believe that the system automatically restarts them after updating (geofencing and related tasks should still work, though).
Think about it: when you get an update for Bob's Awesome Application on your desktop, you have to shutdown the app before installing the update.
After the update is installed, Bob's Awesome Application doesn't restart itself - that would just be weird - and quite annoying.

Required Background Mode for location not re opening app after reboot

We are trying to develop an application similar to an existing app currently in the app store.
This app is sending location data in the background to a web service, and the app will continue to run following a reboot of the device. I will also note, that following the app being installed and registered, the location services indictor remains constantly on the status bar. I am assuming this is necessary to allow the app to continue to run following a the device being restarted.
We have tried using the "UIBackgroundModes/required background modes for location", and have been unsuccessful in having the app continue to run following a reboot of the device.
Can someone please point us in the right direction as to how to have the app continue to send location data following a device reboot.
Thank you very much!
No app will run following a device reboot. It is not possible to build a file daemon under Apple's SDKs. You'd have to jailbreak the phone and run unauthorized stuff to do so, then you wouldn't be accepted into Apple's app store.
Yes your app will be restarted if your are monitoring significant location changes or monitoring a region and that region is entered/exited.
In iOS 7 Apple made an important change that will disable these mechanisms if a user force quits your app. They will remain disabled until the user starts your app again.

Can iPhone apps start on start-up?

I've answered two different questions now, both explaining how VOIP apps don't start on start-up, yet people seem to think they do.
I'm not 100% sure myself, someone linked me to a part of the apple docs, which doesn't really mention anything about auto-starting of apps.
I was originally going on prior knowledge and this answer, but after another person saying that they do, I'm really not sure.
As far as I'm aware, apps only react to push notifications, and can't be launched into the background when a device is turned on.
Can we please clarify whether it is possible to auto-start an app or not?
Take a look at the UIBackgroundModes section in this document - it seems to state that adding the voip key will autostart an app on boot.
Edit: a sample app seems to confirm this behavior.
I confirm that setting VOIP mode works. However, I've found that the app won't restart after power up unless it was running when the device was powered off. Furthermore, the app won't actually restart on the recently powered up device until the device is unlocked after power up.
OK, I don't know if this classifies as an answer but I feel obligated to say. I am developing an app that both tracks significant location changes and provides VoIP features. The app has voip key in Required background modes. I tried some cases which I would like to share the results:
App is in Debug mode - Turned off while app was running (active or background) - iOS 7.1.1 (11D201) and iPhone 4 (product name: iPhone3,2):
When booted, app is running in background, as well as other apps that were running before. I do not think this is related to VoIP in any way.
App is in Debug mode - Turned off while app was terminated - iOS 7.1.1 (11D201) and iPhone 4 (product name: iPhone3,2):
When booted, the app is not running, there are no logs in configuration utility, server says the user is not registered I cannot call it from other devices; and yet the other apps that are not related to voip or location tracking but were open before turning off are at least loaded in memory. Meaning, the voip key did not work.
I have continued the test with the same app but this time downloaded it from app store. The results are the same. Changed the device and os to iPhone 3G (product name: iPhone2,1) and iOS 6.1.6 (10B500). Nothing changed both in debug and release modes.
I have told my boss that Apple provides this behavior and it can be done. Then I had second thoughts and tried, now I am desperately trying to find another way. Going to send my regards to Apple about this.
You can not launch an application without user interaction. The user has to click on the app icon, on push notifications, on a custom link. May be there are other ways I am not aware of, but even if they exist, they require user interaction to intentionally launch the app.
Edit
It turns out, as Tim mentioned, there might be an exception for VOIP apps.
I have been developing VoIP apps and I can confirm that VoIP app will autostart when iPhone reboots as long as user doesn't kill it before reboot. When iOS autostart voip app only application:didFinishLaunchingWithOptions: will be run, i.e. applicationDidBecomeActive: won't be run.
I used to doubt whether iOS will automatically restart the voip app when it crashes. After investigating I find iOS does automatically restart the voip app but if it keeps crashing iOS will then try servals time before it finally gives up.
If you check iPhone console output from xcode, you can see logs like these after the first crash
..
Service exited due to signal: Abort trap: xxx
Unable to get short BSD proc info for xxxx: No such process
Application 'UIKitApplication:xxxxx]' crashed.
...
Significant location change or region monitoring also causes an app to launch on boot as long as its turned on and left on. No UIBackgroundModes key is necessary for this.

How appstore, test applications which communicate with local servers

I am new in iphone development. I am developing an application, which is targeted to the costumers of a shopping mall. The application installed in the customers iPhone, wil communicate with a server in the mall(via wifi) and update him/her with various offers in the mall.
I am in the final stages of development and planning to submit the application for AppStore approval, once I complete dev. and testing.
I understand that, AppStore will test the application, when we submit it for approval.
In many occasions the application communicates with the local server to get data from it.
I would like to know, how they will test my application, without running the server?
When you submit your application to Appstore there's a place in forms where you can give account info for testing:
Demo Account - Full Access Please
provide us with the details of any
test accounts that we can use for
testing your application. This can
include usernames, passwords, access
codes, etc.
I'm not sure why you wouldn't want to expose your web services to the outside. It sounds like you want to advertise specials for the stores while people are in the mall... Well, if I download the app, wouldn't I want to sometimes view the specials when I'm at home? or on the way to the mall?
It seems to me that you're crippling your app from the start if you don't allow people to use it outside of your wifi network.
If your authentication is good enough, it shouldn't be a problem to launch your server-side stuff on a live web server somewhere and point your app at that.