Archive for the 'android' Category

23 Jul 2016

date difference calculation

12:22 | android | 670 views

Goal: get the time difference between two dates The following code gives the difference between two times in this form: 1h 12m The seconds and the days not used. Just good to know how can calculate these values.


23 Jul 2016

date manipulation

12:18 | android | 608 views

Goal: sometimes we need to modify a date… Like in this simple case. Let’s add 5 minutes to the actual time. Easy with the java.util.Calendar class. Nota bene: this class can use years, hours, minutes… as well


21 Jul 2016

scrollable TextView in android

11:09 | android | 627 views

Goal: making a TextView scrollable put two lines to the layout file: plus to the activity:


21 Jul 2016

add horizontal line to the activity

11:00 | android | 576 views

Goal: create an easy visual separator element Use only one line to create a line… where the dialogFragment_horizontal_line style is like this: nota bene: the color coming from style as well


21 Jul 2016

freeze portrait orientation

10:51 | android | 588 views

Goal: avoid the screen rotation If you want to ignore the rotation of the device you can freeze the orientation like this. Put the following line into the manifest file (AndroidManifest.xml) under the activity section:


#sidebar a { color:#fff; } #sidebar ul ul li { color: #DEF585; } #sidebar h2 { color: #fff; } #sidebar ul p, #sidebar ul select { color: #BEDDBE; } #backfly { background: url(images/golfBallWallPaper.jpg) left bottom fixed repeat-x #65a51d; }