const int a = 1; // read as "a is an integer which is constant" int const a = 1; // read as "a is a constant integer" Both are the same thing. Therefore: a = 2; // Can't do because a is constant The reading backwards trick especially comes in handy when you're dealing with more complex declarations such as: const char *s; // read as "s is a pointer to a char that is constant" char c; cha..
Display display; display = ((WindowManager) context.getSystemService(context.WINDOW_SERVICE)).getDefaultDisplay(); DisplayMetrics metrics = new DisplayMetrics(); display.getMetrics(metrics); // cell size of a widget in portrait mode int xCellSize = 80; int yCellSize = 100; if (metrics.widthPixels > metrics.heightPixels) { // this means we're in landscape mode, so the cell sizes are adjusted xCel..
Problem: Failed to complete Gradle execution Cause: A fatal exception has occurred. Program will exit Solution Go to File -> Settings -> Gradle Input the following in the "Gradle VM options:" box: -XX:MaxHeapSize=256m -Xmx256m Hit apply and Android Studio should build your project successfully.
버전 명 String versionName = getPackageManager().getPackageInfo(getPackageName(), 0).versionName; 버전 코드 int versionCode = getPackageManager().getPackageInfo(getPackageName(), 0).versionCode;