Wednesday, August 29, 2012

Tomcat Configuration Https without port number

Install tomcat or Unzip tomcat and run the start.bat file from APACHE_HOME\bin.
Tomcat runs on http with 8080 port default.
To test, type http://localhost:8080 in browser.

To enable HTTPS

We need to change few configuration in the APACHE_HOME \conf\server.xml file.

Uncomment the connector in APACHE_HOME \conf\server.xml file.

Create an abc.jks file using keytool and place in the ${user.home}.
Note: ${user.home} in windows “C:\Documents and Settings\user”.
Now we can access https with the following set up.
To test, type https://localhost:8443 in browser.

Remove 8443 port

Default security port is 443.
So, change the port from 8443 to 443 in the above connector as follows.

To test, type https://localhost in browser.

Thursday, July 26, 2012

IPhone: Solution for [[UIDevice currentDevice] uniqueIdentifier]]


[[UIDevice currentDevice] uniqueIdentifier] is deprecated in iOS5

APPLE DOCUMENTATION:
To create a unique identifier specific to your app, you can call the CFUUIDCreate function to create a UUID, and write it to the defaults database using the NSUserDefaults
/*
 * Generates UUID using CFUUIDCreate
 */
- (NSString *) generateUUID
{
    NSString *  result;
    CFUUIDRef   uuid;
    CFStringRef uuidStr;
    
    uuid = CFUUIDCreate(NULL);
    assert(uuid != NULL);
    
    uuidStr = CFUUIDCreateString(NULL, uuid);
    assert(uuidStr != NULL);
    
    result = [NSString stringWithFormat:@"%@", uuidStr];
    assert(result != nil);
    
    CFRelease(uuidStr);
    CFRelease(uuid);
    
    return result;
}

// Use the Below Code to save the UUID into the NSUserDefaults, so that we can use, anywhere in the application.
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSString *fetchUUID = [defaults objectForKey:@"UUID"];
if (fetchedUUID == nil || [fetchedUUID isEqualToString:@""])
{
     NSLog(@"Checking in if");
     [defaults setObject:[self generateUUID] forKey:@"UUID"];
}    
fetchUUID = [defaults objectForKey:@"UUID"];

Use the above code to get UUID in iOS5.

Tuesday, June 26, 2012

Android : ListView with fast scroll using alphabets in the right side of the screen


Android ListView with fast scroll using alphabets in the right side of the screen

We have lot of questions like
Alphabetical sorted listview with Alphabetic section using Adapter in Android application.
Listview alphabetical index programmatically
In IPhone we are having Indexed UITableView
Android Listview like iphone contacts list (alphabets in right side of the list)

We are not having similar functionality in android but we are having android:fastScrollEnabled and alphaIndexer.
Without using android:fastScrollEnabled and alphaIndexer. Just with touch recognition, alphabetically sorting can be achieved easily.

If you want to implement the same feature in android and solution for all the above questions, we can try this approach

Code: indexTableCode

Screen Shot:





















Thanks for reading :)
If you have any other quick thoughts/hints that you think people will find useful, feel free to leave a comment.