App crashes on launching Mail Composer View in iPad
In you application you are calling the MFMailComposeViewController to launch the email composer window, but you are getting an error running the application on the iPad device, however it works...
View ArticleUsing NSUserDefaults to store Settings in iOS
NSUserDefaults is one of simplest ways to store your configuration/settings of your iPhone/iPad application. You don't have to create a plist or work with the file system, it encapsulates all of...
View ArticleHow to get Youtube Video Id from the URL using PHP?
Given a YouTube Video URL can you find the VID from the URL?.The following Phip snippet helps you to do the same. The key things to keep in mind that VID which is a unique string for any video is 11...
View ArticleCopy Bytes from InputStream to OutputStream - Android
When we want to copy data from one file to another, we can open an InputStream for the source file and OutputStream for the destination file, read chucks and perform data transfer. In order to copy...
View ArticleHow to remove HTML tags from a String in iOS?
Say you are scraping a feed or a page or parsing RSS feed, and the content that you are interested in say Title has some html elements in it (normally is an image) but you want to strip out the html...
View ArticleHow to find Image link from an RSS Item in iOS?
For most cases, a RSS feed is nothing but an XML document providing title, link description etc. of the latest content pages of a website. So when building RSS Feed display widget or a view where we...
View ArticleHow to convert Hex String to Bytes and viceversa in Java?
Converting from hex String from a byte array and vice-versa is not available a function as part of JDK. The following shows a implementation of such methods. For Hex to Byte Array , it loops through...
View ArticleSnoop MDB Java
The message driven beans are consumers of JMS messages. When message is received from the queue, we can find out a lot of details about the message. The following snippet of MDB tries to find out like...
View ArticleHow to send a JMS Message?
JMS(Java Message Service) provides a reliable way to sending message asynchronously. The message are sent to a queue(destination) and consumer like MDB is hooked up the queue. The following snippet...
View ArticleSession Listener Filter
A simple session listener can help to understand the beginning and closing of Http session. All we have to do is to implement the HttpSessionListner interface. The interface provides basic methods like...
View ArticleHow to check if Weblogic Server is Up via command Line?
The following command line Windows BAT shell script can be used to remotely found out if the weblogic Server is up and running. It uses weblogic.Admin class/utility to issue a CONNECT command and see...
View ArticleHow to use ASIHTTPRequest for Async Http Request?
As a best practice all the HTTP requests to get some data or perform an operation over the network should be done in an Asynchronous way (separate thread) to avoid the GUI be non-responsive and not...
View ArticleHow to use ASIHTTPRequest for Sync Http Request?
Sending Synchronous HTTP Request using AISHTTP library is very easy. Since the request is synchronous, no callback method is required for the same. You can specify the request timeout as desired. The...
View ArticleSniffer Http Filter J2EE
Do you want to know the request headers and other parameters for each of the HTTP requests coming into the application server? If yes, a Sniffer filter like the one show below can dump all the incoming...
View ArticleHow to read and write file from NSString and viceversa in iOS?
Snippet// Write to Text File as String+(void) writeFile :(NSString*) data asFileName:(NSString*) filename inDirectory:(NSString*) directory onError:(NSError*) error{ // create the full file name...
View ArticleHow to do Case Insensitive comparison in Objective C?
Answerif( [@"test str" caseInsensitiveCompare:@"Test Str"] == NSOrderedSame ) { // same, case could be different}else{// different chars}
View ArticleHow to check if LBS is enabled in IOS?
SnippetBOOL locationServicesEnabled;CLLocationManager locationManager = [CLLocationManager new];if( [locationManager respondsToSelector:@selector(locationServicesEnabled) ] ){...
View ArticleHow to convert Device ID as NSData to NString in IOS?
Solution (NSString *)convertTokenToDeviceID:(NSData *)token { NSMutableString *deviceID =[NSMutableString string]; // iterate through the bytes and convert to hexunsigned char*ptr =(unsigned...
View ArticleHow to get Device token when registered for PushNotification in iOS?
Solution -(void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken{ NSLog(@"My token is: %@", deviceToken); NSString *...
View ArticleHow to print values in NSUserDefaults to the NSLog?
SolutionNSUserDefaults is basically kind of hashmap(dictionary) that stores the keys and values.In order to print all the keys do the follow:NSLog(@"%@", [[[NSUserDefaults standardUserDefaults]...
View Article