Delphi Projects News Source Code

Android Screen View

Android Screen View UI

People have asked for a copy of the utility I wrote to view the attached Android device on the screen. It uses the built in screencap functionality of Android and the ADB (Android Debug Bridge) to grab and display a series of screenshots. It requires the Android SDK installed and does not require a rooted device.

The speed of update has to do with the screen resolution and image complexity. Simple screens (text and controls) update about twice a second. More complex screens (pictures, graphics, etc.) are slower than that.

For best results, turn on “Show Touches” under debug options.

It also supports saving a PNG to file.

Get the source:

Download the build:

There are a few pending features that I just haven’t gotten to. If you’d like to contribute let me know. Thanks to Stephen Ball for all his contributions already!


GExperts for XE5 Experimental Build

My good friend and Delphi MVP Jeroen Pluimers has just posted an experimental build of GExperts for XE5. He is working with Erik Berry to get an official build up on the GExperts site.

GExperts is a collection of open source productivity enhancements for Delphi.

[Download Experimental Build]

Source Code

Mobile Location on iOS and Android

Most Android and iOS devices either include a GPS antenna, the ability to triangulate off cellular or wireless access points, or some combination. Accessing the location is different when using the platform APIs for iOS and Android. Luckily Delphi XE5 includes the TLocationSensor component. When activated it has a OnLocationChanged event which fired when the location changes more than the specified distance. In there simply examine the NewLocation.Latitude and NewLocation.Longitude to know the current location.

Learn more about multi-device, true-native app development with Delphi XE5 and check out other Mobile Code Snippets.


Tips for Solving Bugs

Ars Technica has compiled some tips for solving bugs quicker from a question on Programmers Stack Exchange. Here are the highlights:

  • Break out the notebook – keep a log of your progress and methodology
  • Look for patterns and use the right tools for the job.
  • Self-reflection time – a non-technical approach.
  • Read and apply¬†Working Effectively with Legacy Code

Danny Thorpe, former Borland Chief Scientist, had a conference session on Reading Tea Leaves: The Fine Art of Debugging. Luckily Joe White took some great notes, and Danny revisited some of his tips in another Stack Overflow answer.

I’m curious what tips and techniques you have for solving bugs, especially those really nasty ones. Are there specific tools your use? I know there is a lot of functionality in the Delphi debugger, much of which is rarely used to its fullest potential.