Skip to content

Instantly share code, notes, and snippets.

View Dekola's full-sized avatar

Adekola Akano Dekola

View GitHub Profile
@pich4ya
pich4ya / MainActivity.kt
Last active April 1, 2022 12:56
Android: Preventing Sensitive Information From Appearing In Background Screenshot (Recent App)
/*
@author longcat (Pichaya Morimoto)
This code snippet can be used to resolve BOT (Bank Of Thailand) mobile security requirement "insecure background"
without hurting user experience in mobile app.
Briefly, when the app is pushed into background mode (user presses the Home button)
Android phone will create screenshot of the current Activity for displaying it in recent apps menu
The recent's app screenshots will be stored at:
@larikraun
larikraun / Nigerian States
Created March 9, 2017 04:31
This is a list of Nigerian states as a string array in Android
<string-array name="states">
<item>Abia State</item>
<item>Adamawa State</item>
<item>Akwa Ibom State</item>
<item>Anambra State</item>
<item>Bauchi State</item>
<item>Bayelsa State</item>
<item>Benue State</item>
<item>Borno State</item>
<item>Cross River State</item>
@Aeonitis
Aeonitis / MainActivity.java
Created January 3, 2017 18:45
Android - Check Network State in your app, Notifying you when an app is online/offline
/**
* This would be the activity which registers the receiver class via it's interface
*/
public class MainActivity implements NetworkStateReceiver.NetworkStateReceiverListener {
private NetworkStateReceiver networkStateReceiver; // Receiver that detects network state changes
@Override
protected void onCreate(Bundle savedInstanceState) {
/***/
@wojteklu
wojteklu / clean_code.md
Last active June 29, 2024 08:22
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules