Animation/Video as launch images ios - iphone

Does anyone know if it's possible to show a video or an animation instead of a regular launch image in ios? The app's like D&G and Mango did this but I can't seem to find how. Is this maybe not an actual launch images, but a video which in triggered in the didfinishlauncingwithoptions.
Thnx!

Wel after the app hit the - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions you can setup an animation.
There is no way to do this before this point.
The os just looks for the Default.png in the bundle and displays it als long as your app is starting up. (read not returned from the above mentions method).

Related

Brightness bug in IOS

In my application at some parts I am changing brightness of the screen, and turning back to default value on some pages but if the user presses home button and exits from my application, when the brightness of the screen was changed I can't return the screen brightness back to its value.
I put code to return brightness to default on these delegate calls but it also didn't work
- (void)applicationDidEnterBackground:(UIApplication *)application
- (void)applicationWillEnterForeground:(UIApplication *)application
- (void)applicationWillResignActive:(UIApplication *)application
- (void)applicationDidBecomeActive:(UIApplication *)application
In some sites I read it is a bug of IOS, actually not bug but it doesn't give you permission to change the brightness: OS takes the control of it after home button is pressed.
But passbook app can do that so does anyone know is there a solution for this or passbook can do that because it is written by apple?
If the issue is indeed that the brightness cannot be changed from the application delegate methods (and I'm not saying that that is the problem; I'm not sure), you could instead try changing it from view[Will/Did]Disappear on the relevant UIViewController.

UIWebView showing black screen while lock the iPad device

Our app is based on the UIWebView. I have got fully black screen When i locked the iPad device while the PDF document is loading in the UIWebview. Please let me know that how to resolve this issue?
in your
- (void)applicationWillResignActive:(UIApplication *)application
you need to add some code to either reload the PDF if it's currently showing the PDF, or pause the loading.

How to handle home button - iPhone/iPod

I am developing a game for the iPhone. I do not actually have an iPhone, so I am testing my game on an iPod device (version 4.2.1). When I press the home button the game starts from level one. I find this odd, since in the simulator, after pressing the home button, the game starts from the same state where I stopped. I am unsure as to why the behavior is different on the iPod, maybe I need to handle the AppDelegate method differently (is it not handled automatically depending upon the device?)
How can I handle this issue?
It appears that the device you are testing your app on does not support multi tasking.
The older iPod touches and iPhones do not support multi tasking an close the app rather than suspending them.
All device that can run iOS 4.3 or higher will support backgrounding. Devices that can't update above 4.2.1 will not support backgrounding and app will be closed if you press the home button.
You will need to save the game state in the apps delegate applicationWillTerminate:
- (void)applicationWillTerminate:(UIApplication *)application {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
Save the current game state here and read them in - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

Iphone launch image disappear very fast

The launch image appear and disappear very fast in the iPhone.
How can I control this time? How much seconds is the default?
Thanks
You can use a sleep(time in seconds) function in the application:didFinishLaunchingWithOptions: to explicitly increase some time by yourself.
Eg :
sleep(3);
Will extend the time to 3 more seconds.
Note : As rmaddy said, make user stare at splash screen for a long time is not a good practice. But you can use this in customer's demand.
Happy coding. :)
There's no default — it stays up until your program has been loaded and returned from application:didFinishLaunchingWithOptions:.
If you want to keep the image up under programmatic control then you'll need to place it on screen manually as the first thing the program displays, then dismiss it through the usual channels. This would be relatively easy on a pre-5 iPhone (just put up a big UIImageView with Default.png in it) but as of the iPhone 5 and with the iPad you're going to have to make some sort of decisions about which default screen to show.
You can also try to add a sleep time in your didFinishLaunchingWithOptions method as below:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[NSThread sleepForTimeInterval:3.0f]; //add 3 seconds longer.
//other code....
}

Awake from sleep event on the iPhone?

Is there any way to detect if the iPhone wakes up from sleep while you're app is running? Eg: your app is running, the user locks the screen (or the screen auto locks) and some time later the user unlocks the screen and up pops your app. Is there some way to get an event at that point or detect it somehow?
I've tried searching the Google and this forum, but I can't seem to find anything about it.
See applicationDidBecomeActive: on UIApplicationDelegate.
Stick these in you AppDelegate.m file:
-(void) applicationWillResignActive:(UIApplication *)application {
NSLog(#"Asleep");
}
-(void) applicationDidBecomeActive:(UIApplication *)application {
NSLog(#"Awake");
}
#Kevin - Nothing wrong with your answer - thanks by the way. Just thought I'd save the next person a Google search.