Thursday, March 27, 2014

A Look at Android Wear

Google released Android Wear a version of the Android OS specifically designed for wearable device like smart watches and the like.
Actual devices should follow shortly by the middle of this year starting with smart watches from Motorola and LG.

Along with the announcement of Android Wear Google released a preview version of the Android Wear SDK for developers to test and try the new OS.
Looking at the SDKs emulator and docs thing might look a little bit disappointing at first glance, if the expectation is that reals apps can be installed on an Android Wear device.
The Wear API is designed that the wearable device is showing notifications from an Android phone by using the since Android 4.3 Jelly Bean available Notification Access service. This service allows apps to receive information about notifications displayed on device notification bar. In earlier versions of Android this was only available by using the Accessibility feature of Android.

To connect a device to an Android Wear emulator, Google has provided an Android Wear Preview app for registered developers. Because using the above mentioned “Notification Access” service, this app only runs on devices with Android 4.3 or higher.
When the app is enabled all (non ongoing) notifications will be displayed on the Android Wear device with the ability to use rich notifications which allow to use action buttons for sending Intents back to the smart phone.
This design has the advantage that without any change current apps will work with Android Wear out of box.

The possibilities currently available with that notification approach are quite limited and can be viewed on the Android Wear developer page.

In summary developers can use the following notification types:

  • Rich notifications including images and action buttons
  • Grouped notifications
  • Notifications with multiple pages
  • Receive voice input from a notification


That seems to be it as far as the official API concerned. But the question arises (at least from a hacker’s perspective) … Can the Android Wear OS run regular apps?

If we have a look at the above linked developer page, it states:

“Caution: Do not install apps on the Android Wear emulator. The system does not support traditional Android apps and the result of running such apps is unpredictable.”

It is indeed possible to run apps with some exceptions. Network access is not possible and in the case of most apps will lead to a crash of the app. Web Views are also not supported. Apart from that, apps seem to work fine, but the small display size might be a problem.
Because this is a block for developers and hackers, let’s have a look how to run apps on the Android Device emulator.

First of all an APK of an app is needed that does not require network access. An example of such an app is the StopWatch & Timer app from Google Play.
The APK can be extracted from another Android device with a backup app. Using APK Backup of the PAW web interface is also an option.
The APK can be simply installed onto an emulator running Android Wear with the following command:

adb install

When the APK has been installed, the app StopWatch & Timer app can be started like this:

adb shell am start -n com.sportstracklive.stopwatch/com.sportstracklive.stopwatch.BigStopWatchActivity

After startup the app will show up on the emulator’s screen. Apart from the  small screen estate, the app seems to be working fine. Event the preference screen is working.

All in all Android Wear seems to be a nice addition to the Android family and summer seems to be getting interesting with new devices popping up.

Sunday, March 16, 2014

Writing/Deleting Data with KitKat

Unfortunately Android 4.4 KitKat does restrict file access to the secondary SD card when it comes to writing and deleting files.

This restriction was actually introduced in Android 3.2 HoneyComb but was not enforced by device manufacturers.

With KitKat this seems to have changed (e.g. for Samsung devices) and so File-Managers including DavDrive can not write or delete files on the secondary SD card on some devices.
There is nothing that can be done from a software perspective, the only chance to change this is to root the device.

A detailed description can be found here:

External Blues: Google Has Brought Big Changes To SD Cards In KitKat, And Even Samsung Is Implementing Them


Thanks to Stefan for letting me know about this issue!