Skip to content

Instantly share code, notes, and snippets.

View xvarlez's full-sized avatar

Xavier Varlez xvarlez

  • Pelago
  • København
View GitHub Profile
@xvarlez
xvarlez / MyDaoGenerator.java
Created February 11, 2016 14:46
GreenDao schema generator snippet with one-to-many relation
public class RFDaoGenerator {
public static void main(String args[]) throws Exception {
Schema schema = new Schema(1, "com.orange.reunionflash.data");
// Member
Entity member = schema.addEntity("Member");
member.addIdProperty();
Property addressBookId = member.addStringProperty("addressBookId").notNull().getProperty();
@xvarlez
xvarlez / ContactsCache.java
Last active February 17, 2016 10:27
Android contacts cache
/**
* Cache for addressbook contacts.
*/
public class ContactsCache {
private static class Holder {
static final ContactsCache INSTANCE = new ContactsCache();
}
@xvarlez
xvarlez / ProfileActivity.java
Last active June 1, 2018 09:31
Android simple user input validation system, with support for EditText, AutoCompleteTextView, TextInputLayout
/**
* The activity containing your EditTexts.
*/
public class ProfileActivity extends AppCompatActivity {
/**
* Input field "your name".
*/
@Bind(R.id.edittext_name)
EditText nameEditText;