t-knapp / BINhungrig-fh-bingen-mensa-android

Android App "BINhungrig" for menu of cantina of Fachhochschule Bingen
3 stars 1 forks source link

Setting User Agent depending on version #11

Closed t-knapp closed 10 years ago

t-knapp commented 10 years ago

Setting custom useragent like "BINhungrig/android/2014-04-01" to improve usage analytics at server side.

@git-commit Possible with gradle to search and replace a string before compile?

git-commit commented 10 years ago

Yes you can do that sort of thing using gradle. I think you can however do this without touching the build at all if you're using

String versionName =
                context.getPackageManager().
                        getPackageInfo(context.getPackageName(), 0).versionName;

See: https://stackoverflow.com/questions/4616095/how-to-get-the-build-version-number-of-your-android-application

t-knapp commented 10 years ago

Bull's eye!

t-knapp commented 10 years ago

Tested, pushed and ready for review.

https://github.com/t-knapp/BINhungrig-fh-bingen-mensa-android/commit/d85a2d138ddc7d1d49fa8cca36d9f42433b6560b

git-commit commented 10 years ago

We can also think about using google analytics within the app. About to review the changes now.

t-knapp commented 10 years ago

Done.