iMonk Release 1
Monkey Programming Forums/iOS/iMonk Release 1
| ||
| Anybody knows how to upload to google code? ^^ @QCat: Virtual Keyboard isn't my priority atm because you can simple work around by doing your own keyboard with images. But i have it in my mind! Here are some functions im currently working on, not finished yet but maybe someone can help to finish it.
#import <CoreLocation/CoreLocation.h>
#import <Foundation/Foundation.h>
#import <GameKit/GameKit.h>
#import "GCHelper.h"
String GetGPSData()
{
CoreLocationController *CLController;
CLLocationManager *locMgr;
CLLocation *location;
self = [super init];
if(self != nil) {
self.locMgr = [[[CLLocationManager alloc] init] autorelease]; // Create new instance of locMgr
self.locMgr.delegate = self; // Set the delegate as self.
}
CLController = [[CoreLocationController alloc] init];
CLController.delegate = self;
[CLController.locMgr startUpdatingLocation];
NSString *stringResponse = [location description];
[self.locMgr release];
[CLController release];
[super dealloc];
return String(stringResponse);
}
String GetCLSpeed (CLLocation *location) {
NSString *speed = [NSString stringWithFormat:@"SPEED: %f", [location speed]];
return String(speed)
}
String GetCLLatitude (CLLocation *location) {
NSString *latitude = [NSString stringWithFormat:@"LATITUDE: %f", location.coordinate.latitude];
return String(latitude)
}
String GetCLLongitude (CLLocation *location) {
NSString *longitude = [NSString stringWithFormat:@"LONGITUDE: %f", location.coordinate.longitude];
return String(longitude)
}
String GetCLAltitude (CLLocation *location) {
NSString *altitude = [NSString stringWithFormat:@"ALTITUDE: %f", [location altitude]];
return String(altitude)
}
void GameCenterAuthenticateLocalUser {
if (!isgameCenterAvailable) return;
[[GCHelper sharedInstance] authenticateLocalUser]
NSLog(@"Authenticating local user...");
if ([GKLocalPlayer localPlayer].authenticated == NO) {
[[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:nil];
} else {
NSLog(@"Already authenticated!");
}
}
bool isGameCenterAvailable() {
// check for presence of GKLocalPlayer API
Class gcClass = (NSClassFromString(@"GKLocalPlayer"));
// check if the device is running iOS 4.1 or later
NSString *reqSysVer = @"4.1";
NSString *currSysVer = [[UIDevice currentDevice] systemVersion];
BOOL osVersionSupported = ([currSysVer compare:reqSysVer
options:NSNumericSearch] != NSOrderedAscending);
return (gcClass && osVersionSupported); }
}
|







