How can i test tilt efftect? - IPhone Simulator - iphone

I am trying to write a game. That game uses tilt effect, but i don't know how to test it on Iphone Simulator 3.0.
I search it on internet, but the result is zero. How can i...?

Short answer: You can't, not directly. You have to use a real device.
Longer answer: You could subclass UIAccelerometer and do as you like. You could simulate input, or write a client and server pair that sends acceleration information from a real device to your app running in the simulator, or from your Macbook's accelerometer if you fancy waving your laptop around.

Try https://code.google.com/p/accelerometer-simulator/. It does the same thing as iSimulate -- it sends accelerometer events from the phone to your computer -- but it's free and open source.

There's an application in the AppStore called iSimulate which lets you feed an actual device's accelerometer inputs into the sim. You do need to have a device for testing.

ON a related note, you can also capture accelerometer data from safari running on your iphone/ipad
See this demo http://www.webdigi.co.uk/blog/2012/using-an-ios-device-to-control-a-game-on-your-browser/

Just saw this when asking a similar question - you can actually set the interface orientation now in the new xcode, so even though you can't 'tilt' it directly, you can make it to where it only supports landscape - then it will load the landscape view in the emulator! :D

From: http://developer.apple.com/library/ios/#documentation/IDEs/Conceptual/iOS_Simulator_Guide/InteractingwiththeiOSSimulator/InteractingwiththeiOSSimulator.html
Place the pointer where you want the rotation to occur.
Hold down the Option key.
Move the circles that represent finger touches to the start position.
Move the center of the pinch target by holding down the Shift key, moving the circles to the desired center position, and releasing the Shift key.
Hold down the mouse button, rotate the circles to the end position, and release the Option key.

Related

Check device input options (mouse and gyroscope)?

I'm working on a game that uses the gyroscope and accelerometer as input.
To test it on my PC I created an option to use the mouse as input, however I want to be able to know whether the device has a gyroscope and a mouse so I can change the controls accordingly. This would be extra useful to make my game multiplatform.
How is this possible in Unity3D?
SystemInfo.supportsGyroscope checks whether the device as gyro or not.
Input.mousePresent checks whether mouse is avialable or not.
To correct the other answer:
Input.gyro.enable is used to enable or disable the usage of gyro.
You can check Input.gyro.enabled to see if the gyroscope is enabled.

ios zxing with front or rear camera

Im using ZXing, is working fine on my new app, but i would like to integrate the option of front or rear camera,
so far the only reference to this i've found is on the google group
But is not very clear what they mean with that,
so any pointers on what i have to do to accomplish this?
thanks !
ZXWidgetController doesn't provide that functionality and it's not really set up to make it easy to change.
The code that needs to change is in - (void)initCapture. It calls [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]. This returns the default camera and you don't want the defalt.
You need code similar to that in - (ZXCaptureDevice*)device in ZXCapture.mm. That code won't work out of the box (it's designed to work with both AVFF and QTKit) but it's the same idea. Instead of using the default video input device, go through the devices and look at device position to find the device you want.
Be nice to port that code to the widget but that hasn't happened at this point.

What are the iphone's accelerometer values when it is thrown in the air (airborne)

I want to do something with an app that if you throw the iphone into the air, or you are airborne with it, then some pattern changes.
I thought it was 0, but lately, I've been getting some doubts.
Or, maybe, if there isn't a fixed accelerometer value when the iphone is airborne, what is the accelerometer values when the home button is on the bottom part of the iphone (like when you normally would hold it)?
Write a Logger App. Run it. Throw your phone into the air. Read logs when you catch it.
This is the link to the code that will show you Accelerometer values.
Just implement in your iPhone/iPod and throw the device in the air and you will get the X, Y and Z value.
there on you can perform the task you need,.
EDIT: My guess: The raw accelerometer values won't be 0 because you always have gravity effects in combination with rotation of the device in the air. You will rarely get a motion without spin and thus the rotation might influence even userAceleration values i.e. the acceleration delivered by core motion fusion algorithm.

Can I monitor the iPhone proximity sensor without turning off screen? Also, landscape

I've got the proximity sensor working so that I can trigger events when in proximity, but I'm trying to use it as a sort of dead man switch. The problem is that whenever in proximity, the screen turns off, which drastically reduces the usability of the app :P Also, the proximity sensor doesn't seem to activate when in landscape mode (I can't see the flashing light in my camera). Is there any way to get around these standard events and methods?
Your current UIDevice has a proximityState property on it. May be useful.

Using iphone accelerometer to count the number of spins when tossed in the air

I would like to have a program that build a program that uses the accelerometer to count the number of time an iphone spins (either on a table top or when tossed in the air ) any suggestions?
The iPhone 4 may be able to do this, as it has gyroscopes that are not affected by acceleration, but when you spin a device with an accelerometer the accelerometer will just report that it seems like there's a large acceleration pointing on a vector from the center of rotation straight out.
You throw your iPhone in the air?
Just a heads up if you're planning on putting this on the App Store - Apple rejected/removed an app that measured the speed an iPhone fell at while being dropped. The reason they gave was because it would encourage users to do things with their iPhone that would potentially damage it. Your app would likely befall the same fate.