SlideShare a Scribd company logo
1 of 34
By : Dov Goldberg
                        Tikal
                 GTUG 2012




Using Phonegap
Who am I
1) My name is Dov Goldberg
2) I am the Mobile Development Lead at Tikal.
3) Currently creating the MyHeritage Mobile iOS app.




                                               WWW.TIKALK.COM
Time Tracker App
1.   Every month employees are required to submit hour reports
2.   Time consuming.
3.   Repetative.
4.   Boring.




                                                       WWW.TIKALK.COM
WWW.TIKALK.COM
WWW.TIKALK.COM
Tikal Time Tracker
1)My Phone is always with me.
2)My Phone knows where I am.
3)My Phone can log my hours for me!!!




                                        WWW.TIKALK.COM
OR




     WWW.TIKALK.COM
Cross Platform?
1)Support Many Platforms.
2)Open Source.
3)Free.
4)Deploy to app stores..




                             WWW.TIKALK.COM
What is Phonegap?
1)Build apps with HTML that can access native APIs.
2)Cross Platform.
3)Deploy to app stores.
4)Open Source.
5)Acquired by Adobe in 2011.



                                             WWW.TIKALK.COM
Why use Phonegap?




                    WWW.TIKALK.COM
How Phonegap Works




                     WWW.TIKALK.COM
WWW.TIKALK.COM
WWW.TIKALK.COM
Time Tracker App
1. Use your phone to help you track your hours.
2. Import hour reports directly from the phone.
3. Hour reports completed in seconds!




                                                  WWW.TIKALK.COM
Time Tracker App
1. Support for iOS4 and up, Android 2.3 and up.
2. Uses Foursquare Venues Platform as Location Layer.
3. Use GPS hardware to monitor hours worked.




                                                    WWW.TIKALK.COM
App Pages



        1)   My Projects
        2)   Project Details
        3)   Events
        4)   Add New Project
        5)   Map View




                               WWW.TIKALK.COM
var Project = persistence.define('Project', {
  fid: "TEXT",
  name: "TEXT",
  address: "TEXT",
  latitude: "TEXT",
  longitude: "TEXT",
  currentlyHere: "BOOL"
});
App Pages



persistence.store.websql.config(persistence, 'tikaltimetracker',
'Tikal Time Tracker DB', 5 * 1024 * 1024);


 persistence.schemaSync(function(tx) { // callback });




                                                           WWW.TIKALK.COM
<div data-add-back-btn="true" data-role="page"
id="mainPage">
                        <div data-role="header" data-
position="fixed" data-theme="b">
                                    <a href="#eventsPage"
data-icon="grid" data-iconpos="left" class="ui-btn-left" data-
theme="c">Events</a>
                                    <a
onClick="retrieveLocations();" data-icon="plus" data-
iconpos="right" class="ui-btn-right" data-theme="c">Add</a>
                                    <span class="ui-title">My
Projects</span>
                        </div>
        <ul class="lstMyProjects" data-role="listview" data-
split-icon="gear" data-split-theme="d">
                         </ul>

       <script id="projectItem" type="text/x-jquery-tmpl">
          <li>
          <a onclick="showMapForLocation('${fid}');">
          <h3>${name}</h3>
          <p>${address}</p>
          </a>
          <a onclick="doShowProjectOptions('${fid}');">$
{name}</a>
          </li>
       </script>
   </div>
search: function(parameters, requestCallback)
                      {
//                                var parameters = {
//                                           requestCallback,
//                                           ll,
//                                           llAcc,
//                                           altAcc,
//                                           alt,
//                                           query,
//                                           limit,
//                                           intent,
//                                           categoryId,
//                                           url,
//                                           providerId,
//                                           linkedId,
//                                           radius
//                                }

var requestUrl = this.SEARCH_URL + client.requestQuery();
requestUrl += FourSquareUtils.createQueryString("&",
parameters);
FourSquareUtils.doRequest(requestUrl, requestCallback);
                       }
Map View
Time Tracker App
1. UI/UX designed with jQuery Mobile.
2. Geofencing, included with iOS 4+, monitors region.
3. Geofencing not included in Android. Oh No!!!




                                                        WWW.TIKALK.COM
What is Geofencing?



                      WWW.TIKALK.COM
WWW.TIKALK.COM
WWW.TIKALK.COM
Geofencing In Android

    Custom Phonegap Plugin
 1. Use WIFI hotspots to trigger location updates.
 2. Yes, WIFI must be on for this to work.
 3. When a new project is add scan for hotspots in the area.
 4. Location is scanned as recognized hotspots go in and out of
    range.




                                                       WWW.TIKALK.COM
Phonegap Plugin JS




                     WWW.TIKALK.COM
Java




       WWW.TIKALK.COM
Java




       WWW.TIKALK.COM
Java




       WWW.TIKALK.COM
Javascript


var params = {"fid": currentLocation.id, "projectname": currentLocation.name,
"latitude": currentLocation.location.lat, "longitude":
currentLocation.location.lng, "address": currentLocation.location.address};

DGPTimeTracker.addProject(
             params,
             function(result) {
      },
             function(error) {
      }
);




                                                                    WWW.TIKALK.COM
Questions???

               Thank You!
         All Source Available at:
 https://github.com/tikalk/TikalTimeTracker

               By: Dov Goldberg
           Contact: 0524871521
                    dov@tikalk.com


                                      WWW.TIKALK.COM

More Related Content

Recently uploaded

Recently uploaded (20)

GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 

Featured

Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Saba Software
 

Featured (20)

Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 

Mobile Development Using Phonegap

  • 1. By : Dov Goldberg Tikal GTUG 2012 Using Phonegap
  • 2. Who am I 1) My name is Dov Goldberg 2) I am the Mobile Development Lead at Tikal. 3) Currently creating the MyHeritage Mobile iOS app. WWW.TIKALK.COM
  • 3. Time Tracker App 1. Every month employees are required to submit hour reports 2. Time consuming. 3. Repetative. 4. Boring. WWW.TIKALK.COM
  • 6. Tikal Time Tracker 1)My Phone is always with me. 2)My Phone knows where I am. 3)My Phone can log my hours for me!!! WWW.TIKALK.COM
  • 7. OR WWW.TIKALK.COM
  • 8. Cross Platform? 1)Support Many Platforms. 2)Open Source. 3)Free. 4)Deploy to app stores.. WWW.TIKALK.COM
  • 9. What is Phonegap? 1)Build apps with HTML that can access native APIs. 2)Cross Platform. 3)Deploy to app stores. 4)Open Source. 5)Acquired by Adobe in 2011. WWW.TIKALK.COM
  • 10. Why use Phonegap? WWW.TIKALK.COM
  • 11. How Phonegap Works WWW.TIKALK.COM
  • 14. Time Tracker App 1. Use your phone to help you track your hours. 2. Import hour reports directly from the phone. 3. Hour reports completed in seconds! WWW.TIKALK.COM
  • 15. Time Tracker App 1. Support for iOS4 and up, Android 2.3 and up. 2. Uses Foursquare Venues Platform as Location Layer. 3. Use GPS hardware to monitor hours worked. WWW.TIKALK.COM
  • 16. App Pages 1) My Projects 2) Project Details 3) Events 4) Add New Project 5) Map View WWW.TIKALK.COM
  • 17. var Project = persistence.define('Project', { fid: "TEXT", name: "TEXT", address: "TEXT", latitude: "TEXT", longitude: "TEXT", currentlyHere: "BOOL" });
  • 18. App Pages persistence.store.websql.config(persistence, 'tikaltimetracker', 'Tikal Time Tracker DB', 5 * 1024 * 1024); persistence.schemaSync(function(tx) { // callback }); WWW.TIKALK.COM
  • 19. <div data-add-back-btn="true" data-role="page" id="mainPage"> <div data-role="header" data- position="fixed" data-theme="b"> <a href="#eventsPage" data-icon="grid" data-iconpos="left" class="ui-btn-left" data- theme="c">Events</a> <a onClick="retrieveLocations();" data-icon="plus" data- iconpos="right" class="ui-btn-right" data-theme="c">Add</a> <span class="ui-title">My Projects</span> </div> <ul class="lstMyProjects" data-role="listview" data- split-icon="gear" data-split-theme="d"> </ul> <script id="projectItem" type="text/x-jquery-tmpl"> <li> <a onclick="showMapForLocation('${fid}');"> <h3>${name}</h3> <p>${address}</p> </a> <a onclick="doShowProjectOptions('${fid}');">$ {name}</a> </li> </script> </div>
  • 20. search: function(parameters, requestCallback) { // var parameters = { // requestCallback, // ll, // llAcc, // altAcc, // alt, // query, // limit, // intent, // categoryId, // url, // providerId, // linkedId, // radius // } var requestUrl = this.SEARCH_URL + client.requestQuery(); requestUrl += FourSquareUtils.createQueryString("&", parameters); FourSquareUtils.doRequest(requestUrl, requestCallback); }
  • 22.
  • 23.
  • 24. Time Tracker App 1. UI/UX designed with jQuery Mobile. 2. Geofencing, included with iOS 4+, monitors region. 3. Geofencing not included in Android. Oh No!!! WWW.TIKALK.COM
  • 25. What is Geofencing? WWW.TIKALK.COM
  • 28. Geofencing In Android Custom Phonegap Plugin 1. Use WIFI hotspots to trigger location updates. 2. Yes, WIFI must be on for this to work. 3. When a new project is add scan for hotspots in the area. 4. Location is scanned as recognized hotspots go in and out of range. WWW.TIKALK.COM
  • 29. Phonegap Plugin JS WWW.TIKALK.COM
  • 30. Java WWW.TIKALK.COM
  • 31. Java WWW.TIKALK.COM
  • 32. Java WWW.TIKALK.COM
  • 33. Javascript var params = {"fid": currentLocation.id, "projectname": currentLocation.name, "latitude": currentLocation.location.lat, "longitude": currentLocation.location.lng, "address": currentLocation.location.address}; DGPTimeTracker.addProject( params, function(result) { }, function(error) { } ); WWW.TIKALK.COM
  • 34. Questions??? Thank You! All Source Available at: https://github.com/tikalk/TikalTimeTracker By: Dov Goldberg Contact: 0524871521 dov@tikalk.com WWW.TIKALK.COM

Editor's Notes

  1. Hello, my name is Dov Goldberg. I work at Tikal as the Head of Mobile Development. As an employee of Tikal, I have a pretty busy schedule working on various projects for our clients. The projects are interesting and challenging. Currently, my main project is with a company called MyHeritage. They are a genealogy site and help people build and maintain online family trees. I am helping them build their iOS application.
  2. Hello, my name is Dov Goldberg. I work at Tikal as the Head of Mobile Development. As an employee of Tikal, I have a pretty busy schedule working on various projects for our clients. The projects are interesting and challenging. Currently, my main project is with a company called MyHeritage. They are a genealogy site and help people build and maintain online family trees. I am helping them build their iOS application.
  3. Perhaps one of the most tedious tasks I have to do monthly at Tikal is reporting the hours I work and on what project. I have to open a special web portal and sort through all the projects I worked on over the last month. This process is pretty repetitive and very boring. It would be great if there was a better way to do this task. Talk about the purpose of the app This app was made to allow users to let their mobile phone keep track of the hours they worked at their projects. Uses Geofencing Phonegap plugin developed by me to detect when a user arrives and leaves one of their projects Allows the user to export the app data so it can be imported into your companies time tracking web interface. What tech was used to develop
  4. Perhaps one of the most tedious tasks I have to do monthly at Tikal is reporting the hours I work and on what project. I have to open a special web portal and sort through all the projects I worked on over the last month. This process is pretty repetitive and very boring. It would be great if there was a better way to do this task.
  5. So, after thinking about this problem for some time I came up with what I think is an ideal solution. A solution that involves very little interaction from me.
  6. I carry my Mobile Phone with me everywhere. I happen to have an iPhone 4. It is in my pocket at every project I work on. It has GPS technology which can be used to keep track of my location. So, why not let my phone keep track of where I am. Based on my location, my phone can log the hours I am at projects. Right, this seems so obvious now that I mention it.
  7. Now I have a great idea for a new mobile app. I want to build an app that can log hours based on my location and report those hours to tikal upon request. The next thing I thought about was what mobile OS do I want to support. I have an iPhone, but I think that most Tikal employees have Android phones. So I would have to choose, iOS or Android? I want to be able to reach the greatest number of users.
  8. I looked on the web and noticed that there are frameworks that claim to be &amp;quot;Cross Platform&amp;quot;. A lot of them cost money to use like Monotouch and Titanium. I wanted something that was free and open source. I soon discovered Phonegap.
  9. What is Phonegap? Phonegap is an open source app platform. It is based on familiar web technologies like HTML5, CSS, and Javascript. Additionally, it comes pre-packaged with &amp;quot;Plugins&amp;quot; that allow the Javascript to access native functions on the mobile device. PhoneGap is an HTML5 app platform that allows you to author native applications with web technologies and get access to APIs and app stores. PhoneGap leverages web technologies developers already know best... HTML and JavaScript. Divide into chapters Introduction to my application (why phonegap) Add new project screen Back end – geofencing You can see how this works
  10. Talk about the purpose of the app This app was made to allow users to let their mobile phone keep track of the hours they worked at their projects. Uses Geofencing Phonegap plugin developed by me to detect when a user arrives and leaves one of their projects Allows the user to export the app data so it can be imported into your companies time tracking web interface. What tech was used to develop
  11. Talk about the purpose of the app This app was made to allow users to let their mobile phone keep track of the hours they worked at their projects. Uses Geofencing Phonegap plugin developed by me to detect when a user arrives and leaves one of their projects Allows the user to export the app data so it can be imported into your companies time tracking web interface. What tech was used to develop
  12. Now that I know what framework I want to use I need to architect my app. I set out to plan how I was going to create this app. I would need a way to retrieve locations based on GPS. I thought about Foursquare. They have an open API that can be accessed by Javascript. The application would need to show the location on a map. Google Map API comes to the rescue and this, too, can be used via a javascript API. Once I determined that Phonegap was the ideal solution for my app I wanted to figure out what Javascript framework I would use. After searching on the internet I found that the top two frameworks are Sench Touch and jQuery. Sencha Touch seemed nice since it encourages MVC out of the box. After reading more about it I shied away from this solution since it coding it was tedious since it seemed all my code needed to be in JSON format. jQuery Mobile seemed like the most flexible solution. It has many plugins since it is based on jQuery and this allowed me to get up and running quickly.
  13. 1) My Projects - This is the main page of my app. Here the user can see a list of all active projects. Additionally, there are buttons for the user to add new projects and see events by month: (Picture of page) 2) Project Details - This page shows the current status of a project. The user can manually checkin or checkout and set the auto update feature. The user can also opt to remove this project altogether. 3) Events - This page allows the user to select a month and year and display the projects and hours worked. The send button will create a TSV file for each project and email them. 4) Add new project - This page retrieves nearby locations from foursquare and allows the user to add them as current projects. The user can also select to see the project on a map before adding. 5) Map View - Shows the project selected on a map. So now that we know what pages are too be included in the app lets figure out how to actually build it.
  14. I started by defining the model for my project. The app will have an entity to represent a Project. I found an open source project called Persistence JS that wraps the functions needed to build a WebSQL database. PersistenceJS allows me to define a project as: My main view contains a list of projects. Therefore, I will need to use persistence to define a table in my database that stores Projects. persistence.schemaSync(function(tx) { // callback }); persistence will sync the defined entities and create new tables for them if needed
  15. This line will configure a new database: persistence.store.websql.config(persistence, &apos;tikaltimetracker&apos;, &apos;Tikal Time Tracker DB&apos;, 5 * 1024 * 1024); My main view contains a list of projects. Therefore, I will need to use persistence to define a table in my database that stores Projects. persistence.schemaSync(function(tx) { // callback }); persistence will sync the defined entities and create new tables for them if needed
  16. Now that I have my model lets build the page that will display the list of projects. This is how the projects page looks: This is all I needed to do in order to setup the first page. My page is built using jQuery Mobile. It has a div that designates the navigation bar. The next element is a ul tag to contain the list that will display the table view of projects.
  17. Once we have the page that will list the projects we now need a way to add new projects. I thought it would be great idea to have the add new project involve as little input from the user as possible. This is how the Add Project page works: When the page is loaded it requests the devices GPS location using the GeoLocation Phonegap plugin. navigator.geolocation.getCurrentPosition(onSuccess, onError); This code calls the phone gap plugin and calls the onSuccess or onError callback function once it is completed. An error can happen if the user has declined Location services for the app. Because I want the user to have to do as little as possible to add a project I decided it would be great if I could show nearby locations. This way the user could just select his project. Foursquare provides a venues API that can be accessed without any type of authentification.
  18. The user is now able to select a location to add as a current project. Additionally, I provide a map view to show the project on a map before the user confirms adding the project (Show Map Page) Now the user is back on the Current Projects page. So far all of our development has been done with simple HTML and Javascript using jQuery Mobile. I haven&apos;t had to build any native layouts for either Android or iPhone. My entire project is in one HTML file. I have of course included various javascript files to access jQuery Mobile and Foursquare, but development so far has been straight forward.
  19. A geo-fence is a virtual perimeter for a real-world geographic area..
  20. A geo-fence is a virtual perimeter for a real-world geographic area..
  21. So now that we have our list of projects I want to program the app to automatically update my hours based on my location. How am I going to do this? Geofencing!!!
  22. What is GeoFencing? A geo-fence is a virtual perimeter for a real-world geographic area. Wonderful. How does this help me in this case? Well, I can define GeoFences based on the latitude and longitude of my current projects. I would need a way for the device to be notified when I enter or leave one of my projects.
  23. What is GeoFencing? A geo-fence is a virtual perimeter for a real-world geographic area. Wonderful. How does this help me in this case? Well, I can define GeoFences based on the latitude and longitude of my current projects. I would need a way for the device to be notified when I enter or leave one of my projects.
  24. Well I know what I want to do, now the fun part is to see how I can actually program this on a mobile phone. I first checked out phonegap and didn&apos;t find any plugins for Geofencing. This would be a good opportunity to build a custom Phonegap plugin. iOS supports Geofencing natively. All I need is to define a unique id, latitude, longitude and radius. Once I register a Geofence the system will notify the app when the boundaries are crossed. If the app isn&apos;t running it will be launched in the background to process the geofence notification.
  25. Android was another story. I didn&apos;t find any native support for Geofencing. Looking online yielded a number of sites offering subscription APIs. I wasn&apos;t going to spend money on this. I had an idea. I wanted to create my own method to mimic Geofencing. The simple choice would be to just have the GPS always on and monitoring my location. This would probably work for about two hours before eating up all the battery. I came up with another idea. Every project I go to has at least one WIFI hotspot. I could create a service that would scan for changes in WIFI hotspots. When it found one that was at one of my projects the service would trigger a request to retrieve the current location. This way only WIFI needed to be left on, instead of constant GPS monitoring, which is a lot less taxing on the battery from my experience.
  26. Now that I knew how each device would handle Geofencing on the native side it was time to create a Phonegap plugin for each platform to wrap this native code. This way I could communicate with it from javascript. I came up with the following commands that I wanted the Javascript to be able to do:
  27. Talk about the purpose of the app This app was made to allow users to let their mobile phone keep track of the hours they worked at their projects. Uses Geofencing Phonegap plugin developed by me to detect when a user arrives and leaves one of their projects Allows the user to export the app data so it can be imported into your companies time tracking web interface. What tech was used to develop
  28. These functions are all part of the Phonegap plugin. The fun part was to create the native code that handled each one of them.
  29. Talk about the purpose of the app This app was made to allow users to let their mobile phone keep track of the hours they worked at their projects. Uses Geofencing Phonegap plugin developed by me to detect when a user arrives and leaves one of their projects Allows the user to export the app data so it can be imported into your companies time tracking web interface. What tech was used to develop
  30. These functions are all part of the Phonegap plugin. The fun part was to create the native code that handled each one of them. In order to add a project for monitoring from the Javascript in the HTML I just need to call: