How to get screenshot of home screen before app get launched - iphone

I have an iOS app and I need to get the home page screenshot before app launching. can I do that?

No. You can't fire events before the app launches, and even if you could, there'd be no way to get a screenshot of the springboard since there's no way to get its graphics context.

Sorry: to get a screenshot of the home screen on iPad, just press home button + power button, simoultaneously. Or I misunderstood the question ?

Related

Going back from Calendar to my app

Im my app, I have this code at a given time:
UIApplication.sharedApplication().openURL(NSURL(string: "calshow://")!)
which takes you to the calendar of the device. How could I get back to the scene where that line is executed?
Thank you.
EDIT:
Pressing home (option+shift+h, since the frame is not shown in my iOS Simulator) takes you to home, not the app, as it should be.
A quote from this:
Unlike other platforms such as Android, iPhone does not create a stack of actions (back stacking on Android). What this means is that if you do decide to launch another application, your application will not resume when the user exits from the application you opened.
If user want to get back to your app, they should press home (option+shift+H) twice, and select the your application from the list.
iOS9 introduced a new "Back-To-App" button at top-left corner, which allow you get back to your application. You should see this button after the calendar is showed from your app.

IPhone app shows previous state when opening

I have very weird problem. My app works cool on simulator but when installed on iphone it shows strange behavior
Suppose i was at settings page then I closed the app using home button. And then I start the app again after quite a while and I will always first get the settings page for one second and then the main loading screen. This happens for every other page even its not the settings ViewController
What is wrong?
Best Regards
Umar
Standard behavior, UI restoration. Your iOS apps picks up execution right where you left.
This means: if the app is pushed to background, a screenshot is taken. Coming back to the app, this screenshot will be shown and meanwhile your UI gets prepared.
If you have code in your app in applicationDidBecomeActive: or applicationWillEnterForeground: (see here: http://developer.apple.com/library/ios/#documentation/uikit/reference/UIApplicationDelegate_Protocol/Reference/Reference.html) and that will immediately reconfigure the UI, you get the behavior described.
You can turn OFF UI restoration and have your app really quit instead of pushing it to background by changing a key in the info.plist: UIApplicationExitsOnSuspend

iphone ios application home button press/applicationDidEnterBackground crash

hallo, i am newbie in developing iphne/ios application and i have
encountered some problem
generrraly my app (which is iphone camera image processing app) has no
visible errors at today stage except the one
when i press the home button to send my app off screen (putting to the
background), and then press the app icon to 'wake it up' again
it crashes
what would it be...? what the reason of it would be?
what is done to my app (seen from the view of programmer
- i mean internal game state) by this home buton operation?
- what i should take care of before "applicationDidEnterBackground"
eventually?
thanx for answer
Is this happening when you are running it from Xcode? Xcode does not like it if you hit the home button and start it again from within the device/simulator. Is it crashing if you launch it from the device (or simulator) without Xcode running? If not, then there probably isn't a problem.

IPhone: Why does my app resume and not restart when I relaunch it on device?

I don't know if this is an iOS4 thing or something, but basically say I have a few screens in my app. Now, when I hit the home button and relaunch my app it launches the app on the screen where I left off. It's almost like it's not restarting my app, but resumes it. I don't want it to do that. (I'd like it to show my splash screen main menu, etc. )
Does anyone know how to resolve this? thanks
In iOS 4, apps are suspended (not terminated) when the home button is pressed. When you "relaunch" the app, it is simply moved to the foreground. If you want your app to terminate when the user presses the home button, set the value of UIApplicationExitsOnSuspend to YES in your app's Info.plist file. If you do this, when the user taps the home button the applicationWillTerminate: method of your app delegate will be called and then your application will terminate.
I think this should help you. Basically what you need to do is disable the multi-tasking features of iOS4.
http://www.iphonedevsdk.com/forum/iphone-sdk-development/60989-disable-multi-tasking-ios4-application.html
That's exactly the multi-tasking you asked about yesterday working behind the scenes. You need to opt-out if you want that behavior. See answers to your previous question here. Have you read the answers there???

iPhone Mobile App (safari): which javascript events like onblur, onfocus or onbeforeunload are available?

So I just made my web-application "iPhone Friendly". So you can add it to your home screen and it has an icon, no chroming, etc etc.
The problem is that I want to display a custom splash-screen every time it is opened from the iPhone home screen. Right now it just shows the last screen viewed while it basically runs a refresh.
I have tried attaching events to window.onfocus, window.onblur, window.onbeforeunload, and NONE of them seem to work right when the app is being run in "mobile-app" mode.
Am I being dumb? Er.... don't answer that. Does anyone know what is wrong?
Unfortunately, with the restrictions Apple imposes, this is impossible.
My recommendation is to create a App Store application with a full-screen WebView. Then, you can use a default.png file and a ImageView for your splash screen. Also, you get a ton more visibility on the App Store. (Also, if you go this route, check out PhoneGap - http://phonegap.com/).
Update!! In the iPhone 3.0 update, mobile safari now supports the ability to specify an image to be used on startup:
Remember this only works with iPhones that are running 3.0+
The loading screen you are talking about is the loading screen for an APPLICATION, not a webpage, i.e its the loading screen for Safari. This has nothing to do with "the restrictions Apple imposes", just with the fact that because your web app still runs in the browser, the browser needs to load first. Like was also said, if you want to get around this you need to build your own app, in which you can specify the splash screen.
Are you using this?
<meta name="apple-mobile-web-app-capable" content="yes" />
If yes, it should refresh every time when you exit the web app and enter again. It will NOT show the last screen viewed. Hence you can show your splash-screen every time when it is opened. In another words, you should show a full screen div / image every time when you load the page.