Monday, June 10, 2013

Execute HTTP GET in Android

Sample Code :

try {
       HttpClient client = new DefaultHttpClient();
       String targetUrl = "http://www.example.com";
       HttpGet httpGet = new HttpGet(targetUrl);
       HttpResponse response = null;       
       response = client.execute(httpGet);
       HttpEntity entity = response.getEntity();
       if(entity!=null){
             Log.v("GET RESPONSE", EntityUtils.toString(entity));
       }
}
catch(Exception e){
       e.printStackTrace();
}

Thursday, June 06, 2013

Get the frame of a view inside another view

Converts a rectangle from the coordinate system of another view to that of the receiver.
- (CGRect)convertRect:(CGRect)rect fromView:(UIView *)view
Sample :
CGRect frame = [imageView convertRect:button.frame toView:self.view];


Create a list in SwiftUI with sticky section headers

 Sample Code import SwiftUI struct ContentView : View {     @State var isCustomViewControllerDisplayed = false     @State private va...