This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (IBAction)tapPostPOI:(id)sender { | |
UIImage *image = imageView.image; | |
NSData *data = UIImagePNGRepresentation(image); | |
//Just pass the call over to our generic serviceCaller | |
[serviceCaller postToUrl:sasURL | |
withBody:data andPostType:@"PUT" andContentType:@"image/jpeg" withCallback:^(NSString *response) { | |
//This is the callback code that the ServiceCaller will call upon success | |
labelSasUrl.text = response; | |
if ([response isEqualToString:@""]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface Constants : NSObject | |
#define kBgQueue dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) | |
extern NSString *kGetPOIUrl; | |
extern NSString *kGetSASUrl; | |
extern NSString *kAddPOIUrl; | |
extern NSString *kContainerName; | |
@end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)fetchedData:(NSData *)responseData { | |
NSError* error; | |
//Build a JSON object from the response Data | |
NSArray* json = [NSJSONSerialization | |
JSONObjectWithData:responseData //1 | |
options:kNilOptions | |
error:&error]; | |
//Go through each POI in the JSON data and pull out the important fields |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
@interface Constants : NSObject | |
#define kBgQueue dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) | |
extern NSString *kGetPOIUrl; | |
@end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** This method will create a test container for use in our client side code **/ | |
/** Code from http://blogs.msdn.com/b/brian_swan/archive/2010/07/08/accessing-windows-azure-blob-storage-from-php.aspx **/ | |
/** Note that we're defaulting the container name to 'test' **/ | |
$app->match('/api/Location/AddTestContainer', function () use ($app){ | |
$storageClient = new Microsoft_WindowsAzure_Storage_Blob('blob.core.windows.net', STORAGE_ACCOUNT_NAME, STORAGE_ACCOUNT_KEY); | |
try { | |
if($storageClient->isValidContainerName('test')) { | |
if(!$storageClient->containerExists('test')) { | |
$result = $storageClient->createContainer('test'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Adds a new SLUG to the DB (and file) */ | |
public function addPOI($description, $type, $url, $latitude, $longitude, $id) { | |
//Add to DB | |
$con = mysql_connect($this->db_server,$this->db_user,$this->db_password); | |
if (!$con) | |
{ | |
die('Could not connect: ' . mysql_error()); | |
} | |
mysql_select_db($this->db_name, $con); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface ViewController : UIViewController | |
@property (weak, nonatomic) IBOutlet UILabel *lblInfo; | |
@property (weak, nonatomic) IBOutlet UITextField *txtText; | |
- (IBAction)tappedClickMe:(id)sender; | |
@end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Using Pointers | |
NSDictionary *myDictionary = ... | |
//Not using Pointers | |
NSDictionary myDictionary = ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.msdpe.mymobileservice" | |
android:versionCode="1" | |
android:versionName="1.0" > | |
<uses-sdk | |
android:minSdkVersion="8" | |
android:targetSdkVersion="15" /> | |
<uses-permission android:name="android.permission.INTERNET" /> | |
<application | |
android:icon="@drawable/ic_launcher" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Constants { | |
public static final String kGetTodosUrl = "https://yoursubdomain.azure-mobile.net/tables/TodoItem?$filter=(complete%20eq%20false)"; | |
public static final String kAddTodoUrl = "https://yoursubdomain.azure-mobile.net/tables/TodoItem"; | |
public static final String kUpdateTodoUrl = "https://yoursubdomain.azure-mobile.net/tables/TodoItem/"; | |
public static final String kMobileServiceAppId = "YourAppKey"; | |
} |