At What Cost

If you're a mobile owner, you know all too well that some of the more powerful features on your mobile can literally come at a price. Services like SMS, some location-based services, and data transfer can sometimes incur an additional tariff from your service provider.

It's obvious why it's important that any costs associated with functionality in your applications be minimized, and that users be aware when an action they perform might result in their being charged.

It's a good approach to assume that there's a cost associated with any action involving an interaction with the outside world. In some cases (such as with GPS and data transfer) the user can toggle Android settings to disable a potentially costly action. As a developer it's important that you use and respect those settings within your application.

In any case, it's important to minimize interaction costs by doing the following:

> Transferring as little data as possible

> Caching data and GPS results to eliminate redundant or repetitive lookups

> Stopping all data transfers and GPS updates when your activity is not visible in the foreground and if they're only being used to update the UI

> Keeping the refresh/update rates for data transfers (and location lookups) as low as practicable

> Scheduling big updates or transfers at "off-peak" times using alarms, as shown in Chapter 9

> Respecting the user's preferences for background data transfer

Often the best solution is to use a lower-quality option that comes at a lower cost.

0 Android Target □ Common Deployment Target Selection Mode © Manual & Automatic

Selecta preferred Android Virtual Devi ce for deployment:

0 Android Target □ Common Deployment Target Selection Mode © Manual & Automatic

Selecta preferred Android Virtual Devi ce for deployment:

AVD N... Target Name PL.

A...

I Details...

21 G1 Android 2.0 2.0

5

I Start...

I Refresh

I Manager...

Emulator launch parameters:

Network Latency: | EDGE

0 Disable Boot Animation

Additional Emulator Command Line Options

Emulator launch parameters:

Network Latency: | EDGE

0 Disable Boot Animation

Additional Emulator Command Line Options

Apply I I Revert

FIGURE 2-8

When using the location-based services described in Chapter 8, you can select a location provider based on whether there is an associated cost. Within your location-based applications, consider giving users the choice of lower cost or greater accuracy.

In some circumstances costs are hard to define, or they're different for different users. Charges for services vary between service providers and contract plans. While some people will have free unlimited data transfers, others will have free SMS.

Rather than enforcing a particular technique based on which seems cheaper, consider letting your users choose. For example, when downloading data from the Internet, you could ask users if they want to use any network available or limit their transfers to times when they're connected via Wi-Fi.

Mobile Apps Made Easy

Mobile Apps Made Easy

Quick start guide to skyrocket your offline and online business success with mobile apps. If you know anything about mobile devices, you’ve probably heard that famous phrase coined by one of the mobile device’s most prolific creators proclaiming that there’s an app for pretty much everything.

Get My Free Training Guide


Post a comment