Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 08-29-2008, 06:16 AM   #1 (permalink)
New Member
 
Join Date: Jul 2008
Posts: 38
Default development of camera, GPS, and accelerometer

I wonder how I can develop an app using camera, GPS, or accelerometer.
Because iPhone simulator does not have actual camera, GPS and accelerometer, how did you guys usually see if your program works or not??

In the case of camera, can we use built-in camera when using simulator??

Thanks,
hogeo is offline   Reply With Quote
Old 08-29-2008, 08:00 AM   #2 (permalink)
New Member
 
Join Date: Jul 2008
Posts: 75
Default

camera pretty much acts just like your photo library if you load up a UIImagePickerController. The only difference is you hit the button to take the picture and then resize/crop it if needed.

It gets passed back to the same delegates to handle the image.
__________________
Iphone Noob iPhone Development Blog. Learn to develop for the iPhone SDK with me
hijinks is offline   Reply With Quote
Old 08-29-2008, 04:04 PM   #3 (permalink)
ZipZest.com
 
Join Date: Aug 2008
Posts: 43
Default

As hijinks said with the simulator use the photo library in the camera picker. Then some code like the following to automatically use the camera when the app is on the iphone (code could be made shorter - tidy up as need be):

Code:
if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {

	picker = [[UIImagePickerController alloc] init];
	picker.sourceType = UIImagePickerControllerSourceTypeCamera;

	picker.delegate = self;
	picker.allowsImageEditing = NO;
}
else if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) {

	picker = [[UIImagePickerController alloc] init];
	picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;

	picker.delegate = self;
	picker.allowsImageEditing = NO;
}
else {
	picker = nil;

	UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"No Camera Found"
	message:@"You need an iPhone with a camera to use this application."
	delegate:self
	cancelButtonTitle:@"Cancel"
	otherButtonTitles:@"Ok", nil];

	[alertView show];
	[alertView release];
}
mikeb is offline   Reply With Quote
Old 01-06-2010, 04:43 AM   #4 (permalink)
Registered Member
 
Join Date: Dec 2009
Posts: 12
Default

************************************************** *********


hi .....

can i create a new folder in PHOTOS folder in IPhone Simulator using my application code when first time my application is launched ????....

what i want is.... when i click on Take Picture button, then that picture should store in Folder that is created by me in the PHOTOS Folder ....can i do it ??......if yes please tell me how...........


thanx a lot in advance....
malik_vijay158 is offline   Reply With Quote
Reply

Bookmarks

Tags
accelerometer, camera, gps, simulator

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 266
17 members and 249 guests
ADY, Alsahir, dacapo, Dani77, Desert Diva, Duncan C, F_Bryant, Grinarn, HemiMG, jansan, linkmx, M@realobjects, macquitzon216, prchn4christ, smethorst, spiderguy84
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,882
Threads: 89,228
Posts: 380,761
Top Poster: BrianSlick (7,129)
Welcome to our newest member, jansan
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:47 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0