Skip to content

Instantly share code, notes, and snippets.

@metalwihen
metalwihen / useragent.md
Created March 14, 2018 04:52
UserAgent
    private String getUserAgent() {
        if (mUserAgentString == null) {
            String productWithVersion = String.format("%s/%s", BuildConfig.APPLICATION_ID, BuildConfig.VERSION_CODE);
            String androidUserAgent = System.getProperty("http.agent");
            if (androidUserAgent == null && productWithVersion != null) {
                mUserAgentString = productWithVersion; // in case null is returned
            } else if (productWithVersion != null) {
                mUserAgentString = String.format("%s %s", productWithVersion, androidUserAgent);
 } else {
@metalwihen
metalwihen / android-o-changes.md
Created March 7, 2018 11:00
Android O - Service Changes

BEFORE

BroadcastReceiver

public class RebootBroadcastReceiver extends BroadcastReceiver {

    AlarmReceiver alarm = new AlarmReceiver();

    @Override
    public void onReceive(Context context, Intent intent) {
@metalwihen
metalwihen / fileprovider.md
Last active November 21, 2019 10:43
Android N Changes - FileProvider

Changes to be made in AndroidManifest.xml

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<provider
    android:name="android.support.v4.content.FileProvider"
    android:authorities="${applicationId}.provider"
@metalwihen
metalwihen / privacy-policy-apps.md
Last active March 13, 2017 14:52
Privacy Policy

Privacy Policy

This privacy policy has been compiled to better serve those who are concerned with how their 'Personally Identifiable Information' (PII) is being used online. PII, as described in US privacy law and information security, is information that can be used on its own or with other information to identify, contact, or locate a single person, or to identify an individual in context. Please read our privacy policy carefully to get a clear understanding of how we collect, use, protect or otherwise handle your Personally Identifiable Information in accordance with our website.

What personal information do we collect from the people that visit our blog, website or app?

When ordering or registering on our site, as appropriate, you may be asked to enter your name, email address or other details to help you with your experience.

When do we collect information?

@metalwihen
metalwihen / code-review-checklist.md
Created September 20, 2016 09:22 — forked from nerandell/code-review-checklist.md
PHP Code Review Guidelines

Make sure these boxes are checked before submitting/approving the PR

General

  • The code works
  • The code is easy to understand
  • Follows coding conventions
  • Names are simple and if possible short
  • Names are spelt correctly
  • Names contain units where applicable
  • There are no usages of magic numbers
- General
[ ] The code works
[ ] The code is easy to understand
[ ] Follows coding conventions
[ ] Names are simple and if possible short
[ ] Names are spelt correctly
[ ] Names contain units where applicable
[ ] Enums are used instead of int constants where applicable
[ ] There are no usages of 'magic numbers'
[ ] All variables are in the smallest scope possible