Iphone application run in background without backgrounder(Cydia) - iphone

Is it possible to write application via cydia to run in background like appsyn? Work with jailbreak device.
Without Backgrounder(Cydia)
Or is it possible to hide icon form springboard and hide arrow(Corelocation)?
i want to run my app like run plist in background.
please help me
Thank(Advance)

Yes, it is possible. In fact, I originally wrote Backgrounder for exactly this purpose; to act as a model for others to use.
You must do two things:
Make certain that you app installs to /Applications/ (and not /var/mobile/Applications).
Create your own UIApplication subclass, and add the following method:
- (void)applicationSuspend {} // Do nothing
However, if you are targetting iOS 4.0 or newer, you should consider using one of Apple's provided multitasking methods.
Also, depending on what you are developing, it might be wiser to create a daemon (or daemon/client) instead.

Related

Creation of custom xib view size in Xcode

We are creating an application which uses one view multiple times inside another view.
I have accomplished this by manipulating the default xib view size to look like the one in the picture below and then importing multiple instances of it inside my main view:
Everything seems to work fine inside the simulator, I'm just scared apple will reject the application when submitting it to the app store.
Is this an acceptible way of accomplishing the task or would apple reject the application?
note, I havn't tested this on an actual iPhone, only in the simulator.
Regards
No apple is not going to reject your application. I always make custom views this way. And reuse them. So Don't worry about it. I have done this thing in lots of apps and all are on app store. You can check this link for apple rejection criteria if you have any doubts.
Reasons for rejecting iPhone application by Apple store Happy Coding!

iOS Unit testing universal application

I am trying to set up some unit tests on a universal application. The application behaves quite differently when loaded on ipad/iphone. For example there is a separate delegate for each, separate views and controllers as well.
How can I configure a particular test target or particular test files to be tested on iphone/ipad. For example, run TestsTarget1 on iPhone and TestTarget2 on iPad? Can something like this be set on a per-file basis? For example "TestIpadMaps.m" to be run on iPad while "TestIphoneMaps.m" to be run on iphone.
Edit: The reason why I ask is because I want to run tests on certain methods that make reference to the app delegate which is different depending on the device it is being tested on.
You could use an if statement to check if NS (or it could be UI as I'm on my iPad so I don't have reference)device is equal to iPhone and if it is run your test or GoTo your view.
Here is a video that will help
http://www.youtube.com/watch?v=meiv1ePUEnM

rewriting an iOS app to work on both iOS and Mac-- how to organize controller code?

I have an iOS app that I am rewriting to work on both Mac and iOS. I have my views working reasonably well, but everything is static at the moment.
What do I typically do with my view controller code? In the iOS-only app, it is typically a bunch of stuff that says things like "if the user touches here, do that."
I've found the hitTest: method. So I'm pretty sure I can write everything so it works. I guess my question is more organizational. Ideally, I would want to set things up so that the code that is currently in UIViewController subclasses would work on both platforms.
You won't be able to make the UIViewController code work on both platforms. The Mac doesn't have UIKit, and iPhone doesn't have AppKit.
What you really want to do at this point is have all of your networking, math and logic code in external classes. Normally subclasses of NSObject. Then, all you have to do is write code that calls these classes within your view controllers.
You're going to face one further challenge though - I don't think that you can have an app run on iPhone and Mac from one Bundle. When you compile your app, you normally compile to a specific processor. The Mac runs on Intel/PowerPC, and iPhone runs on Arm. You're going to have to fiddle with build targets etc. endlessly.
I would suggest maintaining two separate projects, and putting the aforementioned logic classes in a shared location and making sure that when you import them you don't choose the 'Copy to group destination folder' option. This way, any edits you make to the iPhone version of the code carries accross to the Mac version and vice-versa.
Happy coding,
Zane

How to create kiosk-mode iPhone app?

I'd like to run an app in the KIOSK mode, so that it
auto-starts after starting the device
re-starts after app crash/power loss/etc.
Any ideas how to do this on a [probably jailbroken?] iPhone?
The easiest method would be to create a mobilesubstrate extension that runs inside SpringBoard and throws up its own UIWindow.
Create a static __attribute__((constructor)) function and inside register for UIApplicationDidFinishLaunchingNotification. After receiving the notification, 99% of the standard iPhone SDK will work as-is.
It will have to be jailbroken because the standard OS won't give you that level of control.
Since you are already thinking jailbreak, perhaps look into launchd on the phone as whatever starts up Springboard could also probably be made to start up your app after.

How do I make iPhone SpringBoard show two or more icons for one application bundle?

It seems like Info.plist file has an ability to declare different roles for the same application bundle through the UIRoleInfo key. SpringBoard can recognize these roles after installing an app and may display separate icons for each application role.
For instance, iPhone shows MobileSlideShow.app as 2 different programs: Photos and Camera.
Unfortunately, there is no official Apple documentation about the subject at the moment. Would anybody advise how to organize the same behavior in a custom app?
This feature is going to be used in the Enterprise product for ad hoc distribution.
This isn't a supported feature, so if you do this you might have a hard time getting your app through the approval process. I wouldn't recommend using it.
Have you tried it to see if it works? If it doesn't work, you could create a second app that does nothing but launch the first one, with a custom URL scheme. The first app can recognize when it is being launched with that URL. This is not ideal as you will see the second app launch & quit (though it should be really fast).