Re: how to make ur application to run in background
It isn't possible to have background processes on the iPhone/iPod touch, since the system will only allow one application running at once.
There is a compromise though. Apple has announced a system for apps like IM apps that want to alert you to a new message. The iPhone will keep a constant IP connection to Apple, and the IM server will keep a constant connection to Apple. When a new message is sent, Apple will push it out to the phone, even though the IM app is not running. More details can be found here:
Re: how to make ur application to run in background
According to Apple that is not allowed. It may be possible in jailbroken applications but I rather doubt that will be a large number of phones after the AppStore opens. Apple is providing notification services which will provide what most applications need in place of background apps.
It is also a bad idea for several reasons including battery life and non-transparency to the user--the last thing I want is several apps running in the background that I am not aware of sucking battery life. It is also bad from a security view point, it would allow key loggers and other spying apps.
Re: how to make ur application to run in background
Quote:
Originally Posted by CaptainCode
It doesn't matter what kind of application you make, it can't be done.
Sorry for these basic questions, my experience is only with 1.1.4, not the SDK, but the statements that background apps are impossible are pretty hard to believe. Perhaps posters are just pleading the Apple party line, but have Apple really removed the fork/exec/setsid system calls from 2.0? I seriously doubt it.
Surely apps can (still) run in the background - the challenge is being able to connect with them again at a later date, but even that is well defined in the Unix world, where a new app collects the periodically recorded state of the background app from an agreed file, removes the file, and then kills the background app.
If Bucky's statement about sandboxed apps is true, could someone please give me a pointer to what, and how, is sandboxed? Thanks,
Re: how to make ur application to run in background
Unfortunately for those looking to make a daemon style app, Apple isn't allowing any apps to run in the background. Someone, somewhere, might figure out a way to do it with the Apple-provided SDK, but Apple won't let you distribute it through the App Store even if they do. I would show you the info from the iPhone Developer site, but it's under NDA and I don't want to lose my developer enrollement by doing something stupid.
Re: how to make ur application to run in background
Quote:
Originally Posted by myersn024
Unfortunately for those looking to make a daemon style app, Apple isn't allowing any apps to run in the background. Someone, somewhere, might figure out a way to do it with the Apple-provided SDK, but Apple won't let you distribute it through the App Store even if they do. I would show you the info from the iPhone Developer site, but it's under NDA and I don't want to lose my developer enrollement by doing something stupid.
That's OK, thanks, I can read the Developer site, too. So it's not that background apps are impossible (technically) but that Apple won't permit them in a App Store - relevant to the discussion, but very different interpretations of not possible.
Re: how to make ur application to run in background
Quote:
Originally Posted by CaptainCode
Not possible with the SDK as it is and be able to install them on the iPhones without hacking them.
Sorry, but I find that your response doesn't really provide any explanation. In what way is it impossible? Have the Unix system calls, that I highlighted earlier, somehow been disabled by the SDK?
Re: how to make ur application to run in background
They might be available but like I said, you can't distribute your app if you used this and Apple found out about it. Since your app has to be signed by an Apple provided certificate you can't just do it anyways and distribute your app to everyone. Unless you want it to just play around with then there's nothing wrong with trying. Just don't expect to be able to sell or distribute any application that goes against the TOS of the SDK and the AppStore.
I have a jailbroken iPhone so I can use it in Canada and indeed it is possible but I find it highly annoying that apps such as Fring by default don't quit or behave like all the other applications by quitting when you go to the home screen. And indeed it does drain your battery much faster than having it quit.
Re: how to make ur application to run in background
1st of all i wud like to thanx all of the respected members for their valuable suggestions...
i am also trying from my side as well...
i wud like to add some thing as...
Quote:
Originally Posted by Bucky
I still don't think that's possible, since unlike Apple's iPhone apps, the 3rd Party Apps are sandboxed, so cannot run a background process.
I don't know whether its possible to call the iPod app, like you can call Safari, Youtube, Mail, etc. I wouldn't get your hopes up though
as we can call safari, youtube or mail in our app... is it possible to use some of the facilities of these apps? like in my case in my media player can i use some features or facilities of iPod or iTunes??? not all some of them??? or can we customize them as well???
Re: how to make ur application to run in background
dear respected members... i am still looking forward for your kind response...
in regards of
Quote:
as we can call safari, youtube or mail in our app... is it possible to use some of the facilities of these apps? like in my case in my media player can i use some features or facilities of iPod or iTunes??? not all some of them??? or can we customize them as well???
dear respected members... i am still looking forward for your kind response...
in regards of background process...
Quote:
Quote:
as we can call safari, youtube or mail in our app... is it possible to use some of the facilities of these apps? like in my case in my media player can i use some features or facilities of iPod or iTunes??? not all some of them??? or can we customize them as well???
Sorry, but I find that your response doesn't really provide any explanation. In what way is it impossible? Have the Unix system calls, that I highlighted earlier, somehow been disabled by the SDK?
Let's see if I can provide a detailed enough explanation for you:
1. You cannot access Unix system calls directly in the official SDK.
2. You cannot access the background process APIs in the official SDK.
3. If you were to somehow find a way around the above two limitations, Apple would catch it in the review process (which I'm sure scans for illegal API calls) and reject your application (and possibly your developer status).
Let's see if I can provide a detailed enough explanation for you:
1. You cannot access Unix system calls directly in the official SDK.
2. You cannot access the background process APIs in the official SDK.
3. If you were to somehow find a way around the above two limitations, Apple would catch it in the review process (which I'm sure scans for illegal API calls) and reject your application (and possibly your developer status).
Thanks very much for the clarification; I do appreciate.
When you say 'cannot', do you mean 'within the terms of the developer agreement'?
If more than that, do you have any technical detail on how Apple have restricted access to Unix systems calls in the SDK, when the SDK itself is heavily dependent on them?
(bring on the jailbreaking so that such synthetic constraints may receive their due respect...)
It's fairly obvious that background processing does occur (since Apple uses it for it's own apps), but in order for an app to truly run in the background it would need to be able to listen for events coming off the system queues, which Apple has not provided API's for.
The only thing that they will be providing is a server based notification service which for some apps might be OK, but NOT a substitute for real background stuff.
Let's say you built an RSS reader, and that reader could periodically check sources for updates. In a background scenario, the client could do that while running in the background, much the same way as the e-mail service checks for new E-mail. But what Apple recommends is to use their notification service (which would be a server application), to push a notification to the device. That notification could then alert the user by either modifying the home screen icon, or issuing an audible alert(or both). In terms of network utilization, the notification method is more efficient, but requires an elaborate server based process to manage the notifications.
I'd hope that at some point Apple will see the error of their ways, and open the API's to include a method to add listeners to the system queue, and support real background processing. Other OS's allow it, and so should they.
It's fairly obvious that background processing does occur (since Apple uses it for it's own apps), but in order for an app to truly run in the background it would need to be able to listen for events coming off the system queues, which Apple has not provided API's for.
All true, but as the iPhone is a Unix-based device, your definition of 'background' is but one suitable definition. For example, an application could disassociate itself (or a child process) from the screen, and periodically just read the current WiFi signal strength or GPS information, logging these to a 'disk' file. Another interactive process could, later, find the process, kill it, and make use of the logged information. Yes, it would consume a small amount of battery, but if the logging cycle to long enough, or the activity quick enough, then that's a price I'm willing to pay.
Thanks very much for the clarification; I do appreciate.
When you say 'cannot', do you mean 'within the terms of the developer agreement'?
If more than that, do you have any technical detail on how Apple have restricted access to Unix systems calls in the SDK, when the SDK itself is heavily dependent on them?
I mean within the limitations of the SDK (and presumably within the terms of the developer agreement as well, since you could probably hack the SDK to allow access to the necessary APIs). As for technical detail, I think it should be fairly apparent how Apple would restrict access but you can always check out the myriad of documentation at iPhone Dev Center for further clarification. (Which you should be reading anyway if you're planning on doing any kind of development for the iPhone.)
For the love of Zues, its 2008 and I must assume you are typing this on a full blown computer, drop the lame-assed sms syntax when typing in posts.
They keyboard is big enough, there is enough physical memory and disk space - you don't need to save time or space by dropping vowels and misspelling words.
I cannot speak for others, but to me, this does not make you look 'cool' or 'hip' - in makes you look borderline retarded and not very serious about development. I have a lot of programming experience in all sorts of areas (over 10 years and 5 languages) and I will not provide help to morons that post like that.
Now, call me a curmudgeon if you like, I don't particularly care - just know that sloppy illegible nonsense writing in posts will probably not get the quality of the answer you want.