Skip to content

Instantly share code, notes, and snippets.

View pawelkw's full-sized avatar

Paweł pawelkw

  • Amsterdam, The Netherlands
View GitHub Profile
# JSR 305 annotations are for embedding nullability information.
-dontwarn javax.annotation.**
-keepclasseswithmembers class * {
@com.squareup.moshi.* <methods>;
}
-keep @com.squareup.moshi.JsonQualifier interface *
# Enum field names are used by the integrated EnumJsonAdapter.
public String getTypeOfDayWithSwitchStatement(String dayOfWeekArg) {
String typeOfDay;
switch (dayOfWeekArg) {
case "Monday":
typeOfDay = "Start of work week";
break;
case "Tuesday":
case "Wednesday":
case "Thursday":
typeOfDay = "Midweek";
public class CalendarActivity extends Activity {
...
protected void onCreate(Bundle savedInstanceState) {
try {
URL url = new URL("http://www.google.com");
HttpURLConnection con = (HttpURLConnection) url.openConnection();
readStream(con.getInputStream());
HashMap<char, int> myMap = new HashMap<char, int>();
// Assuming textView is a properly initialized instance of android.widget.TextView
// and that R.color.mycolor is correctly defined in a resource file.
textView.setTextColor(R.color.mycolor);