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
Context myContext = getApplicationContext().createPackageContext | |
("com.cr.sharedprefexampleone", Context.MODE_WORLD_WRITEABLE); | |
SharedPreferences testPrefs = myContext.getSharedPreferences | |
("sharedprefone", Context.MODE_WORLD_READABLE); | |
String prefString = testPrefs.getString("time", "Couldn't find"); |
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 AppDelegate : UIResponder <UIApplicationDelegate> | |
@property (strong, nonatomic) UIWindow *window; | |
@property (strong, nonatomic) NSArray *todos; | |
@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
#pragma NSUrlConnectionDelegate Methods | |
-(void)connection:(NSConnection*)conn didReceiveResponse:(NSURLResponse *)response { | |
if (receivedData == NULL) { | |
receivedData = [[NSMutableData alloc] init]; | |
} | |
[receivedData setLength:0]; | |
httpResponse = (NSHTTPURLResponse*)response; | |
NSLog(@"Code: %i", [httpResponse statusCode]); | |
NSLog(@"didReceiveResponse: responseData length:(%d)", receivedData.length); |
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"; | |
} |
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
//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
@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
/** 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
/** 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
#import <Foundation/Foundation.h> | |
@interface Constants : NSObject | |
#define kBgQueue dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) | |
extern NSString *kGetPOIUrl; | |
@end |
OlderNewer