You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This repository currently contains an Android sample project in examples/android-proguard-example. The README and Troubleshooting Guide currently refer to it, and as seen by #2715 (comment) users are still looking at it often.
The problem is that this sample project is quite old, and might not represent current best practices:
It has no build config (no Gradle scripts), and the structure does not follow the src/main/java, ... conventions
It uses a PNG icon.png which is probably not best practice; nowadays Android apps normally use vector drawables
The Cart#toString implementation seems to contain debug code which is not relevant to users
It is possibly incomplete and redundant nowadays since there is now META-INF/proguard/gson.pro (which users can also use as reference if they are using Gson < 2.11.0, which does not include that file)
It contains the file default.properties which is probably redundant nowadays
It also contains little configuration or code which is Android specific; the most important part is probably proguard.cfg. GsonProguardExampleActivity.java just performs basic conversion from and to JSON and displays the result as text; it does not use SharedPreferences, Room, or communicate with a REST API or anything similar.
Side note: After creating a new empty project in Android Studio, adding the files from the example and making some small adjustments the project still works though.
Feature description
Remove examples/android-proguard-example
Optionally consider adding Android (or generally R8 / ProGuard) information to the User Guide instead
Replace references to examples/android-proguard-example
Alternatives / workarounds
An alternative would be to fix the issues above, or even set up a new sample Android project following the current best practices. However, the risk is that this becomes outdated again in the next years.
Alternatively could also just do nothing (or maybe only fix some of the issues), but the question is then how much value examples/android-proguard-example in its current form provides to users.
The text was updated successfully, but these errors were encountered:
Problem solved by the feature
This repository currently contains an Android sample project in
examples/android-proguard-example
. The README and Troubleshooting Guide currently refer to it, and as seen by #2715 (comment) users are still looking at it often.The problem is that this sample project is quite old, and might not represent current best practices:
src/main/java
, ... conventionsicon.png
which is probably not best practice; nowadays Android apps normally use vector drawablesCart#toString
implementation seems to contain debug code which is not relevant to usersproguard.cfg
proguard-rules.pro
, see https://developer.android.com/build/shrink-code-keep class com.google.gson.examples.android.model.**
entry which is only relevant for that example-keep class com.google.gson.stream.**
, see What is stream package in gson and when I need to keep it? #1571META-INF/proguard/gson.pro
(which users can also use as reference if they are using Gson < 2.11.0, which does not include that file)default.properties
which is probably redundant nowadaysAndroidManifest.xml
containspackage="..."
, which is ignored by recent Android Gradle Plugin versions, see https://developer.android.com/guide/topics/manifest/manifest-element#packageIt also contains little configuration or code which is Android specific; the most important part is probably
proguard.cfg
.GsonProguardExampleActivity.java
just performs basic conversion from and to JSON and displays the result as text; it does not useSharedPreferences
, Room, or communicate with a REST API or anything similar.Side note: After creating a new empty project in Android Studio, adding the files from the example and making some small adjustments the project still works though.
Feature description
examples/android-proguard-example
examples/android-proguard-example
Alternatives / workarounds
An alternative would be to fix the issues above, or even set up a new sample Android project following the current best practices. However, the risk is that this becomes outdated again in the next years.
Alternatively could also just do nothing (or maybe only fix some of the issues), but the question is then how much value
examples/android-proguard-example
in its current form provides to users.The text was updated successfully, but these errors were encountered: