Setting iPhone wallpaper (locked screen background) programmatically? - iphone

I have an app which could benefit from the user being able to choose to set an image as the wallpaper (the background image on the "slide to unlock" screen).
Is there a way for non-jailbreak third-party apps to do this? A search for "wallpaper" in the iPhone documentation returns nothing.

There is no way to do this with the current SDK, if you want to do it you should file a bug.

If you're writing a jailbreak application you can write to /var/mobile/Library/LockBackground.jpg and then kill the Springboard.

Related

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

PNG within an iPhone app

I have the following issue:
My iPhone app makes some kind of graphics.
How can I save these graphics or drawings made by the app as a png file on the device?
Would it then be possible to set such a png file to become the icon for the app from within the app itself? (Provided the size is right of course.)
Thanks for any possible tip.
No, you can't change the app's icon at runtime (like the Calendar app that comes with the iPhone does)
How do I change the default icon of iPhone application programmatically?
For saving PNG images on your device, look into UIImagePNGRepresentation which is part of the UIImage Class.
As for changing the app icon, this would only be possible if you are jailbroken and have the right package dependencies that allow the icons to refresh in SpringBoard on the fly.
Outside of being Jailbroken, changing the app icon would require an app update which would include the new icon.
I wouldn't think it's possible for the actual icon for the app to change, because it's set on the phone when the app is installed.

Animated Wallpaper Development for iPhones

I an interested in making animated wallpaper apps for the iPhone. This means that, once I click the app to open, it should not open up a view, and it should change the current wallpaper of the iPhone to the an animated wallpaper(which I have designed), while the App is running.
If I close the app, it should bring the iPhone back to the initial wallpaper.
How do I go about this ?
How can I modify changes to the wallpaper of the iPhone with my app.
How can I place my customized wallpaper in a way that the iPhone operates normally and you can scroll to other apps and stuff while the background wallpaper is animated ?
What tools are needed for that animation ?
If I understand you correctly, you want to create an application that swaps out the background wallpaper.
This can only be a jail broken app.
We do not have access to the springboard wallpaper on a normal device with the SDK. So this type of app can only be a jail broken app an a jail broken device and in a jail broken marketplace.
The methods you should implement are pretty simple. Would probably be an NSTimer that chooses randomly from an array of image names and sets the background wallpaper.
I do not know the immediate functions to use, and they are probably undocumented.
Background process app that is always running (like Mail).
In the function the timer calls, just make a UIView animation block that shifts the previous image where ever you want and shifts the new one into the view.
What I would suggest is get the functionality you want running in a project. Once that is all done, look into making it a jail broken app and running in the background (this is probably going to be the bulk of the work, and really really hard)
Currently you can not change a users wallpaper programatically, file a feature request with apple like many of us have :)...However you can do it on jailbroken phones...

How can I make a screenshot of iPhone desktop programmatically?

I need to make a screenshot of the iphone desktop and set it as background for my app, is it possible?
UIGetScreenImage should do what you want - check out this example.
But apparently, Apple (in its great wisdom) has banned its usage in apps for the App Store, and has removed it from iOS 7 arm64 and newer.
If you are looking to take a screenshot then you need to press the menu button and the lock button at the same time, as for setting it as the background of the app, just use the image which will automatically be placed in your camera roll.

Why does my iphone app does not zoom-in every time I launch the app in the application manager?

It's weird that my app does not zoom in when running in the application manager of the iphone like the other apps do. Do you think the problem is related to the simulator? Or have I done something wrong in the settings of the project?
If the background of your window is black, and you have no Default.png image in your bundle, then the zoom effect may be unnoticeable. It's even worse if you don't have a status bar.