Android Base Best Practices

Android Base Best Practices

 

Do not block the user interface, use asynchronous requests for the output input operations that may involve delay such as network requests or database access.

Request permission to users in an orderly and context-related manner.

Debug and correctly trace the app, it will help you increase the quality and verify the correct operation.

Multi device adjustment, regulate at least three cut points: smartphone 5 inches, fablet 7 inches, tablet 10 inches.
Prepare images for different screen densities (DPIs).


Explicitly state in the manifest what screen sizes our application supports, it is not a good approach when we want it to work on most devices. This option limits publishing only to the listed display devices!.

Set by language. Always try to set the default language of the device, if you do not have that translation in that lang set a by default programatically, e.g. English.
Correct handling of files. Do not store dangerous data such as the password.
Check external storage is mounted before you are going to use it.
Check the space before writing and control the exceptions in run-time in writing/reading operations.

Remember that all files are deleted when the application is uninstalled, except for external public data (such as photos) that are saved to the public shared folder between apps.


Use the minimal permissions y only the necessary for your app.


Remember use the three steps based on checkSelfPermission, shouldShowRequestPermissionRationale and onRequestPermissionsResult. ShouldShowRequestPermissionRationale indicate whether or not we should show UI message with rationale for requesting a permission. Attention shouldShowRequestPermissionRationale only return true when a dangerous permission was denied at the first previous time and the user is trying again to get access to this functionality.

Uses security services such as SafeNet to check the execution environment.

https://developer.android.com/training/safetynet/index.html

  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

One comment

  1. Whats a great article, I am enjoying very much with this.

    Thanks in advance!

Leave a Reply

Social media & sharing icons powered by UltimatelySocial