Deprecated Constructor in PHP Class

Still converting old PHP code and upgrading to PHP 7.0, I receive a message like this:

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Validate_fields has a deprecated constructor in

Looking at the code I see this:

class Validate_fields {
var $fields = array();
var $messages = array();
var $check_4html = false;
var $language;
var $time_stamp;
var $month;
var $day;
var $year;

function Validate_fields() {
$this->language = "us";

The message means that the class name Validate_fields and the constructor function Validate_fields() have the same name. The solution is to use a __constructor() instead of function Validate_fields().
Something like this:

class Validate_fields {
var $fields = array();
var $messages = array();
var $check_4html = false;
var $language;
var $time_stamp;
var $month;
var $day;
var $year;

function __constructor() {
$this->language = "us";

The error is no more.

Use pre Tag to Format Your PHP Code in WordPress Posts

Taking advice from Writing Code in Your Posts, I am now using only the pre tag to fromat the PHP code in WordPress posts. It will look like this:

	if (isset($_POST['h_sys_submitted'])){	
	    $h_sys = safeEscapeString($_POST["h_sys_submitted"]);
	} else{
		$h_sys = '';
	if (isset($_POST['asc_turned_to_submitted'])) {	
    	$asc_turned_to = safeEscapeString($_POST["asc_turned_to_submitted"]);
	} else{
		$asc_turned_to = '';

Change real_escape_string to mysqli_real_escape_string for Function safeEscapeString in PHP 7.0

I often use function safeEscapeString from  in my PHP projects. It helps sustain the integrity of data coming to and from MySQL or similar database. However, if the code ran on PHP 5.4 or 5.6 at the highest, and I wanted it to run PHP 7.0, the latest and greatest version of PHP. When the error reporting is turned on, a fatal error in code will appear. The solution is to use the recommended function mysqli_real_escape_string, which takes two parameters, the link and the string to sanitize.

$temp2 = mysqli_real_escape_string($link, $temp2);

Since I had not had a special link to a database, I just added one to get the $link variable (as shown here):

$link = mysqli_connect("localhost", "my_user", "my_password", "my_db");

The complete function looks like this:

Function safeEscapeString($string)
$temp1 = str_replace("[br]", "", $temp2);
$temp2 = str_replace("[br /]", "", $temp1);

if (get_magic_quotes_gpc())
return $temp2;
$link = mysqli_connect("localhost", "my_user", "my_password", "my_db"); 
if (!$link) { 
echo "Error: Unable to connect to MySQL." . PHP_EOL; 
echo "Debugging errno: " . mysqli_connect_errno() . PHP_EOL; 
echo "Debugging error: " . mysqli_connect_error() . PHP_EOL; 
exit; } 
} else { 
echo "Success: A proper connection to MySQL was made! The my_db database is great." . PHP_EOL; 
echo "Host information: " . mysqli_get_host_info($link) . PHP_EOL; 
$temp2 = mysqli_real_escape_string($link, $temp2); 
mysqli_close($link); return $temp2; 

How To Pack And Send Your Android Studio Project

If you are working as a developer for a client or if you are creating your own app in Android Studio and want to send it to a developer, here is what you do. In a nutshell,

— find the folder where the app resides in,

— turn it into a zip file,

— post it on some Internet server and send me the link

— so that I can download it and, of course, unzip it.

If you are using Android Studio on a Windows machine, that would look like this:

  1. Tap on the app row in the upper left most part of the Android Studio window.

    Click in app row to select the entire app in Android Studio

    Click on app row to select the entire app in Android Studio

  2. Right click on app row to get the menu
  3. Left click on Show in Explorer and you will get to the folder for the app.
    You will get the app folder for the app, in the middle of the app, so to speak

    You will get the app folder for the app, in the middle of the app, so to speak


  4. Get the parent folder (one folder up in the hierarchy)
    One folder higher in the hierarchy you will get the entire app for zipping

    One folder higher in the hierarchy you will get the entire app for zipping

    Incidentally, you see here how I create backups of my app during the development.

  5. Right click on the folder for the app and zip it.
    Right click on the folder to zip it

    Right click on the folder to zip it

    The rest will depend on the upload service you use —,, your own server etc. Then send me the link, I shall download it and that’s how you send your Android Project to a developer for further development!


Toothache Help Android App

Click here to download the Toothache Help Android App from the Google Play store.

Gastritis Help App Available Both in Google Play and App Store

Try to relieve gastritis by using alternative medicine methods from this app.

Would you like to relieve stomach pain, gain confidence, relax, have control of your life again and achieve your work duties and social goals!

YouTube Direct

You can download an iOS Gastritis Help from App Store or an Android version from Google Play.

With this app, we have compiled ancient remedies for gastritis. We give you only the successful ones. Here is the table of contents:

–What is gastritis?
–Gastritis symptoms
–Herbal cures
–Chinese herbal cures
–Homeopathic remedies
–Bach Flower remedies

How to use the Gastritis Help app?

There are three important buttons:

Your Therapy


Description of remedies

First tap on Symptoms and then tap on one or more icons that say Your Therapy. You will see a short message (“toast”) that the symptom is entered into the therapy.

You can select all symptoms that you want now or later, it does not matter. Once entered, you will be able to delete the chosen symptom with a click of a button.

Then tap on various groups of remedies. Typically, these will be Homeopathy, Bach Flower remedies, Ayurveda and others. Visit these therapies and tap on icon to select the remedy and enter it into the chosen therapy.

Finally, tap on Your Therapy. You will see a list of symptoms (in orange) mixed with a list of remedies (green) that you have selected. Taken together, the symptoms and the remedies form your therapy. Now all you have to do is obtain the remedies and start the process of eventual improvement of your health.

The whole process takes less than five minutes but will cut down the time to search for remedies. We have chosen only the proven remedies from various types of healing so let this be a firm base for further research of yours. In the meantime, you undertook the first step towards the change of your life.

If the symptoms change, you may repeat the entire process.

The app is free and is supported by (hopefully non intrusive) ads. This app belongs to a wider group of apps that may be able to help you improve your health. Please visit the option Other apps to see what else do we have.

You can download an iOS Gastritis Help from App Store or an Android version from Google Play.

iOS App Approved in Three Days

It took Apple 20 hours to reach the In Review status for a newly submitted app. The review phase lasted three hours — the app was rejected because of small fonts for iPad. After submitting new build and version it again waited for review, but only for an hour. The review phase now took only ten minutes and the app was approved.

This is not exactly a “1 day” process, more of a “3 day” process, but still very good.

The app, by the way, is called Gastritis Help. Choose your symptoms and choose remedies from various alternative healing methods such as Homeopathy, Ayurveda, home remedies etc. to decide upon your therapy. The link for the app store is:

The link for the Android version of the app is:

List Of My Services and Prices

Here is a list of my services and prices, mainly for apps but a few related areas as well

Turn your Kindle ebook into an Android app

You have already published a Kindle ebook, it is live in the Amazon Kindle store and you have all the files you used to publish it there.  That is a start for me and we should decide what is the purpose of that app. Some ideas:

cross promotion with your other apps and sites,
promotion of your Kindle ebooks,
monetisation through ads in the app,
forming an email list etc.

The price for this kind of service starts at $300 for Android but the final price can be greate, depending on what else needs to be done to make the app useful.

Turn your Kindle ebook into an iOS app

Similar to previous, starts at $300 and up.

Turn your Kindle ebook into both an Android and iOS app

I can derive apps for both Android and iOS from one kernel so ordering both at the same time can be somewhat cheaper than just a double price for one platform.

Please note that this does not mean that for $600 you can have two finished apps. There are other costs to incur, maybe a new piece of software needs to be written to accommodate the requirements of your app, the app may need new graphic design, it also needs to be submitted to the stores, which costs extra and so on.

Create a showcase app for you and your company — turn your site into an app

Yeah, sites can be “mobile” but the only real thing is an app designed for that kind of device, in the native language of the device.  In this “site to app” service, I’d take most of the content from your site and make it available on the device. When you publish a new article on your blog, it should appear automatically in the app.

Prices for this kind of service start at $500.

Create a professional app for you

Like the previous, but enriched with live RSS feeds, direct posting to Twitter and Facebook from the app, YouTube videos, your blog, search within the app, live accounts within the app (register, forget password etc.) and so on. The price would start at $900.

Create a large, new, original, one of a kind app for you

You have a great new idea, a new angle on an old idea, whatever. You will probably also want everything in the “professional” app and more. Prices for this kind of originality start at $3000 per app per platform.

Create a back end plugin in PHP for the plugins for Android and iOS

If the plugin needs to access data on the server, add another $300 to the mix. So, for example, plugins for both Android and iOS accessing the same database through PHP, would cost $$300 + $200 + $300 = $800.

Publish your Android app to your account in the Google Play Store

Once the app is finished and you agree that it is all you wanted it to be (under the circumstances and for the money involved), the app needs to be published in the store. There are two store of general interest, Google Play for Android and App Store for iPhone / iPad. To get a finished app published in the requires a manual procedure that spans a couple of hours of work — running the app, testing it, catching graphics from the app, entering description and other details in the store, creating appropriate icons and uploading them to the store, creating a new version of the app and so on. It tends to be an invisible part of app creation, but sometimes can take a lot of time and the stores are getting tougher all the time.

Frequently, that includes the need to repeat parts of the process and if the app was rejected, figuring out why and how to mend it — and then go through all of the steps of uploading it to the store AGAIN. So it has to be paid as many hours can be spent in that, rather unproductive way.

The price per submission starts at $100.

Publish your iOS app to the App Store

More or less the same as above.

Publishing ebooks to Amazon Kindle store

Kindle ebooks are not apps but share many of the similar steps in the process of preparation and publishing. Prices for this start at $300.

Publishing paper books on CreateSpace (Amazon)

Ideally, you already have a Kindle ebook ready and you want to offer it in paper. The prices for this also start at $300.

Create a WordPress site for your apps business

Another time consuming set of tasks. Prices start at $300.

Create promotional videos for your app

This is optional in theory, but very much needed these days. Visitors of app stores are getting pickier than ever and want to see the video before downloading anything. For Androd, the video can be a couple of minutes long and the rules are not so strict. The video will reside on YouTube and may serve as a generator of traffic in itself.

For the App Store, the video resides on Apple servers and must be no longer than 30 seconds, and the rules are stricter than for a general YouTube video.

YouTube Marketing for your apps, sites, ebooks etc.

While Apple is somewhat strict about their apps promotional videos, there’s nothing to stop you from making a promotional video or two and put on YouTube. The price for this starts at $200.

Email marketing for your apps

The money is in the list, remains as true as always. While it is not much of a problem to put a form to gather the email address into the app, the real power of email marketing lies in email autoresponders, which will send your predefined selling messages to the owners of those email addresses. The only way to be efficient with autoresponders is to use a paid service and to set it up, takes time and that is what you would be paying under this service on this site. The prices start at $200.

Create AdMob ads in your app

One way to monetize your app is to use ads. To really make money with ads, you should have a very popular app, however, you will get some money in every case you implement ads. Technically, putting ads into the app is sometimes easy and sometimes not, depending on many things. If it’s bound to consume my time, it must be a paid service and the prices start at $200 (but what this really entails must be agreed upon on the spot, for each particular app.).


Hosting with an Internet provider

If you already have your own domain / site, that can do. The hosting service must support PHP, MySQL cPanel, HTML, Apache and so on, but most hosting services will do that already (if its not a Windows server). You will pay monthly to the hosting provider, depending on the type of account, you will pay from 10-odd buck up to $50 or $97 per month.


Porting Kindle Ebooks To Google Play and App Stores, in English and Chinese

I have successfully ported my own Kindle books to apps and I have done that for other publishers. Here is an example of my work for another publisher, for Android:…

End Time Series, Numerical Roots in Bible

Numerical Root Calculator App in the Google Play Store


and here is the same account in the App Store:…/numerical…/id1063163615…

Numbers and Roots of Numbers in the Bible

Numerical Root Calculator iOS App in the App Store


Here is the book that the apps were ported from, in the Kindle store:…/dp/B00IDW25PA/ref=sr_1_1…

Numbers and Roots Of Numbers in Bible English Edition Kindle ebook

Numbers and Roots Of Numbers in Bible English Edition Kindle ebook



Problems in Porting Kindle Ebooks to Android and iPhone / iPad Apps

I have developed specialized software for porting Kindle software files to Android apps in a matter of minutes, back in 2013. So that part was under control and I was confident that I could port anything from HTML files to Android relatively fast. However, although the ebooks in the End Time Series were developed for Kindle, I was presented with MS Word files instead of pure HTML. Word is notorious for its bad handling of the HTML and this time it was no better. I had to manually divide the main book file into chapters, as that is what the Kindle to apps software of mine expects. Then there was the case of several special characters, which look very professional on paper, but just do not matter in HTML pages and apps which read those pages. Converting these characters had to be done from file to file, almost by hand, all of which took much more time than I expected.

Once the initial preparation was done, I still had to insert the codes for software to work with. You would expect that the chapter headers would be properly formatted in Word, but that was not the case either. One chapter was extremely long and that is not readable on most phones (and not even very well on tablets), so I had to divide it into several chapters, again.

Once that was done, and since the ebook was to be converted to both Android and iOS at the same time, I used the same core files for both. With the framework that I used, that is not only possible, but it is the preferred way: once you finish the app on your server, you should be able to publish it without changes on both platforms. Yeah right, when I finished everything, the display of HTML pages, the ones with text from the ebooks, was too small. That is, the fonts were so small that it was virtually unreadable. Once I realized the problem, the easiest way to solve the readability problem was to write a completely new plugin for display of the HTML pages — I called it HTMLBook. It does what Custom HTML, HTML Pro and other similar plugins do — read in the HTML page and do something with it, except that now you also have a new button at the bottom of the screen, which enables to dynamically change the size of font AND reformat the text properly. I shall describe the HTMLBook plugin in another post, but suffice it to say that this was another time sinking hole — just when I thought the app could be published, I had to develop an completely new plugin, for both platforms, with totally different solutions underneath.

Publishing Apps in English and Chinese

These ebooks originated in Chinese and were translated to English, so the publisher wanted to have both versions of the apps, published in both stores. As you can see from the above links, that makes for two English and two Chinese apps for Google Play and another two English and another two Chinese apps for the App Store. The publisher was kind enough to translate several hundred of simple apps messages to Chinese (Downloading, Something is wrong… etc) and of course, he provided the Chinese texts to turn in to apps. Images and text in icons had to be changed but, thankfully, the overall structure of the apps was always one and the same, which made everything not only easier but possible, too.

To translate the Android app, I used the facilities that the Android environment already offers to that purpose — various string constants in two languages, hidden so that the Android software still knows which are the right ones to choose, so that was not so bad. For iOS, the translation almost turned into a hack. Both the English and Chinese the sentences are in the very same plugin, and there is one switch in the control panel of the HTMLBook plugin that selects from English or Chinese version.

The end result, when everything was ready, was automagical. Select English, and you have a complete app in English, both for Android and iOS, and then you select Chinese, and once again, “with a press of a button”, you get the Chinese versions of apps, ready to be published in the stores.

Once these technical hurdles were under way, I had to make the best use of the new apps for the benefit of the publisher.

Should Apps Duplicate Ebooks Or Should They Be Original On Their Own?

In my opinion, apps can do more that ebooks, and to do that, they have to be interactive. The user is automatically interested in anything they type into the app and get the result back, so that’s what I did.

My idea was that you do not simply put the content from the book into the app, as that would not easily pass into the App Store. So I have developed a special plugin that does complex calculations that the Kindle book is based upon and try to interest the potential readers to get the original book in some way.

When someone visits the Kindle part of Amazon, they already have an intention of buying something. Alas, visitors of the app stores usually want things free and it would be really unusual for someone to spend 9 bucks to buy the app with the book content (while they will do that on Kindle). So these apps ended up as “loss leaders”, with three chapters from the books free, with a plugin to calculate free and with a possibility of getting the users email address to form a list.

Other approaches are possible: if the book creates its own universe, the app for the book could a game of some kind, or at least contain a quiz. But for me, forming an email list should be a priority for an app that converts from an ebook. Then you can lower the price for your ebook on Kindle and send the notification or email to your app list… boom!

Maps Overlayed — User’s Manual for the New Plugin

Starting with Relocation Map, we come to the new Maps Overlayed plugin. It is a strict superset of the Relocations Map plugin. Section Map Overlay Behavior provides a switch:

Switch for map overlay behavior

Switch for map overlay behavior

Operate as normal map

If this is chosen, the entire plugin behaves as if it only were the Relocations Map plugin. The data you enter in the Map Locations section will mostly work. None of the sections and fields connected with overlays will work, at all.

Operate as overlayed map

All fields and sections for overlayed data will be avaible and working. This is the default for this plugin.

The next section is

Overlay Coordinates

Overaly coordinates define the rectangle that will be overlayed with active elements.

Overlay coordinates define the rectangle that will be overlayed with active elements.

The basic idea of the Maps Overlayed plugin is to define a rectangle on the map onto we want to concentrate the attention of the viewer. Not only that, we want to overlay — put a picture onto that rectangle — so that we both see elements of the picture and of the map beneath it. Furthermore, the overlay should zoom or relocate with the original map.

If we put a solid picture onto the basic rectangle, we will not achieve much. The goal is to put pins, images, circles… whatever have you as active elements that the user can further touch and see information beyond it. In case of standard pins, it is possible to touch the pin and a further callout shows, with the address of the pin and if we touch the calout, we can be transferred to the screen “beyond the mirror”. In that way, the entire map with pins can act as an elaborate menu, scattered across the screen.

A rectangle is defined as a set of four vertices. Each vertex is a point and here a point is an ordered pair of coordinates. The first number is called the latitude and has a value between 0 and 90 degrees. It usually is a decimal number. If positive, it denotes the Norther hemispere, if negative, it denotes the Souther hemisphere.

The second number is called the longitude and is a number between 9 and 180 degrees. If positive, it is denotes values Eastern of Greenwhich, if negative, it is to the West of Greenwhich.

For instance, 34.4248,-118.5971 is on Norther hemisphere, and to the “left” of the Greenwhich meridian. It is somewhere in North America, to be precise.

Instead of entering all the four vertices of the bounding overlay rectangle, it is customary to enter the middle point of the rectangle, and three vertices, namely. top left, top right and bottom left. The plugin will compute the remaining bottom right vertex, automatically.

If none of these coordinates is entered, the plugin will take the center of the map as a middle point, which will show itself as an empty place over the blue ocean on the map. You will have to pinch the screen many times to see some land, most likely in Africa.

There cannot be an overlay if there is no defining boundary so entering the data into this section is mandatory.

Overlay Image Section

The main purpose of this plugin is to overlay the image onto the map. However, you are not obliged to overlay it — maybe you do not have it yet, may be you have it are don’t find it sufficiently good for publishing yet, or simply, you have already overlayed other elements onto the map and you simply do not need the entire image yet. So, here is the switch:

You may not always want to include the image into overlays

You may not always want to include the image into overlays

If you choose the first option, to include the image, you should also enter the data into the rest of the fields of this section. They are the usual fields for images, so we shall not describe them here.

Overlay Boundary Section

The beauty of the Maps Overlayed plugin is that you can overlay various lines and polygons, not only an image. From the technical standpoint of view, all these shapes will boil down to a series of points, and the software will fill in the space from one point to the next in the series. We get a line, more or less irregular, but useful in many ways. In this section we define one such series of points to be a boundary of the territory that we want to explore with map elements.

It looks stunning and is very useful if you don’t know much about the amusement park, or a zoo, or a children’s playground that you want to visit. Where a standard map might show green for the trees, you may insert the boundary of the estate and make it very clear whether to go further in that direction or not, for example.

First, you can include  or not include the boundary into the overlay.

You do not have to include a boundary, even if you have it ready

You do not have to include a boundary, even if you have it ready

Then you can select the color of the boundary:

Change the color of the boundary at will

Change the color of the boundary at will

In the third field, Overlayed Boundary, we enter the series of points to represent the boudary polygon.

The textarea to define a series of points, which in turn definea boundary

The textarea to define a series of points, which in turn definea boundary

The order of points is important. It is customary for a real boundary to be closed. In order to “close it”, you should put the last point to be identical to the first point in the series.

Each point (a pair of coordinates) must be delineated by a semicolon, like this:

34.4313,-11859890; 34.4274,-11860246; 34.4268,-11860181;

Ideally, the semicolon should be the last character in the series. If it’s missing, the plugin is smart enough to add it before further processing so you are allowed to not enter that last semicolon.

In normal entry fields, you could enter each point in one row, press Enter on the keyboard, enter a new pair of coordinates, press Enter and so on. Unfortunately, the underlying software treats this entry field as a piece of JSON text. See the warning in the following image:

A JSON warning only because I pressed Enter after the second row

A JSON warning only because I pressed Enter after the second row

So, do not press Enter to denote a new row of data, or to separate the points!

The best way to prepare a series of points to serve as a boundary is to use an editor which can show invisible characters. Here is what the text input would look like in program Notepad++ fow Windows, after turning on the option View, Show Symbol, Show All Characters.

In Notepad++ you can clearly see where the problem end of line character lies.

In Notepad++ you can clearly see where the problem end of line character lies.

Deleting these non-printing characters gives us the final string to copy to the the entry field for the boundary:

Cleare the strange characters and get string to enter into the boundary field

Cleare the strange characters and get string to enter into the boundary field

Once you click on the save button, and the green message Saved! appears, the system will have entered the boundary points. You may also want to go to the very last part of the control panel screen and click on the save button for the section JSON Configuration Data (Editable).

Let me repeat that it is of overall importance to see a green message Saved!. If the message is not green but red, the data will not be saved. This is a known bug in the control panel software. In that case, go to the first section at the top of the document, Screen Nickname, and change the nickname a bit. For example, add a digit or two and don’t worry, that will be the only place to make such a change.

 Overlay Route Section

Section for routes is identical to the section for boundaries

Section for routes is identical to the section for boundaries

This is totally the same as the overlay boundary except that instead of a boundary, you take coordinates of any path in between two points in the map. The idea is to show a kind of “driving directions” between two attractions in, say, a zoo. There could be more such routes of interest so a possible expansion for this app would be to take into account several routes instead of just one.

 Overlay Characters — Colored Circles Section

This section will show colored circles on coordinates you decide upon. You enter a color in classical #FFFFFF format, followed by a point. So, it is color, latitude, longitude, followed by a semicolon, and so forth, for as many points that you want.

Points to draw colored circles

Points to draw colored circles