PHP on Windows Using WebMatrix Single Click Install

Running PHP to Test Websites on Windows PCs

PHP is a programming language that is popular for for adding powerful features to websites. What does PHP mean? PHP originally stood for Personal Home Page (after its inventor, Rasmus Lerdorf, wanted more features for his personal website), but now it stands for PHP Hypertext Preprocessor (creating a recursive acronym, which programmers like). PHP is easy to set-up and run on a Windows PC using the free Microsoft WebMatrix, an Integrated Development Environment (IDE) for building websites.

With the free WebMatrix package PHP on Windows is a single click install and allows website testing using IIS Express (the version of Microsoft Internet Information Server for Windows clients). This tutorial assumes that WebMatrix is installed and running on your Windows 7 or higher PC. If not see our article Develop a Website on Windows Using Microsoft WebMatrix to set it up and get a basic website going. Continue reading

hiberfil.sys Windows 8.1 Delete to Free Up SSD Space

Disable Hibernation on Windows 8.1 to Remove hiberfil.sys for More Disk Space

This article provides a tutorial on removing the Windows hibernation file to free up disk space when a small solid state disk (SSD) is used as the system drive. Please ensure you have a backup of any data and files you need to keep before changing system configurations. This article is for information only. System configurations can vary widely, therefore any changes made are at your own risk. If you’re confident with computers and understand the meaning of the hiberfil.sys file you can skip to the end of the article for the relevant command, which is to run powercfg -h off at the administrator’s command prompt, otherwise read on for a better understanding.

Background

Low Disk Space on a Windows SSDApart from low end systems a SSD drive is standard fitting to most computers and laptops. An SSD is also a common upgrade to older systems. A SSD is more expensive than a hard disk drive, as a result small capacity SSDs (less than 128 GB) may be used to keep costs down. Windows 8.1 requires 20GB for installation, modern computing demands soon eats into the the remaining space. A system can be configured to use a small SSD for the Windows system and a large multi-terabyte  hard drive for data storage (see Move My Documents and Other Personal Folders). Despite this, or if a second drive is not an option, the SSD may fill up quickly with normal use. Once the SSD is full the computer or laptop will not function properly, may not boot up, or show error messages at boot time. The worst case scenario is data corruption and loss, or even disk failure, when applications cannot handle running with no disk space available. Continue reading

List of IDEs for Android App Development, Which is Best for You?

Eclipse Alternatives for Android Application Development

An Integrated Development Environment (IDE) is an all-in-one solution that allows an application (app) developer (a.k.a. programmer) to perform the software development cycle repeatedly and quickly. That cycle is to design, write (or code), compile, test, debug and package the app software. For Android app development Google currently supports two IDEs (but read on for a list of alternative IDEs and languages):

  1. Android Developer Tools (ADT) – http://developer.android.com/sdk/index.html
  2. Android Studio – http://developer.android.com/sdk/installing/studio.html (in beta)

Both of these IDEs require the use of the Java computer language to write Apps. The first option uses the well established Eclipse IDE. The second option is based upon the IntelliJ IDE.

The Google IDEs and the Java language are not the only options for Android App development. Some developers might not need the power of Java or just don’t get on with C style languages. Some developers would like a single code base to support other platforms: Apple (iOS), Windows, Blackberry and the Web (HTML5). This is known as cross-platform development. Well there are plenty of alternatives to Google’s tools, see the following table for a list of Android app development IDE and computer language alternatives. Code can be written in different languages, like BASIC, HTML5 or Lua. Many of the alternatives are free to use, some open source, some restricted versions of paid for products. A few may not have a free version. Some will require the Android Software Development Kit (SDK) that comes with the Google tools to be installed. It is possible to install several IDEs onto the same computer to try them out.

List of Alternative Android App Development IDEs

Name Language C-P URL
AIDE (Android IDE) HTML5/C/C++ Yes http://www.android-ide.com/
Application Craft HTML5 Yes http://www.applicationcraft.com/
Basic4Android BASIC No http://www.basic4ppc.com/
Cordova HTML5 Yes https://cordova.apache.org/
Corona Lua Yes http://coronalabs.com/
Intel XDK HTML5 Yes https://software.intel.com/en-us/html5/tools
IntelliJIDEA Java No https://www.jetbrains.com/idea/features/android.html
Kivy Python Yes http://kivy.org/#home
Lazarus IDE+free pascal+LAWM Pascal Yes http://www.lazarus-ide.org/, http://www.freepascal.org/, LAWM
MIT App Inventor Blocks Yes http://appinventor.mit.edu/explore/
Monkey X BASIC Yes http://www.monkeycoder.co.nz/
MonoGame C# Yes http://www.monogame.net/
MoSync HTML5/C/C++ Yes http://www.mosync.com/
NS BASIC BASIC Yes https://www.nsbasic.com/
PhoneGap HTML5 Yes http://phonegap.com/
RAD Studio XE Object Pascal, C++ Yes http://www.embarcadero.com/
RFO Basic BASIC No http://laughton.com/basic/
RhoMobile Suite Ruby Yes http://www.motorolasolutions.com/US-EN/Business+Product+and+Services/Software+and+Applications/RhoMobile+Suite
Telerik HTML5 Yes http://www.telerik.com/platform#overview
Titanium JavaScript Yes http://www.appcelerator.com/titanium/titanium-sdk/
Xamarin C# Yes http://xamarin.com/

Table Notes:

  1. C-P, Cross-Platform, if No only Android supported, if Yes supports App production for other platforms (you will need to check if your required platform is supported).
  2. Language, HTML5 also includes the related technologies of Cascading Style Sheets (CSS) and JavaScript.
  3. AIDE and RFO Basic allows code to be developed on the go on Android devices. The code can be packaged into full blown Apps.

Support for Android Programming

This above list of free and commercial IDEs for Android shows that other languages can be considered when wanting to develop apps. Some of these Android options provide cross platform development from the same app source code. (For some IDEs the Android SDK will need to be installed.) Purchased commercial Android development packages will come with varying degrees of support from the company and the user base. Open source and free packages will be supported by the user and development community, and sometimes paid for support is available. Forums are a useful source of answers for Android development issues.

Microsoft are developing Cordova support for Visual Studio, see Microsoft’s Multi-Device Hybrid Apps web page.

Android NDK

Google provides for free the Native Development Kit (NDK) that allows programming in C or C++, see the Android NDK page for more information. Use the NDK to optimise time critical portions of an App. Google does not recommend it for general App development.

Setting Up Google’s Android IDEs

If you need help installing Eclipse or Android Studio see our articles. For a quick Eclipse set up see:

For Android Studio set up see:

For a step-by-step set up of Eclipse see:

Please let us know of any other Android development options you come across. It would be interesting to hear of any App successes from using any of the above packages, drop us a line at dan@tekeye.biz.

SoftwareDistribution Folder Delete in Windows

Clean Up The SoftwareDistribution Folder in Windows to Free Up Disk Space

A PC running Windows 8.1, Windows 8 or Windows 7 regularly performs a Windows Update. The updates improve security, fix bugs and add or change functionality. The files for the update download to a temporary folder from the Windows update site. Once the files have finished downloading in the background the update can be applied to the PC. The temporary folder is called Download under SoftwareDistribution in the Windows directory (unless in some rare occasions Windows is installed to a different directory), i.e. C:\Windows\SoftwareDistribution\Download. If trying to view this folder in Windows Explorer you may need to give permission and be logged in as an Administrator, as well as turning on Hidden items in the View menu (or via Organise and Folder and search options in Windows 7).

When the system drive runs low on disk space some free space may be reclaimed by deleting the Windows Update temporary downloads folder. Therefore a full SoftwareDistribution folder delete is not done, just the Download folder in that directory. The SoftwareDistribution\Download folder delete may fix problems that stop the Disk Cleanup utility from finishing. (The Disk Cleanup utility can take quite a while to finish and if still not finished after a few hours if may be stuck due to Windows Update conflicts.)

Apply Any Remaining Windows Updates

If the \Windows\SoftwareDistribution\Download folder delete is performed before Windows Update has installed existing download files then those files will download again. To stop this from happening ensure Windows Update has completed. Open Windows Update. In Windows 8 select Settings then Control Menu (or press the Windows key and X and select Control Panel from the menu that appears), enter Update in the search box and select Windows Update. In Windows 7 select Windows Update from All Programs off the Start button (or via Start then Control Panel then System and Security).

Select Check for updates to ensure that “No updates are available“. Otherwise Install Updates. (If low on disk space updates may fail to apply, try emptying the Recycle Bin, Deleting Browsing History in Internet Explorer or running the Disk Cleanup utility.)

Temporarily Stop the Windows Update Service

With all Windows updates applied stop the Windows Update service to safely remove the \Windows\SoftwareDistribution\Download folder. Run Task Manager (press the Ctrl-Alt-Delete keys all at once and select Task Manager or Start Task Manager from the menu). Click the Services tab. Sort the list by name (click the Name column). Browse to the wuauserv entry and check the Status column. If it says Running stop the wuauserv service. To stop the service select Open Services at the bottom of Task Manager (or the Services button in Windows 7 Task Manager).

In Services click on the name column to sort the service alphabetically. Locate Windows Update. Select Stop the Service from the left hand column above description, or double-click on Windows Update to open the properties and click the Stop button, then click OK to close the properties.

Using Windows Explorer rename the Download Folder in \Windows\SoftwareDistribution. E.g. bring up the context menu and slect Rename call it something like Download_old. Windows will create a new Download folder when it needs it, it will be empty until new Windows updates are available and are loaded.

On Windows 7 Restart the Windows Update Service

Windows 8 will start the Windows Update service when it needs it. In Windows 7 select Start Service in Services or double-click on Windows Update and select the Start button, click OK to close the properties.

Delete the Renamed Folder

In Windows Explorer delete the renamed Download folder. For example if it was renamed Download_old then delete Download_old. Permission may need to be given to do this, if so click Continue on the message box that appears.

The Windows Update temporary Download folder, under the SoftwareDistribution folder, delete has been completed.

ADT Android Bundle to Quickly Setup Android Development

Start Writing Google Apps on Windows

If you want to write Android Applications (Apps) you need the right software. Google provides free access to this software for Windows, Apple Mac and Linux PCs. An App is a computer program and like all programs it needs designing, writing, compiling, testing and debugging. This is all done in an Integrated Development Environment (IDE). There are many IDEs from which to choose. This article deals with the IDE provided by Google in the ADT Bundle for Windows. So read on for tips and information on installing and running the ADT Android bundle.

Use the ADT Android Bundle For Android Apps

Apps are written in computer language. Google’s preferred language for Android is the widely used Java. A popular IDE for writing Java programs is called Eclipse, from the Eclipse Foundation. The Eclipse IDE can be installed on to most PCs, including Windows PCs. For Android App development the Eclipse IDE requires the Android Software Development Kit (SDK) and the Android Development Tools (ADT), both from Google. All of these (Eclipse, SDK and ADT) are available in a large zip file from the Android Developers web site, the ADT Bundle for Windows.

Alternative Android App Development Environments

The ADT Android bundle is not the only option from Google. Instead of using the large zip file, install Eclipse, the Android SDK and ADT in separate steps. Good for those who need more control over the installation. (See our article Setup Android Development on Windows.)

A new option from Google is the Android Studio. Studio is currently under development so is only available under a beta release and thus subject to change. Studio does not use the Eclipse IDE, it uses the IntelliJ IDEA environment thus giving you a choice of editors. To set up Android Studio see our article Android Studio Install for Windows Based PCs.

Apps can be programmed in computer languages other than Java, using IDEs from companies other than Google. See the last section of this article for alternatives to using Java.

Install Java JDK

Java is Google’s preferred language for App development. As such the Java runtime and development kit needs installing before the ADT Android bundle. Go to the Java download page at http://www.oracle.com/technetwork/java/javase/downloads/index.html.

The Java Download Button

Select the Java download button and follow the instructions. Accept the license agreement and select the correct Windows installation EXE for your PC. (If unsure whether you are running 32-bit or 64-bit Windows use the System option in Control Panel. Under Basic Information the System type tells you if it is a 32-bit or 64-bit Operating System.) Run the Java installer to set up Java on your PC. See our article Installing Java on Windows (32-Bit or 64 Bit) if you need more help.

Download ADT Android Bundle

The Android SDK download page is at http://developer.android.com/sdk/index.html. Click on the Download the SDK ADT Bundle for Windows button. Accept the Terms and Conditions displayed by clicking the check box. Choose either 32-bit or 64-bit to match your Windows installation.

Another Download the SDK ADT Bundle for Windows button is enabled. Click the button to save the adt-bundle-windows-x86-YYYYMMDD.zip (32-bit) or adt-bundle-windows-x86_64-YYYYMMDD.zip (64-bit) file to your PC. Where YYYYMMDD is the release date for the package. E.g. adt-bundle-windows-x86-20130717.zip is the 32-bit ADT Android bundle released on July 17th 2013.

Extract Zip File Contents to Install Eclipse IDE and Android SDK and Tools

All the contents in the zip download need to be extracted. This can be done with Windows Explorer, however, on Windows XP you may get errors copying the files using Explorer. If so use an archive tool, such as 7Zip, to extract all the ADT Android bundle files.

The Android Developers website recommends extracting to a “Development” directory under your normal home location. However, that means a lot of program files are stored with your normal work. Some Android developers extract to C:\Program Files (this is a protected directory and you made be asked for permission to copy here), other developers install to a directory on the root of C: or other hard drive, such as C:\Android or C:\Development. Since the zip file contains a root directory named after itself simply copy that directory to a hard drive root. For example the contents of adt-bundle-windows-x86-20130717.zip can be extracted to C:\adt-bundle-windows-x86-20130717.

Add a Shortcut to Eclipse to the Desktop

Eclipse ShortcutTo access the App development environment quickly add a shortcut to your PC desktop. Using Windows Explorer open the eclipse directory in the extracted contents. Bring up the context menu (usually right-click) on the eclipse.exe program and select Create shortcut. Drag and drop (move) the new shortcut onto the desktop.

Run It!

The ADT Android Bundle is now installed. Run the eclipse.exe program (you can use the shortcut if you created one). First time in you will be asked to contribute usage statistics to Google. Select Yes or No and press the Finish button.

Create an Android Virtual Device (AVD) using the AVD Manager. An AVD allows testing of Apps without the need to use a physical device. Use the toolbar icon or select Android Virtual Device Manager from the Window menu. See our article Set Up an Android Virtual Device for App Testing for further information.

To test on a physical Android device install the manufacturers driver. With the driver installed use a USB cable to connect the device to your PC. You will need to enable USB debugging in the device settings.

Test your ADT Android Bundle installation by creating a simple App. See our article Your First Android Hello World Java Program. If you installed the ADT bundle to a drive other than C: you may get issues trying to run an App on an AVD. See our article Windows Symbolic Links for Android Installations on the D: Drive for a solution.

ADT Android Bundle Install Summary

Here is a summary of installing the ADT Bundle for Windows:

  • Download and install the Java JDK.
  • Download the ADT Bundle for Windows zip file.
  • Extract the contents to your PC.
  • Run it! (eclipse.exe).

Other Android App Development Options

If you struggle developing in Java, with the Google recommended IDEs for App development, there are other options. See our post Android Development Options, Tools and IDEs. It lists alternative development packages and languages.

Windows Symbolic Links for Android Installations on the D: Drive

AVDs Failing to Start if Eclipse is Not on C:

At Eye our machines are built for performance, shaving seconds of the program – compile – test cycle saves hours over the month. Machines have a small solid state drive (SSD) for the Operating System (Win 7 x64) and a big hard disk drive (HDD) for programs and work data. So Win 7 is on a C: drive and everything else on a D: drive. All users’ special folders are relocated to D:. For Android development Eclipse is installed with the Android Development Tools (ADT) Plugin onto the D: drive.

A lot of the initial development of an App is done using an Android Virtual Device (AVD). The AVD is set up using the AVD Manager. Once set up an AVD allows an App to be launched onto it via the Eclipse Run or Debug options. Unfortunately on some configurations where the user folders are on the D: drive, an error is reported when an AVD tries to start (even if the AVD Manager successfully created the AVD). A Starting Android Emulator dialog appears with an error message similar to PANIC: Could not open: C:\Users\Name\.android/avd/AVDName.ini.

AVD "PANIC: Could not open:..."  error

When debugging or running Apps ADT is trying to load the emulator from C: when it, and the configuration files for it, are on D:. One solution is to use a NTFS symbolic link, a.k.a a symlink. Setting up a symlink can fix the above error.

Open a command prompt in the user directory on C: (if you relocated all your special Windows folders to D: then there may only be a hidden Appdata folder in the user folder on C:). Use the mklink program to make a hard link to the .android directory on D:. If user John Doe moved all his Users files from C:\Users to D:\Users then the command to make the directory junction would be:

mklink /J "C:\Users\John Doe\.android" "D:\John Doe\.android"

mklink command for symlink (junction)

Now when the ADT plugin is trying to reference .android on C: NTFS redirects the request to D: and the emulator starts correctly.

(The mklink command is not shipped with Windows XP, to create a Directory Junction on Windows XP us the Sysinternal Junction tool.)

Move My Documents and Other Personal Folders in Windows 8.1, 8 and 7

A Tutorial on Moving User My Documents and Personal Folders to Another Drive

Default Folders are Created for Windows UsersEach user on a Windows computer (Windows 8.1, Windows 8 and Windows 7 and earlier) is given a private location on the PC into which they can store their work. This work can be pictures, documents, music, emails, videos and anything else that they use or generate. It is private because other users cannot view their files (unless they are logged in as an Administrator). When a user logs on they can work with their private files and any Public files. To let other users see their work it needs be moved or copied into the relevant Public folders, or a directory needs to be marked as shared.

Root Users FolderThe default installation for Windows is to put all the users folders onto the same hard disk drive as the operating system itself, usually the first, and only, hard disk in the system, called the C: drive. This drive will also hold any additional programs that are installed. Each user is located under the Users folder on C:, so a user call John Doe has folders located at C:\Users\John Doe. Under the users main folder is a folder to store different types of files that programs generate or use. For example there is a Contacts folder (at C:\Users\John Doe\Contacts) to store, well, contacts (name, address, phone numbers, etc.). Use Windows Explorer to view the Users folders. Open Windows Explorer via the Start button, All Programs and Accessories, or in Windows 8.1 hold the Windows key and press E. The various folders created by Windows for the user can be seen under the user’s name from the Desktop icon (Windows 7) or under C:\Users\User Name in Windows 8.1.

Some of the folders are also accessible via the various Library icons. In Windows 7 in Explorer some folders begin with My, such as My Documents or My Music. However, the actual folder name on the hard disk does not have My, thus My Documents in Explorer points to C:\Users\John Doe\Documents. This table shows the folder name, the display name in Explorer and whether or not a public version is available, located at C:\Users\Public (this folder itself can be used to make files public).

User Folders
Folder Win 7 Name in Explorer Public Version
Contacts Contacts  N/A
Desktop Desktop  Public Desktop
Documents My Documents  Public Documents
Downloads Downloads  Public Downloads
Favorites Favorites  N/A
Links Links  N/A
Music My Music  Public Music
Pictures My Pictures  Public Pictures
Saved Games Saved Games  N/A
Searches Searches  N/A
Videos My Videos  Public Videos

Locating all the user folders on the one hard disk drive along with Windows and all the programs makes configuration and manufacture of a new computer easier. Unfortunately it has several disadvantages: Continue reading