Display display = ((WindowManager)getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
int screen_width = display.getWidth();
int screen_height = display.getHeight();
Friday, July 22, 2011
Wednesday, July 20, 2011
How to Find Device Width and Height in iOS SDK
CGRect screenBounds = [[UIScreen mainScreen] bounds];
NSString *width=[NSString stringWithFormat:@"%g",screenBounds.size.width ];
NSString *height=[NSString stringWithFormat:@"%g",screenBounds.size.height ];
ight %@", width,height,NSStringFromCGRect(screenBounds));
NSString *width=[NSString stringWithFormat:@"%g",screenBounds.size.width ];
NSString *height=[NSString stringWithFormat:@"%g",screenBounds.size.height ];
ight %@", width,height,NSStringFromCGRect(screenBounds));
Thursday, July 14, 2011
ASI HTTP Request + JSON Sample
ASIHTTPRequest *req = [ASIHTTPRequest requestWithURL:URL];
req.delegate = self;
req.userInfo = [NSDictionary dictionaryWithObject:@"initialRequest" forKey:@"type"];
NSData *body = [jsonString dataUsingEncoding:NSUTF8StringEncoding];
[req appendPostData:body];
[req startSynchronous];
Wednesday, July 13, 2011
Tuesday, July 12, 2011
Monday, July 11, 2011
How To Use UIView Animation Tutorial- iPhone
very easy to understand the animation concept
How To Use UIView Animation Tutorial
Thursday, July 07, 2011
Detect device is an Android Tablet or not
public static int DISPLAY_SCREEN_WIDTH = 0;
public static int DISPLAY_SCREEN_HEIGHT = 0;
private int MAX_PHONE_WIDTH = 500;
private int MAX_PHONE_HEIGHT = 800;
private boolean isDeviceATablet() {
boolean bIsDeviceATablet = false;
Display display = ((WindowManager)getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
DISPLAY_SCREEN_WIDTH = display.getWidth();
DISPLAY_SCREEN_HEIGHT = display.getHeight();
if( (DISPLAY_SCREEN_WIDTH > MAX_PHONE_WIDTH) || (DISPLAY_SCREEN_HEIGHT > MAX_PHONE_HEIGHT) )
bIsDeviceATablet = true;
if(bIsDeviceATablet)
Log.i("Device is identified as an Android TABLET.");
else
Log.i("Device is identified as an Android PHONE.");
return bIsDeviceATablet;
}
public static int DISPLAY_SCREEN_HEIGHT = 0;
private int MAX_PHONE_WIDTH = 500;
private int MAX_PHONE_HEIGHT = 800;
private boolean isDeviceATablet() {
boolean bIsDeviceATablet = false;
Display display = ((WindowManager)getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
DISPLAY_SCREEN_WIDTH = display.getWidth();
DISPLAY_SCREEN_HEIGHT = display.getHeight();
if( (DISPLAY_SCREEN_WIDTH > MAX_PHONE_WIDTH) || (DISPLAY_SCREEN_HEIGHT > MAX_PHONE_HEIGHT) )
bIsDeviceATablet = true;
if(bIsDeviceATablet)
Log.i("Device is identified as an Android TABLET.");
else
Log.i("Device is identified as an Android PHONE.");
return bIsDeviceATablet;
}
UITextField delegate Methods in objectice c
1. textFieldDidBeginEditing:
Tells the delegate that editing began for the specified text field.
- (void)textFieldDidBeginEditing:(UITextField*)textField
2. textFieldDidEndEditing:
Tells the delegate that editing stopped for the specified text field.
- (void)textFieldDidEndEditing:( UITextField *)textField
3.textFieldShouldBeginEditing:
Asks the delegate if editing should begin in the specified text field.
- (BOOL)textFieldShouldBeginEditing:( UITextField *)textField4.textFieldShouldClear:
Asks the delegate if the text field’s current contents should be removed.
- (BOOL)textFieldShouldClear:(UITextField *)textField
5.textFieldShouldEndEditing:
Asks the delegate if editing should stop in the specified text field.
6.textFieldShouldReturn:
Asks the delegate if the text field should process the pressing of the return button.
- (BOOL)textFieldShouldReturn:(UITextField *)textField
Wednesday, July 06, 2011
Tuesday, July 05, 2011
How to Split string into substring in iOS Sdk
You can also split a string by a substring, using NString’s componentsSeparatedByString method.
NSString *list = @”amal, arun, balaji, dhina, guru, hari, kumar,mahes”;
NSArray *listItems = [list componentsSeparatedByString:@", "];
NSString *list = @”amal, arun, balaji, dhina, guru, hari, kumar,mahes”;
NSArray *listItems = [list componentsSeparatedByString:@", "];
Monday, July 04, 2011
C # Checkbox Tutorial
The Tutorial is pretty easy and understandable
http://www.java2s.com/Code/CSharp/GUI-Windows-Form/CheckBox.htm
http://www.java2s.com/Code/CSharp/GUI-Windows-Form/CheckBox.htm
Subscribe to:
Posts (Atom)
Create a list in SwiftUI with sticky section headers
Sample Code import SwiftUI struct ContentView : View { @State var isCustomViewControllerDisplayed = false @State private va...
-
Function for getting hardware specific info such as CPU ID, Motherboard Serial Number, Drive Serial Numbers and MAC address . '*...
-
Excel 97 Excel 97-2003 Xls files with ACE OLEDB 12.0 You can use this connection string to use the Office 2007 OLEDB driver (ACE ...
-
Range Operators: Closed Range operators Half-Open Range Operators One-Sided Ranges Closed Range Operators: a...b It defines...