Encrypt Strings Please copy the AESUtils class in your project first and then you can use it like this. String encrypted = ""; String sourceStr = "This is any source string"; try { encrypted = AESUtils.encrypt(sourceStr); Log.d("TEST", "encrypted:" + encrypted); } catch (Exception e) { e.printStackTrace(); } #carbonads { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif; } #carbonads { display: block; overflow: hidden; max-width: 728px; position: relative; background-color: hsl(0, 0%, 99%); border: solid 1px #eee; font-size: 22px; box-sizing: content-box; } #carbonads span { display: block; } #carbonads a { color: inherit; text-decoration: none; } #carbonads a:hover { color: inherit; } .

Continue reading

We often use View’s visibility in our apps to show and hide them. We use void setVisibility(int visibility) method for that purpose. But have you ever thought that why this method always takes VISIBLE, INVISIBLE and GONE rather than any int value like 0 or 1 etc.? Although method’s parameter type is int, then why it doesn’t accept the direct numbers or any other int variable except those three. In java, enum is known concept, and in many cases you can use it, but for android, enum is something you should avoid to use as it’s processing performance is not efficient, so in Android performance patterns it’s told to avoid enums and to use annotations like @IntDef and @StringDef.

Continue reading

Author's picture

Wajahat Karim

Android Developer. Open Source Contributor. Writer. Speaker

Senior Android Developer

Karachi, Pakistan