monotouch iphone programmatically go to phone home screen - iphone

I searched a lot and didn't find how to programmatically bring application to background so phone's home screen is shown. I don't want to terminate app, but just to programmatically make press on HOME button. Is there any way to do it?

No, unfortunately not. There is no public API that allows you to send a user back to the homescreen.
As shown in these questions:
iPhone - Sending the app to the background
Send App to Background process
Sending Application to background on iphone
Programmatically sending an iOS app to background
Brad Larson provides a detailed explanation to the answer of this question:
Suspend the application

Unfortunately, there is no background mode in iOS where the app can still run things while out of focus. Apple has designed the system to "pause" the application so state is preserved, but be careful the app can be terminated at any time.

You can do this by calling a private API but beware as said above Apple does not allow this on AppStore apps.
var x = UIApplication.SharedApplication;
x.PerformSelector (sel: new MonoTouch.ObjCRuntime.Selector ("suspend"), obj: x, delay: 5);

Related

How does GuitarToolkit show a persistent active banner when in background?

I have GuitarToolkit on my iPhone4S (iOS 5.01 - NOT jailbroken) It has a metronome feature which continues playing in the background, and also adds a red banner overlay (see screenshots) which persists on the home/lock screen and also when other apps are running. The banner is animating (background colour pulses) and it is also 'active' in that pressing it will return you to the GuitarToolkit app.
I know about the background audio APIs for the sound, but how does it do this banner? My first thought was local notifications, but nothing appears in notification center, and GuitarToolkit is not listed under Notifications in Settings.
My iPhone is not jailbroken and GuitarToolkit is available in the App Store, so what APIs is it using to achieve this?
Having an active AVAudioQueue creates that banner.
The banner appears because it’s got an open audio recording session—you’ll notice that the system Voice Memos app does the same thing, as does Shazam for a moment before it enters the background and Skype when you’re on a call with the app in the background. I’m not sure of the specific API, but that’s generally what’s going on.

Is it possible to pause my flash app on iphone by pressing home button?

I'm quite new to Flash. So here's my problem: I've created my app and it works great. But when I press home button on my iphone, my app minimizes and when I open it from multitasking apps, it simply restarts. Is it possible to freeze or pause the game instead of stop? Thanks!
By default the application should be eligible for the 'freeze-drying' iOS4+ functionality that resumes an app from the last place it left off. That may require a setting to be adjusted in your app descriptor (UIApplicationExitsOnSuspend should be false).
If you simply need to save data when the application is quitting, you can listen for Event.EXITING on the NativeApplication:
NativeApplication.nativeApplication.addEventListener(Event.EXITING, onExit);

iphone lock button and the running app

this may be a simple one, but I don't know the answer.....
For testing whether my location-based app receives updates in background, I usually run the app and then press the Home button to put the app in background. However, I am curious whether pressing the Lock button (at the top) will put the app in background or not.
Regards.
Yes. Hitting the lock button does background the application. However when you unlock it, the application is then brought back to the foreground. Should be able to test this within your App Delegate and simple log statements.

Can you get the system answer call button in Cocoa Touch?

When you get a call on iPhone a system alert it is shown. There is a nice answer call button, can I use somehow this button on my app or i have to design it by myself?
I suppose this are system resources and could be available in the API.
It is not available for public use in the iOS SDK as of iOS 5
I don't really know how to fetch tat button from an iPhone or its simulator but why don't you customize your own button using this site http://dabuttonfactory.com/ ? It helped me sometimes when I needed buttons for my apps as well.

Play splash movie every time app launch (with multi-task support)

the app I'm working on supports iOS multi-task feature by default, and I want to stick with this.
Upon app launch, a splash movie clip is played (code is in AppDelegate), after user hits the home button, and re-launches the app, I want to the same splash movie be played before showing the last view where use was.
I know by switching off the multi-task support, I can achieve this, but in the meanwhile, I'm losing the multi-task support feature, and I need to write code to save/resume user states. So, is there any workaround for this? thanks!
You could try the app delegate's applicationDidBecomeActive: method but quite frankly I'd consider this to be user hostile behaviour. Who wants to see a movie every time they switch between apps? The point of multitasking on the iPhone is to quickly change between apps and this violates that.