Java (Android) Code Formatting Standards

##Variables

    int camelCase;
     private String someClassString;
    public static final String SOME_CONSTANT_STRING = "hello, world";

##Classes

    SomeClass, SocialLoginActivity
    public class SocialLoginActivity extends Activity {
        ...
    }
    public class NetworkAlertFragment extends Fragment {
        public interface NetworkAlertFragmentListener { 
            void alertDismissed();
        }

    	[ALL YOUR OTHER CODE]     

        public static class Type {
            public static final int SUCCESS = 0;
            public static final int FAILURE = 1;
        }
    }

##Methods

    @NonNull
    public String someFunction(@Nullable param1, @NonNull param2) {
        ...
        return someString;
    }
   public abstract void setTitle(@StringRes int resId) { … }
    public static <T> Flowable<T> create(
        FlowableOnSubscribe<T> source,
        BackpressureStrategy mode) { /**/ }
    Flowable.create({ /**/ }, BackpressureStrategy.LATEST)
    Flowable.create(BackpressureStrategy.LATEST) { /**/ }
    public void someHypotheticallyLongQueryFunction(Context context, Uri contentUri,
                                                    String query, String[] queryArgs) {
        ...
    }
    onOptionSelect() {}
    onClickSubmit() {}
    onSubmitSuccess() {}

##General optimization rules

        Collection<Type> myCollection = ...

        for (Type current : myCollection) {
            ...
        }
        public class Foo {
            private int value;

            ...

            class Inner {
                public void someFunction() {
                    Foo.this.doSomething(Foo.this.mValue);
                }
            }
        }
    try {
        // some file operation
    } catch (IOException | FileNotFoundException ex) {
        ex.printStackTrace();
    }