Building a GPS tracking app with Appery.io

Many mobile apps use GPS sensors to track a user’s current location. For example, it could be a ride sharing app, fitness app, or a delivery app. This post shows how to build such an app in Appery.io. The app tracks your current location via  the device’s GPS sensor and stores the location into a database.

This is the app UI:

gps_app_view

 

The GPS location is determined every 15 seconds (you can change the interval). The location is shown in the app and also saved into a cloud database. Because this is a native app (with PhoneGap), the app will continue tracking the location even if in the background or with the phone screen locked.

To try this app, download the app backup and create a new app from it. Keep in mind that you do need to build a binary file and install it on the device for testing.

Now you just need to configure the settings service with the correct database ID. This app uses a pretty simple database; it contains one collection with name Locations. This collection contains one column location with type of Geo point:

gps_app_collection_structure

Open the GPSLocationTracking_settings file and change the database_id to your own.

Once the database ID is changed in the settings file, the application is ready to go.

Let’s take a quick look how the app works:

1. The GPS service starts initially after the Device ready event and runs every 15 seconds.

Here is the JavaScript code:

gps_app_device_ready

2. You can also change how often the GPS will run. To apply a new interval, first stop tracking, and then start it again:

gps_app_new_interval

3. In the case that the GPS fails to determine the location, an error message will be shown:

gps_app_save_failed

4. Every time a new GPS location is retrieved, the location is saved into a cloud database:

gps_app_store_location

This is a starter app that uses the GPS sensor to track your current location. It’s very easy to add more features. For instance, you can add Google Reverse Geocoding service to get the address of a place. Or, you could also show all locations on a map.

If you want more practice, try the Building a mobile app with Google Maps and Geolocation tutorial.

New Appery.io and PhoneGap Video

The last piece is in for the Appery.io self-training course of videos. We’ve now added:

Lesson 5: Appery.io & PhoneGap Capabilities

In the video, we show how to take advantage of the PhoneGap API with ready-to-use “device services” and data mapping in the Appery.io app builder. For this lesson, we build a simple contacts app and go through the steps of testing it in an Android emulator.

Here is the complete set of lessons from the video page on our help site:

  • Lesson 1: The UI Builder
  • Lesson 2: Data Mapping to a Service
  • Lesson 3: Using the Appery.io Database Service
  • Lesson 4: Web Service Caching
  • Lesson 5: Appery.io & PhoneGap Capabilities
  • Lesson 6: A Windows 8 App with the Twitter API

Each lesson links to a YouTube video. For each lesson there is also a link to a Appery.io backup ZIP of the finished lesson app, which you can open as a new project within Appery.io.

We’ll be updating the series soon, so chime in with any suggestions

Appery.io Updates its New HTML5 App Builder with Windows 8 Support, plus jQuery Mobile 1.2, PhoneGap 2.2, and Push Notifications

Windows 8 Support

Windows 8

Appery.io new HTML5 app builder has been the default builder for the past couple of weeks and we continue to update it with new features. One such feature is new Windows 8 support. In addition to jQuery Mobile/PhoneGap apps, you can now build Windows 8 apps with native support such as Snap View, Search Charm, Share Charm, and Live Tile.

To create a new Windows 8 app, click the “More create options” link from the Apps page and then select Windows 8 App as the app type. Try our Windows 8 app tutorial.

jQuery Mobile 1.2

We also upgraded to a much better jQuery Mobile version 1.2.

Selection_773

PhoneGap 2.2

We also upgraded PhoneGap to version 2.2. This means Appery.io cloud build has also been upgraded to PhoneGap 1.2.

If you use Appery.io Mobile App Tester for Android – go and grab an update so it also uses the latest PhoneGap version.

Push Notifications

A long requested feature – Push Notifications feature has been added to Appery.io Backend Services.

Selection_772

Want to try it? Try our new Push tutorial.

New Tutorial: Building a ToDo App with Appery.io Backend Services

Build this app and learn how the app builder is fully integrated with backend services.

Some Guidelines on Getting Your PhoneGap App Approved by Apple

July Release: Better Way to Test Your App, jQuery Mobile Multi-page Template, Queries In Database Console, PhoneGap Upgrade

We got some really cool stuff out this week. Check it out.

Better way to test your app

When you open the app builder you should see a new and very nice phone frame:

The old one was more Android-like. The new one is neither Android, iPhone or Windows Phone. Just a nice phone frame.

There is an upgraded test page:

You can use the new tool bar at the top to change the phone orientation as well as change the size:

That’s not all. We also now have an option to test the app without the mobile frame. In the Test pop-up, uncheck Show in mobile frame:

When you open the app, it won’t use the frame:

The frame looks nice in the browser, but technically speaking testing without the frame is better — as you are testing the actual app (just the app code, no frame). Of course when you run the app on your device, the frame is not there as well.

jQuery Mobile Multi-page Template

jQuery Mobile supports multi-page templates where two or more pages are placed inside the same file. You can now turn on this features in Appery.io app builder (it’s turn off by default). Go to Project > Project Profile:

Queries In Database Console

Appery.io Database comes with Queries support (docs) and now you can try the queries right from the collection console:

Showing products that cost more than $30 (or any other currency):

PhoneGap Upgrade

We upgraded to PhoneGap version 1.8.1. Every new and existing app will now use this new version of PhoneGap.

Android 4.0.x

We also added build support for Android 4.0.x

As always, we want to get your feedback. You can always email us (support@appery.io) or post on our forum.

The New Paradigm: Cloud Services, Cloud Tools [Article]

Cloud Services

In the past year or so, we have witnessed a major shift from client-server to client-cloud. This shift is primarily fueled by two factors: mobile devices exceeding desktop computers and the thousands of different APIs available on the Internet today. What started in early 2000 on eBay and Amazon has become a real revolution in 2012 with thousands of companies, from Twitter and Facebook to AT&T, offering cloud-based services.

REST API
One of the most common ways to access private or public service APIs is via REST requests.

In the client-server approach an organization builds applications that consume its own internal content and resources. However, even large IT organizations such as AT&T, Verizon and Amazon have come to realize that they are no match for the social consumer and social enterprise developers out there. By making APIs publicly available, these organizations hope that developers and “citizen developers” will come and build applications and mobile apps on top of their services.

Citizen developers at work
Analysts at Gartner see a trend toward app creation independent of IT. They predict that by 2014, citizen developers – employees outside of IT and software development – will build 25% of new business applications. In 2007, they built less than 5%.

One of the best-known API success stories comes from Amazon: Its cloud service APIs let outsiders access the company’s massive data centers. Twitter, with its deceptively simple 140-character message model, exploded thanks to its API. In fact, you probably read and write tweets via a Twitter application or mobile app rather than going directly to Twitter’s Web site. Facebook’s Graph API has spawned a whole industry of apps to support its hundreds of millions of users.

Continue reading

April Release: iOS Build, New Components, Updated jQuery Mobile and PhoneGap Support, and More

The Appery.io team keeps making the great even better, as you can see in this latest release of Appery.io Mobile App Builder. New features include everything from iOS binary builds to updated support for jQuery Mobile and PhoneGap. Read on to find out more. Read the rest of this entry »

Building jQuery Mobile App with StackMob API [New tutorial]

We just published a very nice hands-one tutorial on how to build HTML5/jQuery Mobile app connected to StackMob API. StackMob is super easy to use service for creating a mobile back-end for your app. Everything you create is instantly exposed as REST.

Give it a try!

Mapping the Tools in the Mobile Development Ecosystem – And How Appery.io Mobile App Builder Fits In

ReadWriteMobile has posted an interesting Infographic created by Kinvey mapping the current mobile ecosystem (click on image to view larger version):

(Image source: http://kinvey.com/images/kinvey_backend-as-a-service_mobileecosystem_2100px.png)

First of all thanks to Kinvey for creating this wonderful map and including Appery.io in it (blue Mobile SDK line). Appery.io could actually span 3 different lines: BaaS, Mobile SDK and Mobile API. Appery.io is a cloud-based HTML5 mobile app builder, so it’s not exactly a mobile SDK. In fact, the technology under the hood is HTML, JavaScript and jQuery Mobile. For hybrid apps, the app can be wrapped in PhoneGap, which also provides access to native device features. So, there is no really “custom” SDK.

Second, from the builder it’s incredibly easy to consume any REST API (yellow Mobile API line). Appery.io comes with a pretty nice REST services console where any service can be tested. From the same console, the REST service response (structure) can be automatically created. Once the service is defined, it is mapped to jQuery Mobile UI using a visual mapper (UI to service input, service output to UI).

Thirdly, as most BaaS services (orange line) are exposed as REST, HTML5 mobile app built in Appery.io, can easily connect and use those services.

Lastly, and maybe the most important point is how incredibly fast you can build apps. It sort of all makes sense.. you got cloud-based mobile backend (exposed as REST) and cloud-based app builder to build the apps. It sounds simple.. but a really elegant picture.

This perfectly describes Appery.io. Appery.io is cloud-based builder for creating HTML5, jQuery Mobile, PhoneGap, and RESTful mobile apps.

Originally posted here.

Exporting And Building PhoneGap App for iOS

One of the really great features in Appery.io mobile app builder is that you can quickly export the app as mobile Web, Android or iOS.

For Android, you can get a ready for the app market binary file (Release binary). Just take the file and upload it to Android Market. It’s that simple. You can watch a webinar where an app is built, exported for Android and published.

iOS is little bit more involved (Apple requires to provide your developer information to build). There are two ways to go about it. First, export the app as xCode project and then follow the steps outlined in this guide to build the app.

A second option is to use PhoneGap Build cloud service.

We are working on adding functionality where you will be able to build iOS app inside Appery.io.