CURB THE TAXIS, CUT THE COSTS

Freelance journalist and editor of Public Sector Travel Betty Low wrote a great feature for Buying Business Travel recently called ‘The Art of Persuasion’.  She argued that it’s time for travel managers to start managing travellers rather than suppliers.


Why? Because it’s travellers who are responsible for racking up a multitude of hidden expenses and, by controlling those, you may end up making bigger cost savings than constantly trying to squeeze already-squeezed suppliers.

Hidden, or unmanaged, spend is also the subject of a recent report by BCD Travel, which revealed that it accounts for a massive 26% of all travel budgets, supporting Betty Low’s opinion that it is this that holds the key to cost savings.

The BCD report claims hidden spend can be broken down into three areas:
  •           Dining and entertaining – accounting for 16%
  •           Ground transportation – accounting for 6%
  •           Mobile – accounting for 4%

If we look at ground transportation first, it quickly becomes obvious how managing the traveller can make a massive difference. This area of hidden spend may account for just 6% now, but if taxi fares continue to rise as they have been over the last five years, it’s about to hijack an even larger share of the pot and become an even bigger problem.


Thanks to rising fuel prices, the cost of London black cabs, for example, have risen on average 18% in the last five years and by 42% over a four-mile journey. The fixed rate fare from Heathrow to London is now £65, up £10 from 2008. Buying Business Travel recently highlighted the world’s most expensive airport transfers. Travelling into Tokyo from Narita is close to £200. 

And faced with indisputable facts like this it’s hard to question the importance of traveller management and the only question to remain is how do we manage the traveller once they have left the office and are out of the travel manager’s reach?

According to the BCD Travel report, this can be partially tackled psychologically as many travellers choose options based on ‘the bandwagon effect’.

“Social norms are massively powerful because we ultimately seek the approval of others. In fact, travellers, like everyone else, are often quick to abandon their own best judgment if they feel out of step with others. Use this lever to steer travellers toward public transportation, by, for example, sending out an email: From: Travel Manager Subject: Get on the Bandwagon 80% of your co-workers have switched to using public transportation in New York City. When are you going to join them?”
And of course, increasingly the answer to traveller management is through mobile technology and the introduction of apps that are designed to encourage travellers to make cost-efficient and compliant choices once they arrive at a destination and not just during the booking process and before they leave.

Whichever method travel managers opt for, it’s clear that, if cost savings are ever to be maximised, then the end of rogue travellers must be nigh.


David Chapple is event director for the Business Travel Show. www.businesstravelshow.com  

IS FREE HOTEL WI-FI A DIVINE RIGHT FOR BUSINESS TRAVELLERS?

Many business travellers believe that free hotel Wi-Fi is a divine right - traveller Dean Barrett blogs about it here. And many corporate travel managers would agree with them, investing valuable resources in negotiating free Wi-Fi during the RFP season, of which we are still in the midst.

But according to a Databank league table in Buying Business Travel magazine, it would be an understatement to say that all hotels are on their side. And what’s even more interesting is the huge discrepancies between countries throughout Europe when it comes to giving away the Holy Grail of business travel as part of the rack rate.

The following table shows the percentages of hotels offering free Wi-Fi in the best-served 20 countries in Europe. You’ll see that the UK comes in at a disappointing 14th place. Turkey, however, excels in its complimentary internet provision. The Mediterranean countries fare worst.
  
Why such discrepancies exist it’s hard to say. It could be telecoms costs, hotel rates or just the cultural norm. But what is useful about this league is the power it gives corporate travel managers when it comes to negotiating those add-ons during the RFP process. Such vital information about travel patterns can help them direct their resources more effectively when planning a global programme. This league shows, for example, that there is very little point demanding free Wi-Fi for travellers to Turkey, when nearly 85 per cent of hotels include it for free anyway. It may be wiser to ask, instead, for free parking, late checkout and early check in, free breakfast, gym passes or airport transfers? 

So is free hotel Wi-Fi the divine right of all business travellers? Well Turkey seems to think so. And with a little strategic strong-arming from travel managers across Europe, hopefully it won’t be too long before the rest of the continent follows suit.


David Chapple is event director for the Business Travel Show, which is the leading conference and exhibition in Europe for the corporate travel market. www.businesstravelshow.com 

Credential storage enhancements in Android 4.3

Our previous post was not related to Android security, but happened to coincide with the Android 4.3 announcement. Now that the post-release dust has settled, time to give it a proper welcome here as well. Being a minor update, there is nothing ground-breaking, but this 'revenge of the beans' brings some welcome enhancements and new APIs. Enough of those are related to security for some to even call 4.3 a 'security release'. Of course, the big star is SELinux, but credential storage, which has been a somewhat recurring topic on this blog, got a significant facelift too, so we'll look into it first. This post will focus mainly on the newly introduced features and interfaces, so you might want to review previous credential storage posts before continuing.

What's new in 4.3

First and foremost, the system credential store, now officially named 'Android Key Store' has a public API for storing and using app-private keys. This was possible before too, but not officially supported and somewhat clunky on pre-ICS devices. Next, while only the primary (owner) user could use the system key store pre-4.3, now it is multi-user compatible and each user gets their own keys. Finally, there is an API and even a system settings field that lets you check whether the credential store is hardware-backed (Nexus 4, Nexus 7) or software only (Galaxy Nexus). While the core functionality hasn't changed much since the previous release, the implementation strategy has evolved quite a bit, so we will look briefly into that too. That's a lot to cover, so lets' get started.

Public API

The API is outlined in the 'Security' section of the 4.3 new API introduction page, and details can be found in the official SDK reference, so we will only review it briefly. Instead of introducing yet another Android-specific API, key store access is exposed via standard JCE APIs, namely KeyGenerator and KeyStore. Both are backed by a new Android JCE provider, AndroidKeyStoreProvider and are accessed by passing "AndroidKeyStore" as the type parameter of the respective factory methods (those APIs were actually available in 4.2 as well, but were not public). For a full sample detailing their usage, refer to the BasicAndroidKeyStore project in the Android SDK. To introduce their usage briefly, first you create a KeyPairGeneratorSpec that describes the keys you want to generate (including a self-signed certificate), initialize a KeyPairGenerator with it and then generate the keys by calling generateKeyPair(). The most important parameter is the alias, which you then pass to KeyStore.getEntry() in order to get a handle to the generated keys later. There is currently no way to specify key size or type and generated keys default to 2048 bit RSA. Here's how all this looks like:

// generate a key pair
Context ctx = getContext();
Calendar notBefore = Calendar.getInstance()
Calendar notAfter = Calendar.getInstance();
notAfter.add(1, Calendar.YEAR);
KeyPairGeneratorSpec spec = new KeyPairGeneratorSpec.Builder(ctx)
.setAlias("key1")
.setSubject(
new X500Principal(String.format("CN=%s, OU=%s", alais,
ctx.getPackageName())))
.setSerialNumber(BigInteger.ONE).setStartDate(notBefore.getTime())
.setEndDate(notAfter.getTime()).build();

KeyPairGenerator kpGenerator = KeyPairGenerator.getInstance("RSA", "AndroidKeyStore");
kpGenerator.initialize(spec);
KeyPair kp = kpGenerator.generateKeyPair();

// in another part of the app, access the keys
KeyStore keyStore = KeyStore.getInstance("AndroidKeyStore");
keyStore.load(null);
KeyStore.PrivateKeyEntry keyEntry = (KeyStore.PrivateKeyEntry)keyStore.getEntry("key1", null);
RSAPublicKey pubKey = (RSAPublicKey)keyEntry.getCertificate().getPublicKey();
RSAPrivateKey privKey = (RSAPrivateKey) keyEntry.getPrivateKey();

If the device has a hardware-backed key store implementation, keys will be generated outside of the Android OS and won't be directly accessible even to the system (or root user). If the implementation is software only, keys will be encrypted with a per-user key-encryption master key. We'll discuss key protection in detail later.

Android 4.3 implementation

This hardware-backed design was initially implemented in the original Jelly Bean release (4.1), so what's new here? Credential storage has traditionally (since the Donut days), been implemented as a native keystore daemon that used a local socket as its IPC interface. The daemon has finally been retired and replaced with a 'real' Binder service, which implements the IKeyStoreService interface. What's interesting here is that the service is implemented in C++, which is somewhat rare in Android. See the interface definition for details, but compared to the original keymaster-based implementation, IKeyStoreService gets 4 new operations: getmtime(), duplicate(), is_hardware_backed() and clear_uid(). As expected, getmtime() returns the key modification time and duplicate() copies a key blob (used internally for key migration). is_hardware_backed will query the underlying keymaster implementation and return true when it is hardware-backed. The last new operation, clear_uid(), is a bit more interesting. As we mentioned, the key store now supports multi-user devices and each user gets their own set of keys, stored in /data/misc/keystore/user_N, where N is the Android user ID. Keys names (aliases) are mapped to filenames as before, and the owner app UID now reflects the Android user ID as well. When an app that owns key store-managed keys is uninstalled for a user, only keys created by that user are deleted. If an app is completely removed from the system, its keys are deleted for all users. Since key access is tied to the app UID, this prevents a different app that happens to get the same UID from accessing an uninstalled app's keys. Key store reset, which deletes both key files and the master key, also affects only the current user. Here's how key files for the primary user might look like:

1000_CACERT_ca
1000_CACERT_cacert
10248_USRCERT_myKey
10248_USRPKEY_myKey
10293_USRCERT_rsa_key0
10293_USRPKEY_rsa_key0

The actual files are owned by the keystore service (which runs as the keystore Linux user) and it checks the calling UID to decide whether to grant or deny access to a key file, just as before. If the keys are protected by hardware, key files may contain only a reference to the actual key and deleting them may not destroy the underlying keys. Therefore, the del_key() operation is optional and may not be implemented.

The hardware in 'hardware-backed'

To give some perspective to the whole 'hardware-backed' idea, let's briefly discuss how it is implemented on the Nexus 4. As you may now, the Nexus 4 is based on Qualcomm's Snapdragon S4 Pro APQ8064 SoC. Like most recent ARM SoC's it is TrustZone-enabled and Qualcomm implement their Secure Execution Environment (QSEE) on top of it. Details are, as usual, quite scarce, but trusted application are separated from the main OS and the only way to interact with them is through the controlled interface the /dev/qseecom device provides. Android applications that wish to interact with the QSEE load the proprietary libQSEEComAPI.so library and use the functions it provides to send 'commands' to the QSEE. As with most other SEEs, the QSEECom communication API is quite low-level and basically only allows for exchanging binary blobs (typically commands and replies), whose contents entirely depends on the secure app you are communicating with. In the case of the Nexus 4 keymaster, the used commands are: GENERATE_KEYPAIR, IMPORT_KEYPAIR, SIGN_DATA and VERIFY_DATA. The keymaster implementation merely creates command structures, sends them via the QSEECom API and parses the replies. It does not contain any cryptographic code itself.

An interesting detail is that, the QSEE keystore trusted app (which may not be a dedicated app, but part of more general purpose trusted application) doesn't return simple references to protected keys, but instead uses proprietary encrypted key blobs (not unlike nCipher Thales HSMs). In this model, the only thing that is actually protected by hardware is some form of 'master' key-encryption key (KEK), and user-generated keys are only indirectly protected by being encrypted with the KEK. This allows for practically unlimited number of protected keys, but has the disadvantage that if the KEK is compromised, all externally stored key blobs are compromised as well (of course, the actual implementation might generate a dedicated KEK for each key blob created or the key can be fused in hardware; either way no details are available). Qualcomm keymaster key blobs are defined in AOSP code as shown below. This suggest that private exponents are encrypted using AES, most probably in CBC mode, with an added HMAC-SHA256 to check encrypted data integrity. Those might be further encrypted with the Android key store master key when stored on disk.

#define KM_MAGIC_NUM     (0x4B4D4B42)    /* "KMKB" Key Master Key Blob in hex */
#define KM_KEY_SIZE_MAX (512) /* 4096 bits */
#define KM_IV_LENGTH (16) /* AES128 CBC IV */
#define KM_HMAC_LENGTH (32) /* SHA2 will be used for HMAC */

struct qcom_km_key_blob {
uint32_t magic_num;
uint32_t version_num;
uint8_t modulus[KM_KEY_SIZE_MAX];
uint32_t modulus_size;
uint8_t public_exponent[KM_KEY_SIZE_MAX];
uint32_t public_exponent_size;
uint8_t iv[KM_IV_LENGTH];
uint8_t encrypted_private_exponent[KM_KEY_SIZE_MAX];
uint32_t encrypted_private_exponent_size;
uint8_t hmac[KM_HMAC_LENGTH];
};

So, in the case of the Nexus 4, the 'hardware' is simply the ARM SoC. Are other implementations possible? Theoretically, a hardware-backed keymaster implementation does not need to be based on TrustZone. Any dedicated device that can generate and store keys securely can be used, the usual suspects being embedded secure elements (SE) and TPMs. However, there are no mainstream Android devices with dedicated TPMs and recent flagship devices have began shipping without embedded SEs, most probably due to carrier pressure (price is hardly a factor, since embedded SEs are usually in the same package as the NFC controller). Of course, all mobile devices have some form of UICC (SIM card), which typically can generate and store keys, so why not use that? Well, Android still doesn't have a standard API to access the UICC, even though 'vendor' firmwares often include one. So while one could theoretically implement a UICC-based keymaster module compatible with the UICC's of your friendly neighbourhood MNO, it is not very likely to happen.

Security level

So how secure are you brand new hardware-backed keys? The answer is, as usual, it depends. If they are stored in a real, dedicated, tamper-resistant hardware module, such as an embedded SE, they are as secure as the SE. And since this technology has been around for over 40 years, and even recent attacks are only effective against SEs using weak encryption algorithms, that means fairly secure. Of course, as we mentioned in the previous section, there are no current keymaster implementations that use actual SEs, but we can only hope.

What about TrustZone? It is being aggressively marketed as a mobile security 'silver bullet' and streaming media companies have embraced it as an 'end-to-end' DRM solution, but does it really deliver? While the ARM TrustZone architecture might be sound at its core, in the end trusted applications are just software that runs at a slightly lower level than Android. As such, they can be readily reverse engineered, and of course vulnerabilities have been found. And since they run within the Secure World they can effectively access everything on the device, including other trusted applications. When exploited, this could lead to very effective and hard to discover rootkits. To sum this up, while TrustZone secure applications might provide effective protection against Android malware running on the device, given physical access, they, as well as the TrustZone kernel, are exploitable themselves. Applied to the Android key store, this means that if there is an exploitable vulnerability in any of the underlying trusted applications the keymaster module depends on, key-encryption keys could be extracted and 'hardware-backed' keys could be compromised.

Advanced usage

As we mentioned in the first section, Android 4.3 offers a well defined public API to the system key store. It should be sufficient for most use cases, but if needed you can connect to the keystore service directly (as always, not really recommended). Because it is not part of the Android SDK, the IKeyStoreService doesn't have wrapper 'Manager' class, so if you want to get a handle to it, you need to get one directly from the ServiceManager. That too is hidden from SDK apps, but, as usual, you can use reflection. From there, it's just a matter of calling the interface methods you need (see sample project on Github). Of course, if the calling UID doesn't have the necessary permission, access will be denied, but most operations are available to all apps.

Class smClass = Class.forName("android.os.ServiceManager");
Method getService = smClass.getMethod("getService", String.class);
IBinder binder = (IBinder) getService.invoke(null, "android.security.keystore");
IKeystoreService keystore = IKeystoreService.Stub.asInterface(binder);

By using the IKeyStoreService directly you can store symmetric keys or other secret data in the system key store by using the put() method, which the current java.security.KeyStore implementation does not allow (it can only store PrivateKey's). Such data is only encrypted by the key store master key, and even the system key store is hardware-backed, data is not protected by hardware in any way.

Accessing hidden services is not the only way to augment the system key store functionality. Since the sign() operation implements a 'raw' signature operation (RSASP1 in RFC 3447), key store-managed (including hardware-backed) keys can be used to implement signature algorithms not natively supported by Android. You don't need to use the IKeyStoreService interface, because this operation is available through the standard JCE Cipher interface:

KeyStore ks = KeyStore.getInstance("AndroidKeyStore");
ks.load(null);
KeyStore.Entry keyEntry = keyStore.getEntry("key1", null);
RSAPrivteKey privKey = (RSAPrivateKey) keyEntry.getPrivateKey();

Cipher c = Cipher.getInstance("RSA/ECB/NoPadding");
cipher.init(Cipher.ENCRYPT_MODE, i privateKey);
byte[] result = cipher.doFinal(in, o, in.length);

If you use this primitive to implement, for example, Bouncy Castle's AsymmetricBlockCipher interface, you can use any signature algorithm available in the Bouncy Castle lightweight API (we actually use Spongy Castle to stay compatible with Android 2.x without too much hastle). For example, if you want to use a more modern (and provably secure) signature algorithm than Android's default PKCS#1.5 implementation, such as RSA-PSS you can accomplish it with something like this (see sample project for AndroidRsaEngine):

AndroidRsaEngine rsa = new AndroidRsaEngine("key1", true);

Digest digest = new SHA512Digest();
Digest mgf1digest = new SHA512Digest();
PSSSigner signer = new PSSSigner(rsa, digest, mgf1digest, 512 / 8);
RSAKeyParameters params = new RSAKeyParameters(false,
pubKey.getModulus(), pubKey.getPublicExponent());

signer.init(true, params);
signer.update(signedData, 0, signedData.length);
byte[] signature = signer.generateSignature();

Likewise, if you need to implement RSA key exchange, you can easily make use of OAEP padding like this:

AndroidRsaEngine rsa = new AndroidRsaEngine("key1", false);

Digest digest = new SHA512Digest();
Digest mgf1digest = new SHA512Digest();
OAEPEncoding oaep = new OAEPEncoding(rsa, digest, mgf1digest, null);

oaep.init(true, null);
byte[] cipherText = oaep.processBlock(plainBytes, 0, plainBytes.length);

The sample application shows how to tie all of those APIs together and features an elegant and fully Holo-compatible user interface:



An added benefit of using hardware-backed keys is that, since they are not generated using Android's default SecureRandom implementation, they should not be affected by the recently announced SecureRandom vulnerability (of course, since the implementation is closed, we can only hope that trusted apps' RNG actually works...). However, Bouncy Castle's PSS and OAEP implementations do use SecureRandom internally, so you might want to seed the PRNG 'manually' before starting your app to make sure it doesn't start with the same PRNG state as other apps. The keystore daemon/service uses /dev/urandom directly as a source of randomness, when generating master keys used for key file encryption, so they should not be affected. RSA keys generated by the softkeymaster OpenSSL-based software implementation might be affected, because OpenSSL uses RAND_bytes() to generate primes, but are probably OK since the keystore daemon/service runs in a dedicated process and the OpenSSL PRNG automatically seeds itself from /dev/urandom on first access (unfortunately there are no official details about the 'insecure SecureRandom' problem, so we can't be certain).

Summary

Android 4.3 offers a standard SDK API for generating and accessing app-private RSA keys, which makes it easier for non-system apps to store their keys securely, without implementing key protection themselves. The new Jelly Bean also offers hardware-backed key storage on supported devices, which guarantees that even system or root apps cannot extract the keys. Protection against physical access attacks depends on the implementation, with most (all?) current implementations being TrustZone-based. Low-level RSA operations with key store managed keys are also possible, which enables apps to use cryptographic algorithms not provided by Android's built-in JCE providers.

Multiplication Freezer Frenzy Freebie & A Back To School SALE!

Hopefully today's post finds you either settled in nicely to your new school year or getting excited about going back.  Either way, the TpT giant BACK TO SCHOOL SALE is happening this weekend...Sunday and Monday, Aug. 18th and 19th.  Be sure to visit your favorite stores and grab items for as much as 28% off.  I put EVERYTHING in my store on sale.  Be sure to check out a real steal on the BRAND NEW Accountable Talk Prompts.  There are 24 accountable talk stems that are sure to keep students engaged in the text...a goal of Common Core.  *Don't forget to use the PROMO CODE. Sellers will mark most of their items 20% off.  You'll get the additional 8% by using the PROMO code!  (See the beautiful button created by the very talented Krista Wallden at Creative Clips for PROMO code...Thank you, Krista!)

  


Teaching multiplication this year?  Be sure to grab my latest FREEBIE...Multiplication Facts Freezer Frenzy! My way of saying THANK YOU for your never ending friendship and support in the blogging world!  As students learn their facts, let them earn and add the corresponding ice cream to their base cone.  As a REAL incentive, I bought my students an ice cream from the cafeteria when they mastered all their facts!  Hmmmm....thinking I'll make a trip to Baskin Robbins tonight!  :-)


Bananas for incredible deals on TpT this weekend!  Happy Shopping!

THE BLEISURE PRINCIPLE - COURTESY OF BUYINGBUSINESSTRAVEL.COM

On Buying Business Travel, freelance travel journalist Nick Easen has written a really interesting comment piece on 'bleisure travel', or 'bizcations' as they are also known. We have posted it here in full - you can also read it here. 


There’s business travel, and then there’s travel. Nick Easen reports on the trend that provides the overworked road warrior with the best of both worlds
YOU MAY OR MAY NOT like the concept – and probably don’t like the word – but ‘bleisure’ is here to stay.

Both word and concept are a blurring of ‘business’ and ‘leisure’ (some call it ‘bizcation’). In our time-pressed existences it is not unusual for work lives to summarily bleed into social ones, and vice versa – helped along by being constantly connected via smart devices. So it wouldn’t be surprising to see bleisure travel on the rise – though perhaps tempered by financial and policy constraints.

This is how it works: if you’re sent on a two-day business trip, you take time off at the end and tag on a few days of rest and relaxation. You might invite your partner to come along, too – if you’ve been booked in to a double room, why not make the most of it and pay extra only for the air fare, or for extending the hotel stay? Given the current state of the British economy, executives are being asked to do more and take less time off. This phase in the economic cycle could be ripe for bizcations.
Yet there is little research in this area, as it is neither business travel nor leisure. It’s hard to define, and there’s no formal sector in the UK. Some in the industry claim it is static or even declining, while others say it is in rude health. “Although expenditure was initially reined in during the downturn, we have seen year-on-year growth since 2010,” says Julian Munsey, head of strategic business development at Hillgate Travel. “Although demand is not great, where it’s permitted by the corporation we have seen a small increase in the number of extended stays.”
In the post-recession era, higher flight and holiday costs would imply that it makes sense to extend a business trip. “It’s a great way to minimise your personal short break budget,” says LeRoy Sheppard, UK sales director at Maritim Hotels. “This is about ensuring the effective use of your time and maximising your personal ROI [return on investment].”
A survey of 1,000 business travellers last year by Jurys Inn showed 35 per cent see an overnight business trip as a break from the office routine, with 19 per cent looking forward to exploring a new city – which implies taking time out to have a bizcation-type experience.
In the US, where the working population gets fewer holidays compared to the Brits – a week or two versus our four weeks – it’s not surprising that Americans are keen to tag on a few days holiday. For instance, 72 per cent of business travellers surveyed in the US said that they take extended executive trips that have a leisure component, according to an Orbitz trend report last year, which polled over 600 business travellers, and that 81 per cent planned to. In addition, 43 per cent had a significant other accompany them on a business trip.
MIXING IT UP Adding a few days at the end of a European city business trip is popular. In some cases executives will head off from their city of business to a more leisure-focused destination – for example, business in Frankfurt, then take time off in Wurzburg; a weekend in Salzburg after work in Vienna; Bruges after Brussels; or Cannes after Marseilles.
This is where frequent flyer and hotel point schemes come into their own. If a traveller’s company is aligned to a brand then the executive will do all that is possible to stay at, for example, a Hilton hotel or fly British Airways so they can get personal points. “Guests who have been staying for a long time or are regulars will generally be offered favourable rates,” says Joanna Fisher, marketing director at serviced apartment operator Ascott.
Points do mean prizes. Executives can easily fly significant others on air miles or have an extended hotel stay. “We also see people decide to have a bleisure break relatively near to the date of travel – it is not planned a long time in advance in many cases,” says Maritim’s Sheppard.
A TRICKY QUESTION
Bizcations are not positively encouraged as a formal policy. Years of ratcheting up compliance, talking up travel policies and scrutinising budgets means that there is little scope for a few sly days on a beach using a corporate credit card.
There are challenges for TMCs as they have to justify all arrangements within agreed guidelines and ensure all reservations are policy compliant. Few TMCs wanted to contribute to this article for that reason – the fact is there is little room for the bizcation in the vocabulary of managed travel these days. “This is an informal or discretionary thing that companies do not want written into formal policy,” explains Adam Knights, group sales director at ATPI.
For many buyers, business is business and they are keen to show that the leisure part of any stay is separate to the corporate trip, and funded separately, too. Larger corporations are also sensitive to the implications of being involved in bleisure. “The potential for a taxable benefit to be incurred, and for other staff to believe personal travel was being undertaken at the company’s expense, has made this an unnecessary challenge many want to avoid,” explains Paul Gardner, owner/director of Amity Travel. Amity is ranked 45th in Buying Business Travel’s annual 50 Leading TMCs, and lists leisure travel among its services offered.
“Things are different if they are travelling as part of an incentive reward for hitting a performance target,” adds De Vere Hotels commercial marketing director Calum Russell. “Also, rates can sometimes be higher for leisure stays as business trips are usually based on a bulk negotiated rates.”
CUTTING BOTH WAYS
However, there are occasions when extending a trip can be beneficial to the company.
For example, many economy class fares to the US have restrictions if booked at the last minute. “But by extending to Saturday night, the fare can often be reduced by 50 per cent – this far outweighs the additional hotel costs,” says Gardner.
There are also informal incentives. One travel buyer says: “There is sometimes the scenario where the company says: ‘We know you have worked extremely hard for the last week – why doesn’t your wife fly out at the end of your trip and we will pick up the hotel bill?’ But these situations are always discretionary.”
DIFFERING NEEDS
It’s certainly a difficult market to nail down – each customer’s needs are different and are in many ways opportunistic, based on how leisure time can be fitted around business meetings. “Bizcations are unique for each customer, so it can be a challenge to offer the right package,” explains Maritim’s Sheppard.
Many deals for partners and family are purchased at arm’s length to the corporate buying, so are beyond analysis. Yet some travel management companies have VIP services that cater for all the needs of their business clients, blurring business and leisure, whether it be chartering a yacht in Monaco or organising tickets to the Abu Dhabi Grand Prix, while others have specific leisure departments that deal with this type of travel, albeit passed on from their business travel division.
For example, Travel without Boundaries is a programme created for Advantage TMCs to manage the holiday market for clients alongside corporate travel bookings. Advantage is a founder member of the Worldwide Independent Travel Network (WIN), a global travel agency partnership with more than 6,000 outlets around the world. WIN head of supplier relations Julie Janzen says: “We’ve negotiated leisure benefits for executives wanting to extend their stay across key cities and it is all bookable through the GDS on a unique rate code.”
Certainly, booking a bleisure break seamlessly alongside that conference in Munich or a client meeting in Hong Kong is symptomatic of the modern age, and Travel without Boundaries reflects this model.
If everything else is integrated in a road warrior’s life, from their smartphone and work diaries to their Skype chats with clients, it makes sense for their bizcation to be part of this arrangement, too.
As long as everyone’s aware that there’s a clear divide between work and pleasure in terms of who pays, who arranges it and how time is accounted for, then the committed business traveller should be able to take that well-earned break – and why not?
THE TMC’S VIEW
Adam Knights, group sales director for ATPI
What’s happening with bizcations?
Many companies rely on employees to be available 24/7, therefore there is a growing trend towards informal time in lieu, or family support. This often results in us being asked to change a hotel in, say, Dubai, to one of the beach properties for the weekend if a partner or family are joining.
Who takes them and when?
Increasingly, people are working around half-term holidays with the family, so that an executive can do a week overseas while the family fly in at the beginning or end. The key thing customers have in common is that they are all frequent travellers and tend to be older.
What challenges do you face? 
Some senior travellers ask our teams to book bleisure, but normally this goes through our separate leisure group. Clients don’t want agents distracted and business services to falter. However, there are always exceptions and, if the PA to the chief executive asks one of our agents to book extra flights for the family, we would normally do this. There are rarely compliance issues as a client’s personal card is used; however, we always take the lead from our client and discreetly check with our main contact whether this is acceptable.
THE TRAVELLER’S VIEW
A leading global consumer goods company senior manager
Do you see bizcations as a benefit? 
It is a huge benefit, but it is harder to take longer breaks because of work pressures these days. I’ve taken a bizcation a number of times, and it’s allowed me to visit the Taj Mahal and extend to a weekend safari in Kenya.
What kind of trips do you mix up?
It’s actually about grabbing opportunities and the destination – I’ve done a week-long training course in Budapest and had my partner join me on the Friday for a long weekend; similarly I’ve had my partner join an Indian business trip for a week extension.
Are you doing more of it now?
I want to try and spend as little time as possible in airports and in transit, so it makes sense to add a break on to an executive trip.
Are there compliance or other issues? 
It is critical to separate all costs of a personal nature. I think it’s also important to let line management know in advance any intention to add a personal side trip to a business trip. I tend to take these few days at the beginning of a trip so the company benefits as well – I get over the jetlag in my own time and am ready to perform 100 per cent.



This article has been reproduced with kind permission from Buying Business Travel. Thank you to Panacea Publishing for allowing us to share it. You can find the original - and a lot more fantastic business travel articles - here.

A Winner and Common Core Freebies in an E book




Congratulations to the "Giveaway...Our Way" winner,            .  Rafflecopter has spoken and the grand prize winner, Karyn Wilbur, won an autographed CD from Southern Push, a $25.00 gift card to TpT, and a $15.00 Itunes gift card.  A second congratulations goes out to Brandi Guerra for playing along with the music video trivia.  The answer was 5 ice cream cones used in the music video!  A HUGE thank you for your support and participation!  :-)





Ready for some Back to School Common Core news?  Several top notch teachers across the United States, helped create 8 Common Core eBooks that you can now download for FREE!  These amazing resources span grades K-12!  Each page of the ebook comes with a quick Common Core teaching tip, a link to a freebie, and link to some priced items that will also help you in your Common Core adventure.   Here's a quick link to each eBook available.  Simply look for your grade level and/or subject area and click! (There's a Math and E/LA eBook for each grade span, as well as a Science and S.S. eBook for the upper grades!)  Happy downloading!  








#1. Math eBook for Grades 3-5

























#2  E/LA eBook for Grades 3-5
































#3 Math eBook for Grades 6-12























#4  E/LA eBook for Grades 6-12
































#5  Social Studies eBook for Grades 6-12





















#6 Science eBook for Grades 6-12
























#7  Math eBook for Grades K-2


























#8  E/LA eBook for Grades K-2



Bananas for all this Common Core creativity in ONE place!










Building a wireless Android device using BeagleBone Black

Our previous posts were about code signing in Android, and they turned out to be surprisingly relevant with the announcement of the 'master key' code signing Android vulnerability. While details are yet to be formally released, it has been already patched and dissected, so we'll skip that one and try something different for a change. This post is not directly related to Android security, but will discuss some Android implementation details, so it might be of some interest to our regular readers. Without further ado, let's get closer to the metal than usual and build a wireless Android device (almost) from scratch.

Board introduction -- BeagleBone Black

For our device we'll use the recently released BeagleBone Black board. So what is a BeagleBone Black (let's call it BBB from now on), then? It's the latest addition to the ranks of ARM-based, single board credit-card-sized computers. It comes with an AM335x 1GHz ARM Cortex-A8 CPU, 512MB RAM,  2GB on-board eMMC flash, Ethernet, HDMI and USB ports, plus a whole lot of I/O pins. Best of all, it's open source hardware, and all schematics and design documents are freely available. It's hard to beat the price of $45 and it looks much, much better than the jagged Raspberry Pi. It comes with Angstrom Linux pre-installed, but can run pretty much any Linux flavour, and of course, Android. It is being used for anything from blinking LEDs to tracking satellites. You can hook it up to circuits you've build or quickly extend it using one of the many 'cape' plug-in boards available. We'll use a couple of those for our project, so 'building' refers mostly to creating an Android build compatible with our hardware. We'll detail the hardware later, but let's first outline some simple requirements for our mobile Android device:
  1. touch screen input
  2. wireless connectivity via WiFi
  3. battery powered
Here's what we start with:

Building a kernel for Android

Android support for AM335x-based devices is provided by the rowboat project. It integrates the required kernel and OS patches and provides build configurations for each of the supported devices, including the BBB. The latest version is based on Android 4.2.2 and if you want to get started quickly, you can download a binary build from TI's Sitara Android development kit page. All you need to do is flash it to an SD card, connect the BBB to an HDMI display and power it on. You will instantly get a fully working, hardware-accelerated Jelly Bean 4.2 device you can control using standard USB keyboard and mouse. If that is all you need, you might as well stop reading here. Our first requirement, however is a working touch screen, not an HDMI monitor, so we have some work to do. As it happens, a number of LCD capes are already available for the BBB (from circuitco and others), so those are our first choice. We opted for the LCD4 4.3" cape which offers almost reasonable resolution and is small enough to be directly attached to the BBB. Unfortunately it doesn't work with the rowboat build from TI. To understand why, let's take a step back and discuss how the BBB supports extension hardware, including capes.

Linux Device Tree and cape support

If you look at the expansion header pinout table in the BBB reference manual, you will notice that each pin can serve multiple purposes, depending on configuration. This is called 'pinmuxing' and is the method modern SoC's use to multiplex multiple peripheral functions to a limited set of physical pins. The AM335x CPU the BBB uses is no exception: it has pins with up to 8 possible peripheral functions. So, in order for a cape to work, the SoC needs to be configured to use the correct inputs/outputs for that cape. The situation becomes more complicated when you have multiple capes (up to 4 at a time). BBB capes solve this by using EEPROM that stores enough data to identify the cape, its revision and serial number. At boot time, the kernel identifies the capes by reading their EEPROMs, computes the optimal configuration (or outputs and error if the connected capes are not compatible) and sets the expansion header pinmux accordingly. Initially, this was implemented in a 'board file' in the Linux kernel, and adding a new cape required modifying the kernel and making sure all possible cape configurations were supported. Needless to say, this is not an easy task, and getting it merged into Linux mainline is even harder. Since everyone is building some sort of ARM device nowadays, the number of board files and variations thereof reached critical mass, and Linux kernel maintainers decided to decouple board specific behaviour from the kernel. The mechanism for doing this is called Device Tree (DT) and its goal is to make life easier for both device developers (no need to hack the kernel for each device) and kernel maintainers (no need to merge board-specific patches every other day). A DT is a data structure for describing hardware which is passed to the kernel at boot time. Using the DT, a generic board driver can configure itself dynamically. The BBB ships with a 3.8 kernel and takes full advantage of the new DT architecture. Cape support is naturally implemented using DT source (DTS) files and even goes a step further than mainline Linux by introducing a Cape Manager, an in-kernel mechanism for dynamically loading Device Tree fragments from userspace. This allows for runtime (vs. boot time) loading of capes via sysfs, resource conflict resolution (where possible), manual control over already loaded capes and more.

Going back to Android, the rowboat Android port is using the 3.2 kernel and relies on manual porting of extension peripheral configuration to the kernel board file. As it happens, support for our LCD4 cape is not there yet. We could try to patch the kernel based on the 3.8 DTS files, or take the plunge and attempt to run Android using 3.8. Since all BBB active development is going on in the 3.8 branch, using the newer version is the better (if more involved) choice.

Using the 3.8 kernel

As we know, Android adds a bunch of 'Androidisms' to the Linux kernel, most notably wakelocks, alarm timers, ashmem, binder, low memory killer and 'paranoid' network security. Thus you could not use a vanilla Linux kernel as is to run Android until recently, and a number of Android-specific patches needed to be applied first. Fortunately, thanks to the Android Mainlining Project, most of these features are already merged (in one form or another) in the 3.8 kernel and are available as staging drivers. What this means is that we can take a 3.8 kernel that works well on the BBB and use it run Android. Unfortunately, the BBB can't quite use a vanilla 3.8 kernel yet and requires quite a few patches (including Cape Manager). However, building a 3.8 kernel with all BBB patches applied is not too hard to do, thanks to instructions and build scripts by Robert Nelson. Even better, Andrew Henderson has successfully used it in Android and has detailed the procedure. Following Andrew's build instructions, we can create an Android build that has a good chance of supporting our touch screen. As Andrew's article mentions, hardware acceleration (support for the BBB's PowerVR SGX 530 GPU) is not yet available for the 3.8 kernel, so we need to disable it in our build. One thing that is missing from Andrew's instruction is that you also need to disable building and installing of the SGX drivers, otherwise Android will try to use them at boot and fail to start SurfaceFlinger due to driver-kernel module incompatibility. You can do this by commenting out the dependency on sgx in rowboat's top-level Makefile like this:

@@ -11,7 +13,7 @@
CLEAN_RULE = sgx_clean wl12xx_compat_clean kernel_clean clean
else
ifeq ($(TARGET_PRODUCT), beagleboneblack)
-rowboat: sgx
+#rowboat: sgx
CLEAN_RULE = sgx_clean kernel_clean clean
else
ifeq ($(TARGET_PRODUCT), beaglebone)


Note that the kernel alone is not enough though: the boot loader (Das U-Boot) needs to be able to load the (flattened) device tree blob, so we need to build a recent version of that as well. Android seems to run OK with this configuration, but there are still a few things that are missing. The first you might notice is ADB support.

ADB support

ADB (Android Debug Bridge) is one of the best things to came out of the Android project, and if you have been doing Android development in any form for a while, you probably take it for granted. It is a fairly complex piece of software though, providing support for debugging, file transfer, port forwarding and more and requires kernel support in addition to the Android daemon and client application. In kernel terms this is known as the 'Android USB Gadget Driver', and it is not quite available in the 3.8 kernel, even though there have been multiple attempts at merging it. We can merge the required bits from Google's 3.8 kernel tree, but since we are trying to stay as close as possible to the original BBB 3.8 kernel, we'll use a different approach. While attempts to get ADB in the mainline continue, Function Filesystem (FunctionFS) driver support has been added to Android's ADB and we can use that instead of the 'native' Android gadget. To use ADB with FunctionFS:
  1. Configure FunctionFS support in the kernel (CONFIG_USB_FUNCTIONFS=y):
    • Device Drivers -> USB Support -> 
      USB Gadget Support -> USB Gadget Driver -> Function Filesystem
  2. Modify the boot parameters in uEnv.txt to set the vendor and product IDs, as well as the device serial number
    • g_ffs.idVendor=0x18d1 g_ffs.idProduct=0x4e26 g_ffs.iSerialNumber=<serial>
  3. Setup the FunctionFS directory and mount it in your init.am335xevm.usb.rc file:
    • on fs
      mkdir /dev/usb-ffs 0770 shell shell
      mkdir /dev/usb-ffs/adb 0770 shell shell
      mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000
  4. Delete all lines referencing /sys/class/android_usb/android0/*. (Those nodes are created by the native Android gadget driver and are not available when using FunctionFS.)
Once this is done, you can reboot and you should see your device using adb devices soon after the kernel has loaded. Now you can debug the OS using Eclipse and push and install files directly using ADB. That said, this won't help you at all if the device doesn't boot due to some kernel misconfiguration, so you should definitely get an FTDI cable (the BBB does not have an on-board FTDI chip) to be able to see kernel messages during boot and get an 'emergency' shell when necessary.

cgroups patch

If you are running adb logcat in a console and experimenting with the device, you will notice a lot of 'Failed setting process group' warnings like this one:

W/ActivityManager(  349): Failed setting process group of 4911 to 0
W/SchedPolicy( 349): add_tid_to_cgroup failed to write '4911' (Permission denied);

Android's ActivityManager uses Linux control groups (cgroups) to run processes with different priorities (background, foreground, audio, system) by adding them to scheduling groups. In the mainline kernel this is only allowed to processes running as root (EUID=0), but Android changes this behaviour (naturally, with a patch) to only require the CAP_SYS_NICE capability, which allows the ActivityManager (running as system in the system_server process) to add app processes to scheduling groups. To get rid of this warning, you can disable scheduling groups by commenting out the code that sets up /dev/cpuctl/tasks in init.rc, or you can merge the modified functionality form Google's experimental 3.8 branch (which we've been trying to avoid all along...).

Android hardware support

Touchscreen

We now have a functional Android development device running mostly without warnings, so it's time to look closer at requirement #1. As we mentioned, once we disable hardware acceleration, the LCD4 works fine with our 3.8 kernel, but a few things are still missing. The LCD4 comes with 5 directional GPIO buttons which are somewhat useful because scrolling on a resistive touchscreen takes some getting used to, but that is not the only thing they can be used for. We can remap them as Android system buttons (Back, Home, etc) by providing a key layout (.kl) file like this one:

key 105   BACK               WAKE
key 106 HOME WAKE
key 103 MENU WAKE
key 108 SEARCH WAKE
key 28 POWER WAKE

The GPIO keypad on the LCD identifies itself as 'gpio.12' (you can check this using the getevent command), so we need to name the layout file to 'gpio_keys_12.kl'. To achieve this we modify device.mk in the BBB device directory (device/ti/beagleboneblack):

...
# KeyPads
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/gpio-keys.kl:system/usr/keylayout/gpio_keys_12.kl \
...

Now that we are using hardware buttons, we might want to squeeze some more screen real estate from the LCD4 by not showing the system navigation bar. This is done by setting config_showNavigationBar to false in the config.xml framework overlay file for our board:

<bool name="config_showNavigationBar">false</bool>

While playing with the screen, we notice that it's a bit dark. Increasing the brightness via the display settings however does not seem to work. A friendly error message in logcat tells us that Android can't open the /sys/class/backlight/pwm-backlight/brightness file. Screen brightness and LEDs are controlled by the lights module on Android, so that's where we look first. There is a a hardware-specific one under the beagleboneblack device directory, but it only supports the LCD3 and LCD7 displays. Adding support for the LCD4 is simply a matter of finding the file that controls brightness under /sys. For the LCD4 it's called /sys/class/backlight/backlight.10/brightness and works exactly like the other LCDs -- you get or set the brightness by reading or writing the backlight intensity level (0-100) as a string. We modify light.c (full source on Github) to first try the LCD4 device and voila -- setting the brightness via the Android UI now works... not. It turns out the brightness file is owned by root and the Settings app doesn't have permission to write to it. We can change this permission in the board's init.am335xevm.rc file:

# PWM-Backlight for display brightness on LCD4 Cape
chmod 0666 /sys/class/backlight/backlight.10

This finally settles it, so we can cross requirement #1 off our list and try to tackle #2 -- wireless support.

WiFi adapter

The BBB has an onboard Ethernet port and it is supported out of the box by the rowboat build. If we want to make our new Android device mobile though, we need to add either a WiFi adapter or 3G modem. 3G support is possible, but somewhat more involved, so we will try to enable WiFi first. There are a number of capes that provide WiFi and Bluetooth for the original BeagleBone, but they are not compatible with the BBB, so we will try using a regular WiFi dongle instead. As long as it has a Linux driver, it should be quite easy to wire it to Android by following the TI porting guide, right?

We'll use a WiFi dongle from LM Technolgies based on the Realtek RTL8188CUS chipset which is supported by the Linux rtl8192cu driver. In addition to the kernel driver, this wireless adapter requires a binary firmware blob, so we need to make sure it's loaded along with the kernel modules. But before getting knee-deep into makefiles, let's briefly review the Android WiFi architecture. Like most hardware support in Android, it consists of a kernel layer (WiFi adapter driver modules), native daemon (wpa_supplicant), HAL (wifi.c in libharware_legacy, communicates with wpa_supplicant via its control socket), a framework service and its public interface (WifiService and WifiManager) and application/UI ('WiFi' screen in the Settings app, as well as SystemUI, responsible for showing the WiFi status bar indicator). That may sound fairly straightforward, but the WifiService implements some pretty complex state transitions in order to manage the underlying native WiFi support. Why is all the complexity needed? Android doesn't load kernel modules automatically, so the WifiStateMachine will try to load kernel modules, find and load any necessary firmware, start the wpa_supplicant daemon, scan for and connect to an AP, obtain an IP address via DHCP, check for and handle captive portals, and finally, if you are lucky, set up the connection and send out a broadcast to notify the rest of the system of the new network configuration. The wpa_supplicant daemon alone can go through 13 different states, so things can get quite involved when those are combined.

Going step-by-step through the porting guide, we first enable support for our WiFi adapter in the kernel. That results in 6 modules that need to be loaded in order, plus the firmware blob. The HAL (wifi.c) can only load a single module though, so we pre-load all modules in the board's init.am335xevm.rc and set the wlan.driver.status to ok in order to prevent WifiService from trying (and failing) to load the kernel module. We then define the wpa_supplicant and dhcpd services in the init file. Last, but not least, we need to set the wifi.interface property to wlan0, otherwise Android will silently try to use a test device and fail to start the wpa_supplicant. Both properties are set as PRODUCT_PROPERTY_OVERRIDES in device/ti/beagleboneblack/device.mk (see device directory on Github). Here's how the relevant part from init.am335xevm.rc looks like:

on post-fs-data
# wifi
mkdir /data/misc/wifi/sockets 0770 wifi wifi
insmod /system/lib/modules/rfkill.ko
insmod /system/lib/modules/cfg80211.ko
insmod /system/lib/modules/mac80211.ko
insmod /system/lib/modules/rtlwifi.ko
insmod /system/lib/modules/rtl8192c-common.ko
insmod /system/lib/modules/rtl8192cu.ko

service wpa_supplicant /system/bin/wpa_supplicant \
-iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \
-e/data/misc/wifi/entropy.bin
class main
socket wpa_wlan0 dgram 660 wifi wifi
disabled
oneshot

service dhcpcd_wlan0 /system/bin/dhcpcd -ABKL
class main
disabled
oneshot

service iprenew_wlan0 /system/bin/dhcpcd -n
class main
disabled
oneshot


In order to build the wpa_supplicant daemon, we then set BOARD_WPA_SUPPLICANT_DRIVER and WPA_SUPPLICANT_VERSION in device/ti/beagleboneblack/BoardConfig.mk. Note the we are using the generic wpa_supplicant, not the TI-patched one and the WEXT driver instead of the NL80211 one (which requires a proprietary library to be linked in). Since we are preloading driver kernel modules, we don't need to define WIFI_DRIVER_MODULE_PATH and WIFI_DRIVER_MODULE_NAME.

BOARD_WPA_SUPPLICANT_DRIVER      := WEXT
WPA_SUPPLICANT_VERSION := VER_0_8_X
BOARD_WLAN_DEVICE := wlan0

To make the framework aware of our new WiFi device, we change networkAttributes and radioAttributes in the config.xml overlay file. Getting this wrong will lead to Android's ConnectionManager totally ignoring WiFi even if you manage to connect and will result in the not too helpful 'No network connection' message. "1" here corresponds to the ConnectivityManager.TYPE_WIFI connection type (the built-in Ethernet connection is "9", TYPE_ETHERNET).

<string-array name="networkAttributes" translatable="false">
...
<item>"wifi,1,1,1,-1,true"</item>
...
</string-array>
<string-array name="radioAttributes" translatable="false">
<item>"1,1"</item>
...
</string-array>

Finally, to make Android aware of our newly found WiFi features, we copy android.hardware.wifi.xml to /etc/permissions/ by adding it to device.mk. This will take care of enabling the Wi-Fi screen in the Settings app:

PRODUCT_COPY_FILES := \
...
frameworks/native/data/etc/android.hardware.wifi.xml:system/etc/permissions/android.hardware.wifi.xml \
...

After we've rebuild rowboat and updated the root file system, you should be able to turn on WiFi and connect to an AP. Make sure you are using an AC power supply to power the BBB, because the WiFi adapter can draw quite a bit of current and you may not get enough via the USB cable. If the board is not getting enough power, you might experience failure to scan, dropping connections and other weird symptoms even if your configuration is otherwise correct. If WiFi support doesn't work for some reason, check the following:
  • that the kernel module(s) and firmware (if any) is loaded (dmesg, lsmod)
  • logcat output for relevant-lookin error messages
  • that the wpa_supplicant service is defined properly in init.*.rc and the daemon is started
  • that /data/misc/wifi and wpa_supplicant.conf are available and have the right owner and permissions (wifi:wifi and 0660)
  • that the wifi.interface and wlan.driver.status properties are set correctly
  • use your debugger if all else fails
That was easy, right? We now have a working wireless connection, it's time to think about requirement #3, powering the device.

Battery power

The BBB can be powered in three ways: via the miniUSB port, via the 5V AC adapter jack, and by using the power rail (VDD_5V) on the board directly. We can use any USB battery pack that provides enough current (~1A) and has enough capacity to keep the device going by simply connecting it to the miniUSB port. Those can be rather bulky and you will need an extra cable, so let's look for other options. As can be expected, there is a cape for that. The aptly named Battery Cape plugs into the BBB's expansion connectors and provides power directly to the power rail. We can plug the LCD4 on top of it and get an integrated (if a bit bulky) battery-powered touchscreen device. The Battery Cape holds 4 AA batteries connected as two sets in parallel. It is not simply a glorified battery holder though -- it has a boost converter that can provide stable 1A current at 5V even if battery voltage fluctuates (1.8-5.5V). It does provide support for monitoring battery voltage via AIN4 input, but does not have a 'fuel gauge' chip so we can't display battery level in Android without adding additional circuitry. That is ways our mobile device cannot display the battery level (yet) and unfortunately won't be able to shut itself down when battery levels become critically low. That is something that definitely needs work, but for now we make the device always believe it's at 100% power by setting the hw.nobattery property to true. The alternative is to have it display the 'low battery' red warning icon all the time, so this approach is somewhat preferable. Four 1900 mAh batteries installed in the battery cape should provide enough power to run the device for a few hours even when using WiFi, so we can (tentatively) mark requirement #3 as fulfilled.

Flashing the device

If you have been following Andrew Henderson's build guide linked above, you have been 'installing' Android on an SD card and booting the BBB from it. This works fine and makes it easy to fix things when Android won't load by simply mounting the SD card on your PC and editing or copying the necessary files. However, most consumer grade SD cards don't offer the best performance and can be quite unreliable. As we mentioned at the beginning of the post, the BBB comes with 2GB of built-in eMMC, which is enough to install Android and have some space left for a data partition. On most Android devices flashing can be performed by either booting into the recovery system or by using the fastboot tool over USB. The rowboat build does not have a recovery image, and while fastboot is supported by TI's fork of U-Boot, the version we are using to load the DT blob does not support fastboot yet. That leaves booting another OS in lieu of a recovery and flashing the eMMC form there, either manually or by using an automated flasher image. The flasher image simply runs a script at startup, so let's see how it works by doing it manually first. The latest BBB Angstrom bootable image (not the flasher one) is a good choice for our 'recovery' OS, because it is known to work on the BBB and has all the needed tools (fdisk, mkfs.ext4, etc.). After you dd it to an SD card, mount the card on your PC and copy the Android boot files and rootfs archive to an android/ directory. You can then boot from the SD card, get a root shell on the Angstrom and install Android to the eMMC from there.

Android devices typically have a boot, system and userdata parition, as well as a recovery one and optionally others. The boot partition contains the kernel and a ramdisk which gets mounted at the root of the device filesystem. system contains the actual OS files and gets mounted read-only at /system, while userdata is mounted read-write at /data and stores system and app data, as well user-installed apps. The partition layout used by the BBB is slightly different. The board ootloader will look for the first stage bootloader (SPL, named MLO in U-Boot) on the first FAT partition of the eMMC. It in turn will load the second state bootloader (u-boot.img) which will then search for a OS image according to its configuration. On embedded devices U-Boot configuration is typically stored as a set of variables in NAND, replaced by the uEnv.txt file on devices without NAND such as the BBB. Thus we need a FAT boot partition to host the SPL, u-boot.img, uEnv.txt, the kernel image and the DT blob. system and userdata will be formatted as EXT4 and will work as in typical Android devices.

The default Angstrom installations creates only two partitions -- a DOS one for booting, and a Linux one that hosts Angstrom Linux. To prepare the eMMC for Android, you need to delete the Linux partition and create two new Linux partitions in its place -- one to hold Android system files and one for user data. If you don't plan to install too many apps, you can simply make them equal sized. When booting from the SD card, the eMMC device will be /dev/block/mmcblk1, with the first partition being /dev/block/mmcblk1p1, the second /dev/block/mmcblk1p2 and so on. After creating those 3 partitions with fdisk we format them with their respective filesystems:

# mkfs.vfat -F 32 -n boot /dev/block/mmcblk1p1
# mkfs.ext4 -L rootfs /dev/block/mmcblk1p2
# mkfs.ext4 -L usrdata /dev/block/mmcblk1p3

Next, we mount boot and copy boot related files, then mount rootfs and untar the rootfs.tar.bz2 archive. usrdata can be left empty, it will be populated on first boot.

# mkdir -p /mnt/1/
# mkdir -p /mnt/2/
# mount -t vfat /dev/block/mmcblk1p1 /mnt/1
# mount -t ext4 /dev/block/mmcblk1p2 /mnt/2
# cp MLO u-boot.img zImage uEnv.txt am335x-boneblack.dtb /mnt/1/
# tar jxvf rootfs.tar.bz2 -C /mnt/2/
# umount /mnt/1
# umount /mnt/2

With this, Android is installed on the eMMC and you can shutdown the 'recovery' OS, remove the SD card and boot from the eMMC. Note that the U-Boot used has been patched to probe whether the SD card is available and will automatically boot from it (without you needing to hold the BBB's user boot button), so if you don't remove the 'recovery' SD card, it will boot again.

We now have a working, touch screen Android device with wireless connectivity. Here's how it looks in action:

Our device is unlikely to win any design awards or replace your Nexus 7, but it could be used as the basis of  dedicated Android devices, such as a wireless POS terminal or a SIP phone and extended even further by adding more capes or custom hardware as needed.

Summary

The BBB is fully capable of running Android and by adding off-the shelf peripherals you can easily turn it into a 'tablet' (of sorts) by adding a touch screen and wireless connectivity. While the required software is mostly available in the rowboat project, if you want to have the best hardware support you need to use BBB's native 3.8 kernel and configure Android to use it. Making hardware fully available to the Android OS is mostly a matter of configuring the relevant HAL bits properly, but that is not always straightforward, even with board vendor provided documentation. The reason for this is that Android subsystems are not particularly cohesive -- you need to modify multiple, sometimes seemingly unrelated, files at different locations to get a single subsystem working. This is, of course, not specific to Android and is the price to pay for building a system by integrating originally unrelated OSS projects. On the positive side, most components can be replaced and the required changes can usually be confined to the (sometimes loosely defined) Hardware Abstraction Layer (HAL).