Code Tricks Archive

How to easy implement android runtime permissions request in android app development

Author: | Categories: Android, Code Tricks, Quick Tips No comments
  Hello developers today we are going to learn implementing android runtime permissions request in android app development.   As we know, If we need to make use of protected features of the device in any application we need to give permission request in AndroidManifest.xml of application, As below

How to get Accelerometer readings in Android

Author: | Categories: Android, Code Tricks, Quick Tips No comments
Hello all, Today we learn about getting Accelerometer readings in android application. We will use android SensorManager class to get readings from Accelerometer and show them on screen. First create a android project and create a file in layout folder as bleow in above file we are using three

Some Linux file access permission commands – Quick Tips

Following are few examples of Some Linux file access permission commands and how to use the symbolic representation on chmod. 1. Add single permission to a file/directory Changing permission to a single set. + symbol means adding permission. For example, do the following to give execute permission for the user

Code Design Pattern For PHP

Author: | Categories: Code Tricks, PHP, Quick Tips No comments
Code Design Pattern PHP: Code Design patterns not only present useful ways for developing robust software rapidly but also provide a way of encapsulating large data/ideas form outside world in friendly terms. In simple words “Recurring solution for common software development challenges ”. Common Software Development Challenges: Building new application

How to change style of Horizontal ProgressBar in Android

Author: | Categories: Android, Code Tricks No comments
In this tutorial we will learn how to customize or change style of Horizontal Progressbar in Android. To change style of Horizontal ProgressBar we have to set a property android:progressDrawable with custom layer-list drawable in our layout file like:   and create progressDrawable like below in drawable folder (customprogressbar.xml)

How to apply custom font on TextView Android

Author: | Categories: Android, Code Tricks, Quick Tips No comments
Some times we need to apply custom font on a TextView in our application. We can do this by setting typeface to out TextView as below. In case you have more than two TextView in your application(also in different activities/fragments) which uses custom font, Then it would be better

Sending email with attachment programmatically in Android

Author: | Categories: Android, Code Tricks, Quick Tips No comments
If you want to send email with attachment in android application programmatically you can use below method for it. Just modify parameters according to your use and you are ready to go.

Method to check internet connectivity in android

Author: | Categories: Android, Code Tricks, Quick Tips No comments
Some times we need to check internet connection status of device when we perform any network tasks using our application in android application development. Below is a simple method to check internet connectivity in android. And here is an example how to use it in your code.  

How to detect Operating System using PHP in webpage

Author: | Categories: Code Tricks, PHP, Quick Tips No comments
In this tutorial we will learn how to detect operating system using PHP in a webpage. Because some time we need to show some links on webpage according to operating system in which it opened. In PHP we can determine operating system information using webpage’s HTTP_USER_AGENT header. Using below