Showing posts with label Android. Show all posts
Showing posts with label Android. Show all posts

Sunday, November 07, 2021

Your emulator is out of date, please update by launching Android Studio

Your emulator is out of date, please update by launching Android Studio

I sometimes run Android emulator from the command line, like:
c:\>emulator -avd Pixel_2_API_30

Most of the time I would see the following on the console output
WARNING | unexpected system image feature string, emulator might not function correctly, please try updating the emulator.
INFO    | added library vulkan-1.dll
INFO    | configAndStartRenderer: setting vsync to 60 hz
ERROR   | Failed to open /qemu.conf, err: 2
HAX is working and emulator runs in fast virt mode.
INFO    | Started GRPC server at 127.0.0.1:8554, security: Local
INFO    | Advertising in: C:\Users\u1\AppData\Local\Temp\avd\running\pid_14608.ini
INFO    | Your emulator is out of date, please update by launching Android Studio:
 - Start Android Studio
 - Select menu "Tools > Android > SDK Manager"
 - Click "SDK Tools" tab
 - Check "Android Emulator" checkbox
 - Click "OK"

INFO    | boot completed
INFO    | Increasing screen off timeout, logcat buffer size to 2M.
INFO    | Revoking microphone permissions for Google App.

To fix it, open Android Studio then do Tools | SDK Manager. Ensure that "Android SDK Build-Tools" is the latest.

Sunday, December 01, 2019

termux powerline status configuration

termux is a terminal emulator and Linux environment on Android. To make it even better (looks), enable powerline-status. Start by installing git on termux, like:

x1@x1-pc:~$ pkg install git

Then clone termux-style, like:
x1@x1-pc:~$ git clone https://github.com/adi1090x/termux-style.git
x1@x1-pc:~$ cd termux-style
x1@x1-pc:~$ chmod +x setup
x1@x1-pc:~$ ./setup
x1@x1-pc:~$ termux-style

Then install Python, like:
x1@x1-pc:~$ pkg install python

Next up, install powerline-status, like:
x1@x1-pc:~$ pip install powerline-status

Update ~/.bash_profile to load powerline-status, like:


//xyz

Monday, October 03, 2016

Location of Android ADB in Windows

Android Debug Bridge (adb.exe) location in Windows 10

C:\Users\<uername>\AppData\Local\Android\sdk\platform-tools

Sunday, September 13, 2015

How to shutdown android-x86 pC

Press Alt+F1, then type:

#: reboot -p

Reference(s):
https://groups.google.com/forum/#!topic/android-x86/pEI7xAnOpNY

Saturday, July 06, 2013

Android Studio Early Access Preview installation tour

Android Studio is a new Android development environment based on IntelliJ IDEA. Similar to Eclipse with the ADT Plugin, Android Studio provides integrated Android developer tools for development and debugging. On top of the capabilities you expect from IntelliJ, Android Studio offers:
  • Gradle-based build support.
  • Android-specific refactoring and quick fixes.
  • Lint tools to catch performance, usability, version compatibility and other problems.
  • ProGuard and app-signing capabilities.
  • Template-based wizards to create common Android designs and components.
  • A rich layout editor that allows you to drag-and-drop UI components, preview layouts on multiple screen configurations, and much more.
This was tested on:
  • Windows 7 64-bit Pro
  • JDK 1.7 update 25 64-bit
Workaround(s): Android Studio bundle 130.677228 gets confused when multiple versions of JDK are installed on the machine. To workaround set JAVA_HOME and PATH environment variables accordingly. For example, set JAVA_HOME to "C:\Program Files\Java\jdk1.7.0_25" if you have installed JDK 1.7 update 25. Also, change PATH="C:\Program Files\Java\jdk1.7.0_25\bin";"existing path here".

Installation steps:
  1. Download JDK 1.7.
  2. Install JDK.
  3. Change/set JAVA_HOME environment variable.
  4. Download Android Studio Early Access Preview (link).
  5. Follow installation wizard. 
 See below for installation screen captures.










Sunday, November 25, 2012

Android Blogger client force closes - not usable

Blogger client force closes in my Droid Razr Maxx, can't use it at all :(.

This was observed with Blogger v2.0.

Ok, reboot of the phone fixes it.

Personal best ssh client for Android

Remotely connecting to Linux securely in Android is like a walk in the park, ssh clients abound in Google Play Store. But ssh clients are not created alike. Some are designed with specific hardware in mind and for those who like to use physical keyboards, like Droid 3, you probably want to use all the keys. I have tried Terminal IDE, ConnectBot, Android Terminal Emulator but none of them work as I would have hoped. Like using ~, tab key for command line completion, display mc (Midnight Commander) properly. But one actually meet my need today, VX ConnectBot. In my understanding it is based on ConnectBot with changes to allow a much more pleasant experience using hardware keyboard. Try it for yourself, download from Google Play Store.

Note:
* Tested using Droid Razr Maxx using stock OS and Droid 3 using ICS.

Saturday, September 24, 2011

Failed to successfully run an emulated Android device on Ubuntu 11.04

 I was trying to play with Android platform on Ubuntu 11.04 but I hit a roadblock trying to run an emulated Android device using a non-root account. Did an strace but nothing stands out, not that I am an expert. Searching the web does not provide me with something really useful.

Here few things interesting. Running an android virtual device as root works as expected. But running an android virtual device as a regular user halt/stops at a blank window for the emulated device.

Running it verbose shows the following:

//---- some of the strings removed ----
.
QEMU options list:
emulator: argv[00] = "./emulator-arm"
emulator: argv[01] = "-android-hw"
emulator: argv[02] = "/home/timus/.android/avd/e.avd/hardware-qemu.ini"
Concatenated QEMU options:
 ./emulator-arm -android-hw /home/timus/.android/avd/e.avd/hardware-qemu.ini
emulator: registered 'boot-properties' qemud service
emulator: nand_add_dev: system,size=0x4e00000,initfile=/home/timus/android/platforms/android-8/images//system.img
emulator: mapping 'system' NAND image to /tmp/android-timus/emulator-kTuuh9
emulator: rounding devsize up to a full eraseunit, now 4e1e000

emulator: nand_add_dev: userdata,size=0x4200000,file=/home/timus/.android/avd/e.avd/userdata-qemu.img
emulator: registered 'boot-properties' qemud service
emulator: Adding boot property: 'dalvik.vm.heapsize' = '24m'
emulator: Adding boot property: 'qemu.sf.lcd_density' = '120'
emulator: nand_add_dev: cache,size=0x4200000,file=/home/timus/.android/avd/e.avd/cache.img
emulator: Kernel parameters: qemu=1 console=ttyS0 android.qemud=ttyS1 android.checkjni=1 ndns=1
emulator: Trace file name is not set

emulator: autoconfig: -scale 1
emulator: control console listening on port 5554, ADB on port 5555
emulator: sent '0012host:emulator:5555' to ADB server
emulator: ping program: /home/timus/android/tools/ddms
emulator: ping command: /home/timus/android/tools/ddms ping emulator 13.0


strace shows the following, with the top messages cut off:

//---- a lot of messages before this... left out as I am not sure if it helps ----

open("/home/timus/.android/modem-nv-ram-5554", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0755) = 21
write(21, "modem_technology gsm\noper_name_i"..., 171) = 171
close(21)                               = 0
socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 21
connect(21, {sa_family=AF_INET, sin_port=htons(5037), sin_addr=inet_addr("127.0.0.1")}, 16) = 0
send(21, "0012host:emulator:5555", 22, 0) = 22
write(1, "emulator: sent '0012host:emulato"..., 54emulator: sent '0012host:emulator:5555' to ADB server
) = 54
shutdown(21, 2 /* send and receive */)  = 0
close(21)                               = 0
readlink("/proc/self/exe", "/home/timus/android/tools/emulator-arm"..., 1024) = 38
write(1, "emulator: ping program: /home/ti"..., 55emulator: ping program: /home/timus/android/tools/ddms
) = 55
access("/home/timus/android/tools/ddms", F_OK) = 0
rt_sigprocmask(SIG_BLOCK, [ALRM], [ALRM], 8) = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb7809948) = 6537
rt_sigprocmask(SIG_SETMASK, [ALRM], NULL, 8) = 0
write(1, "emulator: ping command: /home/ti"..., 74emulator: ping command: /home/timus/android/tools/ddms ping emulator 13.0
) = 74
brk(0xa643000)                          = 0xa643000
poll([{fd=3, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=3, revents=POLLOUT}])
writev(3, [{"\22\0\10\0\3\0\340\4'\0\0\0\37\0\0\0\10\0\0\0\6\0\0\0005554:e\7\0"..., 132}, {NULL, 0}, {"", 0}], 3) = 132
poll([{fd=3, events=POLLIN}], 1, -1)    = 1 ([{fd=3, revents=POLLIN}])
read(3, "\34\0~\0\3\0\340\4'\0\0\0\302\20\357\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 160
read(3, 0xa2a84a0, 4096)                = -1 EAGAIN (Resource temporarily unavailable)
clock_gettime(CLOCK_MONOTONIC, {49221, 836305909}) = 0
select(21, [8 11 19 20], [], [], {0, 0}) = 1 (in [19], left {0, 0})
gettimeofday({1316917045, 343804}, NULL) = 0
accept(19, {sa_family=AF_INET, sin_port=htons(52886), sin_addr=inet_addr("127.0.0.1")}, [16]) = 21
fcntl64(21, F_GETFL)                    = 0x2 (flags O_RDWR)
fcntl64(21, F_SETFL, O_RDWR|O_NONBLOCK) = 0
setsockopt(21, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
setsockopt(21, SOL_SOCKET, SO_OOBINLINE, [1], 4) = 0
setsockopt(21, SOL_TCP, TCP_NODELAY, [1], 4) = 0
clock_gettime(CLOCK_MONOTONIC, {49221, 837887026}) = 0
clock_gettime(CLOCK_MONOTONIC, {49221, 837911639}) = 0
read(3, "\34\0\202\0\3\0\340\4\16\1\0\0\307\20\357\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 4096) = 32
read(3, 0xa2a84a0, 4096)                = -1 EAGAIN (Resource temporarily unavailable)
read(3, 0xa2a84a0, 4096)                = -1 EAGAIN (Resource temporarily unavailable)
read(3, 0xa2a84a0, 4096)                = -1 EAGAIN (Resource temporarily unavailable)
read(3, 0xa2a84a0, 4096)                = -1 EAGAIN (Resource temporarily unavailable)
read(3, 0xa2a84a0, 4096)                = -1 EAGAIN (Resource temporarily unavailable)
read(3, 0xa2a84a0, 4096)                = -1 EAGAIN (Resource temporarily unavailable)
read(3, "\226\0\202\0\3\0\340\4\3\0\340\4&\0`\4\270\1k\0\307\2\263\1\0\0\0\0\0\0\0\0"..., 4096) = 128
read(3, 0xa2a84a0, 4096)                = -1 EAGAIN (Resource temporarily unavailable)
read(3, 0xa2a84a0, 4096)                = -1 EAGAIN (Resource temporarily unavailable)
read(3, 0xa2a84a0, 4096)                = -1 EAGAIN (Resource temporarily unavailable)
read(3, 0xa2a84a0, 4096)                = -1 EAGAIN (Resource temporarily unavailable)
read(3, 0xa2a84a0, 4096)                = -1 EAGAIN (Resource temporarily unavailable)
read(3, 0xa2a84a0, 4096)                = -1 EAGAIN (Resource temporarily unavailable)
read(3, 0xa2a84a0, 4096)                = -1 EAGAIN (Resource temporarily unavailable)
read(3, 0xa2a84a0, 4096)                = -1 EAGAIN (Resource temporarily unavailable)
read(3, 0xa2a84a0, 4096)                = -1 EAGAIN (Resource temporarily unavailable)
read(3, 0xa2a84a0, 4096)                = -1 EAGAIN (Resource temporarily unavailable)
select(4, [3], NULL, NULL, {0, 0})      = 0 (Timeout)
read(3, 0xa2a84a0, 4096)                = -1 EAGAIN (Resource temporarily unavailable)
select(4, [3], NULL, NULL, {0, 0})      = 0 (Timeout)
clock_gettime(CLOCK_MONOTONIC, {49221, 894015842}) = 0
gettimeofday({1316917045, 400822}, NULL) = 0
--- SIGCHLD (Child exited) @ 0 (0) ---
waitpid(-1, NULL, WNOHANG)              = 6537
sigreturn()                             = ? (mask now [ALRM])
clock_gettime(CLOCK_MONOTONIC, {49223, 124717374}) = 0
clock_gettime(CLOCK_MONOTONIC, {49223, 124752199}) = 0


As a workaround, I have to run the application using sudo (essentially as a root user). Anyway, my command looks like:
./emulator @my_avd -verbose

I will keep on investigating what it takes to run emulated Android device in Ubuntu 11.04 as non-root.

~ts

Monday, September 19, 2011

Android emulator-arm.exe crashing in Windows XP

I have tried to install Android SDK (r12) to start playing with developing applications for the platform. For no reason, I picked Windows XP Sp3 as my development OS.

Customary to getting started with new programming language or platform is to create the equivalent "Hello World". The sample program was small and easy to digest but running it for the first time was not a good experience.

The default Android Virtual Device configuation as per the tutorial keeps crashing on Windows XP. This is the message that I am seeing:
emulator-arm.exe has encountered a problem and needs to close.
We are sorry for the inconvenience
Searching the blogosphere shows the following sites that standout:
The information from Stackoverflow did give a good hint as to what might be the issue. It seems like the Android SDK, specially the emulator, does not like spaces in the directories. With VirtualBox virtualization at my disposal, I started poking around with the installer.

To make the long trial and error short, below are the key changes to make Android development a little smoother.

Before installing the Android SDK (installer_r12-windows.exe), set the following system environment variable:
ANDROID_SDK_HOME = d:\home
Of course you have to change d:\home to your desired folder. Ensure that the folder exists, this is important before starting with the installation. By the way, this is the folder where the Android virtual device(s) will be created.

Now, install Android SDK. I would suggest to use c:\android\sdk for the destination folder.  If not, ensure that the path location does not include any spaces and that the individual folder length is less than or equal to eight characters.

With all this set, continue with the installation of Android software development environment and enjoy!!!

~ts

CPP Quick Guide

Basics Hello world User input While loop If statement For loop Switch statement Read file using ifstream Write to a file using ofstr...