Viral Patel

Android Preferences Activity example

Android Preferences Activity example
Android application often needs settings that allow users to modify preferences in app. Android provides a powerful framework to manage user preferences. It allows us to define the way we want preferrences and it automatically generates UI for that. All we need to do is to simply use it in our app.Let us see in this tutorial how to integrate Android's Preference framework (PreferenceActivity) ...

Java: How to Load CSV file into Database

Java: How to Load CSV file into Database
Loading CSV file into Database can be cumbersome task if your Database provider does not offer an out of box feature for this. Most of the time you'll spend up in creating valid insert statements and putting up values escaping all special characters. Importing CSV files gets a bit complicated when you start doing things like ...

Read / Write CSV file in Java

Read / Write CSV file in Java
If you want to work with Comma-separated Files (CSV) in Java, here's a quick API for you.As Java doesn't support parsing of CSV files natively, we have to rely on third party library. Opencsv is one of the best library available for this purpose. It's open source and is shipped ...
Tags: ,

Check if String is valid Date in Java

In Java, we play a lot with Dates. Here's one more scenario. You have a string which has date in it. You want to convert it into a valid java.util.Date object. Now in Java you can convert a String to Date using SimpleDateFormat class. But we will add a little more complexity on ...
Tags: ,

Eclipse: This project needs to migrate WTP metadata

Eclipse: This project needs to migrate WTP metadata
Sometimes Eclipse gives weird errors that you have no clue why is coming. For example, recently I got this strange error in eclipse's Problems view.This project needs to migrate WTP metadataTo remove this error, all you have to do is to re-validate the project.Select the project that you want to validate. Right-click the project and then ...

Spring MVC HashMap Form Integration example

Spring MVC HashMap Form Integration example
Spring MVC provides powerful way to manage form inputs. It also provides form validation functionality which is easy to integrate in any application. But other than the normal form bean mapping, recently I had a requirement to map dynamic values like key-value pairs in an HTML form and retrieve the same in Spring Controller. So basically HashMap came to rescue.Let us see how ...

Maven: How to Remove/Ignore Transitive Dependency

If you use Maven in your project for dependency management and if you use it a lot then sometimes you get into weird classpath issues where more than one version of JAR is loaded. Most of times I have got into issues related to cglib library. If two versions of cglibs, like cglib-2.1.1.jar and cglib-nodep.jar ...

Android: Take Emulator Screen Shots in Eclipse

Android: Take Emulator Screen Shots in Eclipse
If you are an Android developer then you are already taking lot of screen shots of your app. For documentation purpose or for putting it in Google Play market. Taking screen shots of Android in phone is easy in today's smart phones like Samsung Galaxy series. But most of the time we would need to grab the screen from Android emulator.Here's a simple but ...

How to convert Javascript Arrays to CSV (Comma separated values)

Let's see a small code snippet in Javascript that converts JS arrays in Comma separated values. It is also possible to convert an array to delimited text where one can choose the separator.var fruits = ;var str = fruits.toString();//print str: apple, peaches, oranges, mangoesThe toString() method converts an array into a String and returns the result. The returned string will separate the elements in ...

jQuery :not() selector example

jQuery :not() selector example
It's been a while since I wrote about JQuery. I am spending most of my time these days on backend technologies. Recently while working on a typical requirement on UI, I had to play with some tricky JQuery selectors.Typically, most of the times we uses JQuery's class selectors or id selectors for example:$('#someid').hide(); $('div#container').css('height', '100%');$('.someclass').hide(); $('div.entry').css('height', '100%');But recently I had a requirement where I had to ...
Page 5 of 34« First...34567...102030...Last »