running Video Recorder in background in iOS 4 iphone? - iphone

i am developing an application which requires recording a video in the background while the user is listening to music player in the application?? is it possible to run video recorder of iphone in the background mode automatically without prompting the user to press the record button??

No, that is not possible. Apple provides very few APIs for background services only, such as location services and audio playback. Recording video is not amongst the approved tasks.

Have a look at the new AV Foundation framework in iOS 4.0, this framework provides (low-level) access to capturing video from the camera(s).
The main class you'll need to uses is AVCaptureSession and you'll have set the output to either to AVCaptureMovieFileOutputor AVCaptureVideoDataOutput.
More info: AV Foundation Programming Guide

I haven't been able to find a background recorder ios 4 yet, although there are a few close possibilities:
1. turn the screen black with minimum brightness which effectively shows nothing if there's enough light out
2. turn off your screen with screendimmer, it will turn back on if you touch it
3. get Camcorder which has a "secret" recording option which fakes the unlock screen while it records, when you swipe it to unlock it goes back to camera mode.
As far as I understand it's not possible to record video on background due to ios restrictions

Get the 'NO Video' app. http://itunes.apple.com/my/app/no-video/id430204140?mt=8
Download iPhone Explorer. http://www.macroplant.com/iphoneexplorer/
With the 'NO Video' app installed, connect your iPhone to your computer with the USB port, and launch iPhone Explorer.
Go to Apps/NO Video/NO Video.app/images and copy 1.jpg to your desktop.
With an image-editing software such as Photoshop, change the 1.jpg to a plain black image without changing the size and save it.
Now copy the plain black image back to the Apps/NO Video/NO Video.app/images folder and replace the 1.jpg in the folder.
Restart your iPhone.
Launch the 'NO Video' app, click the red icon at the bottom to start recording, then flick to the left to reveal a plain black image while still recording video.

Related

How to put iPhone's screen onto mac in Xcode

I watched a tutorial, what that guy did on his iPhone, appeared in Xcode simultaneously, and just like in a simulator. How to do that? THX.
Open QuickTime Player,
File>New Movie Recording
Besides Record button(on the Quick Time Player), there is down arrow.
Click on down arrow and select iPhone
There are several possibilities, depending on what exactly you saw in the tutorial.
Live video
If the video was live, there are two things he could have been doing:
Airserver, etc. (blue bar)
He could have been using an AirPlay Mirroring server app to use Airplay Mirroring on the iPhone to show his screen directly onto the Mac's screen. This is the most probable method.
Simulator (no blue bar)
He could have actually been using the simulator, unless he specifically said he was using a device. There are apps you can use to make your mouse look like a finger on the simulator's display. Slightly unlikely.
Still pictures
This is the more unlikely version of the two, and would mean that all you could see was individual still pictures of the app running on the device.
In the Xcode organizer, you can go to the screenshots tab for a device and take a screenshot of the current display of the device. Highly unlikely.

Add image on lock screen in iOS app, when app is running in background

There are many question on site like
Programatically changing the iOS lock-screen ,
How to set lock screen , wallpaper and Ringtone programmatically in iPhone?
All say that apple will reject if we modify the lock-Screen image.
But I seen it in many apps.
Example Saavn is in AppStore.
In this if a song is playing and device is locked,
It shows the image of the current album on the lock screen.
Please share if anybody know how it can be done.
Thanks.
Music apps can change the lock screen wallpaper because iOS automatically displays the album artwork for the song/podcast/etc that's playing (see MPMusicPlayerController docs). As far as I know, it's not an API that's publicly available to developers.
The "podcaster" app (3rd party not apple) displays an image of the currently playing podcast. Podcast images are stored in the RSS feed and not in each mp3 so the app is dynamically telling the os which image goes with with mp3. Of course you can play "silence" out of the speaker but I don't think this is a clean solution

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.

How to create high-resolution iphone launch image?

As per the Apple iPhone Human Interface Guidelines I have created a Default.png image which is displayed while waiting for the application to load.
I created the image using the xcode organizer 'capture screenshot' feature.
I am now preparing my application for the iphone 4 high resolution screen and am wondering how to create the high resolution version of Default.png.
Is there a way to generate it from a screen shot like the standard Default.png image?
The easiest way I found is to use the special "Copy Screen" menu option in Simulator.
While the Simulator is running, hold the control key. The Edit menu will change from "Copy" to "Copy Screen". You now do a Command-V in Preview or Photoshop since the screen was saved to your clipboard buffer. Then save out the file as png.
High resolution Launch Images just need the #2x designation. You can capture them as a screen shot when running on iPhone 4, device or simulator.
It appears there are two options to create a high resolution (980x640) launch image from a screen shot of your application:
Using an iPhone 4 you can either use xcode to capture the image via the organizer window or by taking a screen shot on the device (using the lock and home buttons). I have not been able to test this as I do not have access to an iPhone 4
Using the iPhone Simulator you can emulate the iPhone 4 by going to Hardware -> Device -> iPhone 4 and capture a screen shot. In order to capture the screen shot you can use the built in os x screen shot functionality (cmd-shift-4). Alternatively there is a free tool called iPhone-Simulator Cropper which does a good job.
In recent versions of the iOS Simulator just use File -> Save Screenshot.
If you need to edit the screenshot at all (like rotate 90 degrees for landscape-only apps) using Preview's Tools -> Rotate Right is easy. If you edit the screenshot in Preview, be sure to take #ville-laurikari's advice and also use Tools -> Assign Profile... -> Color LCD before saving to make sure your colors look right.

Overriding iPhone shutter sound through SDK

In my iPhone app, I am using the UIImagePickerController with source type UIImagePickerControllerSourceTypeCamera. When the user takes a picture, the phone plays the familiar camera shutter sound. How can I replace this with my own custom sound? I know it's possible because I've seen other apps from the App Store do it (e.g. Red Laser).
I am quite certain it's not possible. AFAIK, Red Laser doesn't actually take a "normal" picture but uses UIGetScreenImage() (undocumented but nevertheless allowed for App Store apps) to make a screenshot of the live video feed. Since the OS does not play sound on this occasion, they are free to play their own sound.
Edit for clarification: As of OS 3.1, you are free to substitute the standard camera interface with your own controls. So you could place your own shutter button on the screen and play your own sound when the user taps it, but AFAIK there is now way to get rid of the OS's standard shutter sound.
AFAIK the standard camera shutter sound cannot be changed via SDK.
This answer supports that. You can replace your own sound by switching sound files, but not in an app.
Some answers such as this one suggest using AVCapture, but this method takes video screenshots, which reduces the image quality. I
t appears that you can't change the shutter sound because you could make it a silent sound, and capturing images covertly is against the App Store policy. See this answer.
TLDR:
The only way to change the shutter sound is to use a video screen grab.