Tuesday 22 November 2011

Android Customizing listview (Section Index)


How you customize Listview in android

http://stackoverflow.com/questions/7443047/customizing-listview-component

http://hello-android.blogspot.com/2010/11/sideindex-for-android.html

Tuesday 15 November 2011

iPhone apps should include an armv6 architecture (issue)


Issue is resolve here:

http://stackoverflow.com/questions/4198676/warning-iphone-apps-should-include-an-armv6-architecture-even-with-build-config

Thursday 10 November 2011

iOS 5 SDK Tutorial And Ebook


iOS 5 SDK Tutorial And Guide Page:

http://maniacdev.com/ios-5-sdk-tutorial-and-guide/

http://osx.hyperjeff.net/Reference/CocoaArticles?cat=60

Ebook:

http://www.ebooks.ac/ebooks/ios-5-programming-cookbook-pdf/#more-1431

Thursday 3 November 2011

Paypal Integration in iPhone, android and Blackberry


Video:
http://www.ampev1.com/ondemands/Paypal/080510_PayPal/iphone_v10.htm

SDK:
https://www.x.com/developers/paypal/products/mobile-payment-libraries

Add text field and keyboard in scrollview in iphone


///////////// Keyboard //////////////////////




-(void) keyboardDidShow: (NSNotification *)notif {
   NSLog(@"Keyboard is visible");
   // If keyboard is visible, return
   if (keyboardVisible) {
       NSLog(@"Keyboard is already visible. Ignore notification.");
       return;
   }
 
   // Get the size of the keyboard.
   NSDictionary* info = [notif userInfo];
   NSValue* aValue = [info objectForKey:UIKeyboardBoundsUserInfoKey];
   CGSize keyboardSize = [aValue CGRectValue].size;
 
   // Save the current location so we can restore
   // when keyboard is dismissed
   offset = scrollview.contentOffset;
 
   // Resize the scroll view to make room for the keyboard
   CGRect viewFrame = scrollview.frame;
   viewFrame.size.height -= keyboardSize.height;
   scrollview.frame = viewFrame;
 
   CGRect textFieldRect = [activeField frame];
   textFieldRect.origin.y += 10;
   [scrollview scrollRectToVisible:textFieldRect animated:YES];
 
   NSLog(@"ao fim");
   // Keyboard is now visible
   keyboardVisible = YES;
}

-(void) keyboardDidHide: (NSNotification *)notif {
   // Is the keyboard already shown
   if (!keyboardVisible) {
       NSLog(@"Keyboard is already hidden. Ignore notification.");
       return;
   }
 
   // Reset the frame scroll view to its original value
   scrollview.frame = CGRectMake(0, 0, SCROLLVIEW_CONTENT_WIDTH, SCROLLVIEW_CONTENT_HEIGHT);
 
   // Reset the scrollview to previous location
   scrollview.contentOffset = offset;
 
   // Keyboard is no longer visible
   keyboardVisible = NO;
 
}

-(BOOL) textFieldShouldBeginEditing:(UITextField*)textField {
   activeField = textField;
   return YES;
}

- (BOOL)textFieldShouldReturn:(UITextField *)textField {
   [textField resignFirstResponder];
   return YES;
}

- (void)viewDidAppear:(BOOL)animated {

 
 
   NSLog(@"Registering for keyboard events");
 
   // Register for the events
   [[NSNotificationCenter defaultCenter]
    addObserver:self
    selector:@selector (keyboardDidShow:)
    name: UIKeyboardDidShowNotification
    object:nil];
   [[NSNotificationCenter defaultCenter]
    addObserver:self
    selector:@selector (keyboardDidHide:)
    name: UIKeyboardDidHideNotification
    object:nil];
 
   // Setup content size
   scrollview.contentSize = CGSizeMake(SCROLLVIEW_CONTENT_WIDTH,
                                       SCROLLVIEW_CONTENT_HEIGHT);
 
   //Initially the keyboard is hidden
   keyboardVisible = NO;
 
}

-(void) viewWillDisappear:(BOOL)animated {
   NSLog (@"Unregister for keyboard events");
   [[NSNotificationCenter defaultCenter]
    removeObserver:self];
}


//////////////////////////////////////////////


   IBOutlet UIScrollView *scrollview;
   BOOL keyboardVisible;
   CGPoint offset;
   UITextField *activeField;

@property(nonatomic,retain) IBOutlet UIScrollView *scrollview;

and

@synthesis scrollview

#define SCROLLVIEW_CONTENT_HEIGHT 416
#define SCROLLVIEW_CONTENT_WIDTH  320