Skip to main content


Showing posts from 2017

The Gradle Nightmare in Android Studio

The Gradle Nightmare in Android Studio
 This is a relatively common message in Android Studio if you dare to touch Gradle:

11:13 PM    Gradle sync failed: Minimum supported Gradle version is 3.3. Current version is 2.2. If using the gradle wrapper, try editing the distributionUrl in C:\Users\Acer Aspire\AndroidStudioProjects\MyApplication\gradle\wrapper\ to
                    Consult IDE log for more details (Help | Show Log)

 I have installed Gradle in c:\gradle and configured Android Studio File->Settings->Build, Excution ..->Gradle to point to this installation. 

If you try to rebuild the project, you still get:

Error:Could not find
Searched in the following locations:
    file:/C:/Program Files/Android/Android Studio2/gradle/m2repository/com/android/tools/build/gradle/3.5.0/gradle-3.5.0.pom
    file:/C:/Program Files/Android/Android Studio2/gradle/m2repository/com/android/tools/build/gradle/3.5.0/gr…

How to Prevent Excessing Use of Wifi Connections by Windows Update (Windows 10)

How to Prevent Excessive Use of Wifi Connections by Windows UpdateGlasswire is a mostly-free bandwidth monitor for Windows PCs. It probably does a few other things too. One of the nasty things Windows will do it start updating the operating system just when you are watching a live show online with very limited data bundles. All of a sudden, Windows decides out of it's great WISDOM, that when you are almost out of bundles in the middle of this crucial show is the best time to start downloading massive updates.

Bad thoughts flash through your mind but you manage to get hold of yourself. Who do you blame anyway? Some anonymous software engineer in Redmond, WA??

The thing is, you need to sort out this mess. There is an easy way of preventing Windows from misusing your bundles via a Wifi link: Set the Wifi link to be metered.  How?

The sequence is illustrated below. It goes like this:
Press the Windows key to get the Start menu (assuming Windows 10)Click the gear icon to get the Settings m…

How to Rotate Your Web Page Background at Radom

How to Rotate Your Web Page Background at Random
Problem: I want my web page background image to change every time the page is loaded by picking an image at random.

The images in this solution are all prepared in advance. They are all named live#.jpg where "#" is a number between 1 and whatever the number of images you have.  Hence they are named:

live1.jpglive2.jpglive3.jpg........The naming system simplifies the script that will be used to load the images.
The approach adopted is a three-step algorithm: Create an array of the file names for these image files in a certain folder. In my case, the folder is called "slides".Count the number of files. There are possibilities of counting sub-directories and . and .. if not careful. In this solution, we ensure no subdirectories are in the target folder and do a little arithmetic to eliminate the .. and .. folders.Generate a random number based on the number of files in the target folder and append this number to the base nam…

"A component of the operating system has expired"

While trying to install a trial version of Windows 2008 server, my PC refuses to boot from any device and instead reports the following:

Your PC/device needs to be repaired.  A component of the operating system has expired. File: \WINDOWS\system32\winload.exe Error code: 0x0000605
After a little research, I discovered that the problem is that a certain file, winload.exe, was set to expire at a certain date. See for example:
During booting, select Setup. Different computers use different keys for this. Some could be Esc, Delete, F2 and so on. On my PC it is F10.
Change the date in BIOS to some date before 2015. You may have to experiment but the principle is that the BIOS date should be earlier than the expiry date. I set mine to 2008 and all was well.

The Tensions of this Realm

The Tensions of this Realm The earthly realm has its struggles. The most fundamental are those to do with our being and identity. Being is fact, not philosophy. Whether we are butterflies or mountains, we are. But beyond being and all its attendant mysteries, is the practical strife for sanity and balance in an increasingly insane world. 
This blog article is an attempt to list the sources of tensions in out spiritual (yes, spiritual), social and vocational existence - and in our relationships with the Creator. Some do not believe in a Creator but nonetheless, if you deny the existence of air that denial does not change the reality: You will continue to breathe and live.  Therefore, from minute to minute, moment to moment, life is full of tensions. Here are some of them. Add the details for yourself. Extend the list yourself. After all, its your life...
1 Digital vs Analogue
2 Left vs Right
3. Christ vs The Rest
4. Educated vs Uneducated
5. Internationalised vs Localised
6. Tribal culture vs…

How to Save Windows Print Screen (PrtSc)

How to Save Windows Print Screen (PrtSc)Its as easy as ABC. The key on your keyboard with the letters "PrtSc" (or "Print Screen") takes pictures of your entire screen. If you press Alt and PrtSc at the same time, it takes pictures of the currently active window that is open on your screen.
But none of these options saves the picture to file. Instead, the picture is saved in the Clipboard. You can Paste this picture into a Word document or any other application that allow images to be inserted which includes most graphics editing software.
In order to save the picture to file, press the Window key at the same time as PrtSc. This will take the picture of the active window and save it on your disk. This command will save the image of your screen to a folder called Screenshots in your pictures folder as a .png file. Normally, your Pictures folder and Screenshots will be at this location:
"UserName" is your user name on that…

Updating to Android Studio 2.3 - "Cannot delete" file Error

Updating to Android Studio  2.3 - "Cannot delete" file ErrorAndroid Studio can be a challenging IDE to get going with. Customizing settings, connecting to version control systems, configuring the interface, updating... There are enough sources of headaches to thoroughly demoralize the new developers. Recently, while updating to a new version of Android Studio (2.3) in Windows 10, I came across a very stubborn error that looked like this in the console window:
Cannot delete file C:\Program Files\Android\Android Studio1\gradle\m2repository\com\android\tools\layoutlib\layoutlib-api\24.5.0\layoutlib-api-24.5.0.jar
Unfortunately, the error always appears in the last stage of the update as a patch is being applied. It appears that this stage requires API level 24.5 libraries be deleted and replaced with API 25.2 and 25.3 libraries. Attempting to delete the .jar file [layoutlib-api-24.5.0.jar] manually results in an error saying the file is opened by the Java SE process or some simi…

Simplifying Life with CSS Frameworks

Simplifying Life with CSS Frameworks Responsive Design, Mobile First, Material Design, UX, IxD...You can choke on technology. It's coming fast and furiously. The biggest challenge of the 21st century may be how to simplify life. How to do one thing at a time when you have five LCD screens blinking at you all the time each with multiple notifications, announcements, ticker tapes, breaking news and all the rest of it.

I can't solve all your life's problems but can share a little trick or two here and there. If you gather all these tricks, you could actually simplify life. 

Mobile First This is a recent approach to website design. In Kenya 97% of web users use their mobiles.  Few have computers, many have smartphones. Therefore, why make websites for computers when these are the minority? Why not make them for mobile first and adjust to fit the few who visit with computers.

The chart below shows the data from Google Barometer for Kenya:

Mobile access is at 97% compared to 17% f…