Skip to content

Instantly share code, notes, and snippets.

@oznus
oznus / Picking image From gallery and Capture at the same time.java
Last active August 29, 2015 14:12
Creating an intent chooser that includes both image capture and image picker intents (like whatsup uses for picking user image profile)
@oznus
oznus / SafeFiledNamingStrategy.java
Last active August 29, 2015 14:10
This is my custom implementation of google Gson naming strategy in order to have null string as empty string and also avoid Locale issues while parsing class from server
/**
* Created by Oz Nusem on 5/19/14.
*/
public class SafeFiledNamingStrategy implements FieldNamingStrategy {
/**
* @return Gson object with this safe strategy
*/
public static Gson getGsonWithSafeNamingStrategy() {
return new GsonBuilder().setDateFormat("yyyy-MM-dd").setFieldNamingStrategy(new SafeFiledNamingStrategy()).