Tuesday, June 12, 2012

Simple HTML Counter - count on tap - for Touchphones Android/iOS etc

I have a practice of chanting daily. For that I used to use a mechanical counter. Many times I bought that and it broke. I have a Android Smartphone. This time I made a small HTML page that will count on finger tap anywhere on mobile screen. The good thing in this is, when I walk, I can tap anywhere in the screen without seeing the screen and the count occurs unlike many other apps that contains a specific button to be pressed for counting. I made this thing for my personal use, but thought of sharing with people of similar requirements

Screenshot:  (In device: Tap anywhere on screen, count increases) Tested and working in Android and iOS (its HTML, device independent)
from your mobile browser. If you want the code to be hosted online and follow from step 5 below

OR If you want to have it offline without Internet, follow the steps

1. Create a new file called "simplecounter.html"
2. Open it with any text editor (notepad, etc)
3. Paste this code in it
<!DOCTYPE html>
<title>Simple Counter by Hobby Coders</title>
<div id="count">0</div></h1>
<font size="1">&copy;2012-13 HobbyCoders.com</font>
<script type="text/javascript">
var count=0;
var countPtr=document.getElementById('count');
document.addEventListener('touchstart', function(e){e.preventDefault(); count++; countPtr.innerHTML=count;}, false);
4. Copy this html file to your mobile device
5. Open this file in Android/iOS browser. Tap anywhere on the screen to count up
If in android it doesnt work in default browser, do this
RECOMMENDED FOR ANDROID: Install this file manager app from Google Play (https://play.google.com/store/apps/details?id=com.rhmsoft.fm) and open the html file with the "HTML Viewer" of this app. It works neat and clean
6. People who dont require hi-fi app for counting, people who just need such an app for chanting or similar purposes can use this app
7. And I didnt complicate the app with save last count, reset etc because, you go back from app and open it again in browser, count resets, and press Home key, the browser goes to background and you can continue later from the same count (multitasking)

1 comment:

  1. hi
    i new to mobile applications.i have one requirement . app like uber app.
    image continuously moving when location changed.we are using our own frame work. how to develop that app by using which tech.
    thanks in advance