Wieso, weshalb, warum: Weil man‘s kann: Sony Fernseher updaten

Früher hat man sich einen Fernseher gekauft und dann für Jahre oder gar Jahrzehnte einfach benutzt. Es gab ja wenig technischen Fortschritt. Zum Glück sind diese Zeiten vorbei, neue Geräte kommen im Abstand weniger Monate mit einer besseren Funktionalität (z.B. SD -> HD -> 4k -> 8k, HDMI 2.x, OLDED) und sollten dabei normalerweise auch den Energieverbrauch optimieren. Smart TVs haben ein Betriebssystem wie jeder andere Computer auch, und dieses wird ständig aktualisiert. Damit sichert man sich seinen Fernseher ab, bekommt neue Features, neue Apps oder kleinere Verbesserungen.

Mein Sony TV ist ein KD-55XE8096. Ein Smart TV mit Android. Für dieses Modell bietet Sony ein Update des Betriebssystems an. Damit kommt Alexa, Android 8 und Verbesserungen bei der HDMI Wiedergabe – Ton, Kanal Umschalten.

In der Theorie sollte die Aktualisierung automatisch erfolgen. Sony stellt eine neue Android Version bereit, der TV lädt sich diese runter und dann kann diese installiert werden. Sollte, hätte, könnte, würde. Macht aber nicht. Zuerst veröffentlichte Sony das Update auf Android 8, dann wurde es wegen Problemen zurückgerufen und machte es später wieder verfügbar. Mein TV wird unterstützt, aber es wird keine neue Version gefunden. Weder automatisch im Hintergrund, noch bei direkter Aufforderung. Die neue Version für Android TV wird nicht gefunden.

Noch ist man nicht komplett auf den Willen des Fernsehers sich zu aktualisieren angewiesen. Man kann / darf das Update auch manuell anstoßen und durchführen. Dafür stellt Sony eine Anleitung online bereit. Diese Anleitung ist einfach und verständlich. Update herunterladen, auf USB Stick kopieren, beim TV einstecken, starten und warten. Beten hilft, denn sollte beim Update was nicht klappen, hat man mit großer Wahrscheinlichkeit für eine Weile einen nicht funktionsfähigen Fernseher, wenn nicht sogar Elektroschrott.

No risk, no fun. Es war klar: ein Update werde ich machen. Eine Datei herunterladen, auf einen USB Stick kopieren und dann warten: das kann ich. Ein kleines Problem: der USB Stick. Und das MacBook Pro. Der USB Stick muss so formatiert sein das der Sony TV die Daten lesen kann. Den Adapter für USB-C auf USB Type A hat man als Mac Benutzer natürlich zur Hand. USB Stick auch. Formatiert wird der USB Stick über das Festplattendienstprogramm.

Damit der Fernseher die Daten lesen kann, ist als Format ExFAT und als Schema MBR zu nehmen. GUID funktionierte nicht, hier wollte der Fernseher den Stick formatieren.

Danach die Update-Datei (sony…255.pkg) kopieren und nachdem der Fernseher den USB Stick erkannt und die Installationsdatei gefunden hat, startet das Update.

Android TV startet und lädt die einzelnen Apps.

Nach einer Weile ist dann Android TV einsatzbereit und der Fernseher ist auf dem neuesten Stand.

Let the world know

Install HWC app on emulator

To test a hybrid app for SUP 2.x or SMP 2.x on the emulator, you need to have the HWC app installed. The app is part of the SDK and delivered in source code and as a installable APK file.

Creating a new emulator is easy, but how to install the app? Using Eclipse to create Android apps means that you never get in touch with the adb command line tool. The Android IDE takes care of deploying the app. You can now import the source code of the container and deploy it or take the easier alternative: install the delivered apk. Here is a step by step guide on how to install a APK using adb command line tool.

  1. After the emulator is up and running, check if the emulator is working: adb devices

  2. Open command prompt
  3. Change to the dir where the APK is located: cd <path to SDK>\HybridApp\Containers\Android
  4. Issue: adb install HybridWebContainer.apk

  5. Open the application menu in Android and HWC app shows up

  6. Done

Google Android documentation on adb install.

Let the world know

Intel Android image and SMP 2.x MBO with UltraLite

Note: this blog was also published on SAP Community Network: http://scn.sap.com/community/mobile/blog/2014/10/15/intel-android-image-and-smp-2x-mbo-with-ultralite

After reading my blog about how to improve the performance of the Android emulator I guess you are using this image successfully for your Cordova development. In case you want to use the Intel image also for SUP/SMP MBO based projects, you won`t be able to do so. The UltraLite library is for ARM architecture and not for 386.

Here is a simple explanation why you’ll have to use the Google Android images (ARM): after adding the libraries to the Android project, coding the MBO part, deploying the app to the emulator and running it, the log shows an error message like:

FATAL EXCEPTION: main

java.lang.ExceptionInInitializerError

at com.ianywhere.ultralitejni16.DatabaseManager.connect(Unknown Source)

at com.sybase.afx.ulj.ConnectionUtil.createConnection(ConnectionUtil.java:199)

at com.sybase.afx.ulj.ConnectionUtil.getConnection(ConnectionUtil.java:176)

[…]

Caused by: java.lang.UnsatisfiedLinkError: Couldn’t load ultralitej16: findLibrary returned null

at java.lang.Runtime.loadLibrary(Runtime.java:365)

at java.lang.System.loadLibrary(System.java:535)

 

Keep in mind that the libraries for the UltraLite database used by MBOs is delivered as a binary library (.so).This library is already compiled and won`t be compiled again for your Android project. This library is for Android devices on ARM, as this is the primary architecture for Android smartphone / tablets is ARM. The folder that contains the files is named armeabi and the .so files make it clear that the library is not a Java object. While the jar for UltraLite included in the Android project allows communicating with the API, the libraries will fail to load on Intel emulator.

On the Intel image, a .so file is for Intel 80386 architecture:

While on the “original” emulator from Google the architecture is ARM:

Running the exact same app on the Google Android image will work. Just install the APK file on the right emulator.

Let the world know

Controlling Android network state with jMeter

Note: this blog is also published at SAP Community Network: http://scn.sap.com/community/mobile/blog/2014/10/13/controlling-android-network-state-with-jmeter

Testing a mobile web scenario includes testing the app end to end for different usage scenarios. This includes testing the state of the mobile device: online and offline. Consider the following scenarios: a HTTP POST request is send to SMP 3 which in turn will send out a push notification, or the UI5 app opens a HTTP request while the device is offline. Will the test pass as expected?

The Android emulator allows controlling the state of network connectivity by pressing F8. This turns gsm data on or off. Manually turning the data network on or off is possible while executing a test, but does not really reflect a real scenario where this happens randomly (entering elevator, subway, bad connection, etc) and is out of your control. To simulate a suddenly not available data connection means to be able to randomly deactivate and activate a data connection on the emulator.

First thing of course is to know how to turn off network in an automated way. To control the network state of the Android emulator, the command: gsm data off/on needs to be issued. To execute the command it is necessary to connect via telnet to the emulator.

Command: telnet localhost 5554

Note: 5554 is the number of the emulator. Connecting via adb shell won’t work.

Telnet opens the command shell and allows executing gsm command to turn off or on the network.

    

    

In case you followed some of my other blogs about testing, you`ll have noticed that I use jMeter. JMeter comes with an impressive list of functionality allowing you to cover almost everything in your test scenario. Therefore, my first thought was to use jMeter to control the network state of the Android emulator. This way, I can include this behavior in other test cases executed by jMeter.

While the commands and execution order is now known, a problem last: Windows telnet client cannot read a list of commands form command line and there is no jMeter telnet client plugin. There is no easy way to send the commands from jMeter to Android. These are two problems to solve:

  1. Send scripted telnet commands
  2. Execute these from jMeter

Send scripted telnet commands

Let’s solve problem 1: One possibility is to use a VB script to send the commands by emulating keyboard strikes. This implies that you should not use the keyboard at the same time – and writing a VBscript. And it does not solve the problem that depending on your Windows version you first will have to install telnet or even won`t be allowed doing so. The solution is a tool known in the Linux world, a tool created in a time WWW was only in its infancy and known only to a few: nc. The last released stable version of nc was released 10 years ago. Fortunately, there is a newer (better) implementation available from nmap: ncat. Ncat is included in the nmap download and available therefore for Windows. No compilation needed, just download and run ncat.exe. To open a telnet session to Android with ncat, the command is: ncat -4 –t localhost 5554

The commands to deactivate gsm data are:

gsm data off

quit

 

Save these to a input file (e.g. gms_off.txt) and let ncat read the file. Command: ncat -4 –t localhost 5554 < gsm_off.txt

This solves issue #1. Now telnet can be used to send a list of commands to Android. Next is to solve issue #2 so jMeter can execute the ncat command.

Execute ncat from jMeter

jMeter offers a OS Process sampler that allows executing a command line program. I wasn`t able to start ncat.exe directly; starting CMD and pass ncat as a parameter however works.

The command to be run is CMD and the input parameters are:

/C <path to nmap>\ncat.exe -4 –t localhost 5554 < <path>\gms_off.txt

Including another sampler for turning data connectivity on again lets jMeter control the network state. Adding a timer element adds the random part to the test. Of course the procedure outlined here is not not applicable to network data, but to all commands available by the Android command shell.

Let the world know