J-Pilot Data on Android Phone: Contacts

Keeping J-Pilot data in sync with Android smartphone is quite a challenge. See my post about Google calendar. Copying contact data from J-Pilot to Android in the past went like this:

  1. Export data from J-Pilot in vCard (vcf) format
  2. If required, fiddle with this vcf file with some Perl script
  3. Stopping contact app in Android and stopping WiFi. Deleting all data in Android app.
  4. Manually delete contacts in Google Contacts in batches of ca. 500 records (Added 10-May-2020: Meanwhile there is no longer a limit here, so you can delete all your contacts in one go.)
  5. Import vCard data in Google Contacts
  6. Turn on WiFi on Android, starting contact-app

As one can easily see, this was very cumbersome. To make this even more difficult, now Google has limited the number of imported records in vCard file to 1,000 records per day. If you have more than that, then you are stuck. The limits are documented in quotas. Continue reading

ssh and rsync for Android, Termux

I used SSHelper for some time to rsync my files from my Linux machine to Android phones, see here. I most notably used this for transfering photos. I now user Termux. I prefer Termux over SSHelper as it allows to install new programs within Termux using pkg oder apt-get.

Starting Termux looks like this:

Continue reading

Google Chrome in Android Cannot Clear Cookies

Google Chrome on Android version 74.0.3729 can no longer clear history, cookies, local data, etc. See screenshot below.

Even when this process is running completely uninterrupted, nothing happens. I.e., changing display sleep time to 30 minutes, Google Chrome will not finish.

Problem solution: Shut down phone. Power up again, and try again to delete cookies. This time it worked. Seems that some Android Chrome internal locking and contention blocked deletion.

Upgrading from OxygenOS 1.0.3 to 2.1.4 on the OnePlus One Smartphone

This short guide describes how to upgrade your OnePlus One Smartphone from OxygenOS version 1.0.3 to 2.1.4. In this case the initial version of your OS is of no relevant importance — you can also upgrade from version 1.0.0, but see Installing OxygenOS 1.0 on the OnePlus One Smartphone and Upgrading from OxygenOS 1.0.0 to 1.0.3 on the OnePlus One Smartphone.

Before start we need adb and fastboot. On ArchLinux these programs are in android-tools:

pacman -Syu android-tools

Copying the OS image to the phone takes almost three minutes.

adb devices

time adb push OnePlus_Bacon_OxygenOS_201601190107.zip /sdcard/
4842 KB/s (767726302 bytes in 154.821s)

real    2m34.909s
user    0m0.007s
sys     0m0.683s

Upgrading from OS 1.0.3 to 2.1.4 is apparently not possible by using TWRP. OxygenOS 2.1.4 for the OnePlus One says
Continue reading

Upgrading from OxygenOS 1.0.0 to 1.0.3 on the OnePlus One Smartphone

I upgraded my OnePlus One smartphone from Oxygen 1.0.0 to 1.0.3, see Installing OxygenOS 1.0 on the OnePlus One Smartphone.

Download OxygenOS 1.0.3 from OxygenOS 1.0.3 with the latest Stagefright patches, and check MD5. Then upload the zip-file.

adb push ~/Download/ONE_12_A.01_150827.zip /sdcard/

It is stated in Oxygen 1.0.2 Release with Stagefright security patches that “If you are already on OxygenOS, this update does not require a reset.” I had to factory reset my phone as TWRP didn’t recognize the system partition; it was encrypted, although encryption in my previous efforts never worked. It looks like it worked for TWRP only.

Shut down phone, and reboot with power-button and volume-down pressed, boot into TWRP, select your image on /sdcard. That’s it.

These are the versions displayed:

  1. Android version 5.0.2
  2. OxygenOS version 1.0.3
  3. Kernel version 3.4.0-perf-g2e81366, bacon@oneplus.net #1
  4. Build date 27-Aug-2015
  5. Build number A0001_12_150827

Using OxygenOS 1.0.3 I noticed the following:

  1. Battery consumption is still high.
  2. It is no longer possible to initiate SIP calls with the build-in telephone application, although you may still receive SIP calls, see also shahazadkm in OnePlus forum.
  3. Apps apparently no longer install automatically after factory default.
  4. I didn’t try encryption as this was a fiasco in OxygenOS 1.0.0.

For an answer as why not update to a higher OxygenOS version see OxygenOS 2.0 Q&A:

As for all of you wondering when the OnePlus One will get an update to the latest OxygenOS version, the answer is that we are working on it but the official date is not quite set yet. Since 2.0 is optimized for Snapdragon 810, it will take us a bit of time to port things over. In the meantime, the OnePlus One will still be officially supported by CM.

The OnePlus One has a Snapdragon 801.

See also Marshmallow upgrade schedule for OnePlus devices:

For the OnePlus One, Cyanogen OS will be updating to Marshmallow in the first quarter of 2016. We created a community build of OxygenOS for the OnePlus One, but this isn’t what the product officially ships with. We will be updating the community build of OxygenOS for the OnePlus One when time allows.

Update 23-Jan-2016: Oxygen 2.1.4 for the OnePlus One is out, see https://forums.oneplus.net/threads/oxygenos-2-1-4-for-the-oneplus-one.425544/

See also Upgrading from OxygenOS 1.0.3 to 2.1.4 on the OnePlus One Smartphone.

Accessing Android phone via USB cable

Since Android 3 it is no longer possible to access the phone via USB mount. The reason being that Android puts everything into a single partition. As this single partition is always mounted by Android it is not easy to have two users (Android system and PC user) to write on this single partition. Therefore one needs a separate way to access the whole or parts of the filesystem. One solution is ssh, see ssh and rsync for Android, or MTPFS.

apt-get install mtpfs
mtpfs /mnt/sd              # mount
...                        # use it
fusermount -u /mnt/sd      # umount

See also: MTP – what is it, why use it, and how to set it up, or Geräte mit Android 3.0 oder 4.0 via MTP in Ubuntu Linux einbinden (in German).

Installing OxygenOS 1.0 on the OnePlus One Smartphone

Some notes and sketches to install OxygenOS on the OnePlus One, plus some remarks on my experiences.

Download twrp.

Download OxygenOS from here. Unzip the file and check MD5 of oxygen_1.0.0_flashable.zip with MD5 from web-page.

$ cat oxygen_1.0.0_flashable.md5 
2d79312774c44d2fa2bf5bb0c877d1b7  ONE_12_OTA_001_all.zip
$ md5sum oxygen_1.0.0_flashable.zip 
2d79312774c44d2fa2bf5bb0c877d1b7  oxygen_1.0.0_flashable.zip

Installation instructions are in Installation Guide. This guide is also very helpful: How to Install CyanogenMod on the OnePlus One (“bacon”).

Install fastboot and adb, e.g.,

apt-get install android-tools-adb
apt-get install android-tools-fastboot

As user root:

adb reboot bootloader
adb devices
fastboot devices
fastboot oem unlock
fastboot flash recovery twrp-
adb shell
adb push oxygen_1.0.0_flashable.zip /sdcard/

It is recommended to install supersu, which is offered on the phone during installation.

Some remarks on my experience with OxygenOS after three weeks of use:

  1. Battery life is worse than with old CM11, CM12 also has these battery drain issues. It looks like this is a general Lollipop problem.
  2. Double tap to turn phone off no longer works.
  3. Encryption of phone no longer works.

See also Upgrading from OxygenOS 1.0.3 to 2.1.4 on the OnePlus One Smartphone.

Three Free Invites For the OnePlus One

I have written a review on the OnePlus One smartphone. I have three more invites for the OnePlus One smartphone. Below are the codes. Use them according “first come, first served”.

Invite 1 with code GLK0-ZEFI-BW0A-MYZG has been claimed and used.

Invite 2 with code GLV4-U7PE-V1AL-YJZN was claimed and then just expired.

Invite 3 with code GLVM-B9PN-7DHT-2QIT has been claimed and used.

Addendum 02-Jan-2015: The first and last invites have been claimed, and then not used, i.e., they are ready to be claimed. The second one has been claimed, but had been claimed previously and then not been used. What I do not fully understand is, that people apparently claim something and then make no use of it.


Addendum 06-Jan-2015: No more invites here in this post. I am a bit annoyed that invite #2 has been claimed multiple times, and now has just expired.

Review of the OnePlus One Smartphone

End of August I bought the OnePlus One smartphone, henceforth called OnePlus. Previously I owned a Google Nexus 4 smartphone. My initial motive for a new smartphone was to have more storage in my phone. As I use my phone as a camera and do no longer use a “real” camera, lots of pictures end up on my phone. The Nexus 4 had 8 GB of memory. My new OnePlus has 64 GB of storage, although basically only 56 GB are left for the user.

Continue reading

Performance of Dalvik versus native C compilation

Android application programs are usually written in the Java programming language. Java source code is compiled to bytecode, which is then interpreted by the Java virtual machine. Current virtual machines (VM for short) use two tricks to improve performance:

  1. compile bytecode to machine code during run-time (JIT: just-in-time compilation)
  2. optimize machine code according usage pattern (hotspot technology)

Despite all these tricks native code produced by C/C++ compilers is ways faster than JIT/hotspot, see for example shootout from 2008, or see The Computer Language Benchmarks Game.

Continue reading