Showing posts with label how to. Show all posts
Showing posts with label how to. Show all posts

Monday, April 8, 2019

Enable USB 2.0/3.0 supported for VirtualBox

By default, Oracle VirtualBox support USB 1.1 only. This video show how to enable USB 2.0/3.0 for VirtualBox 6.0.4/Windows 10 by installing VirtualBox Extension Pack.


Visit VirtualBox Downloads page, scroll down to download and install VirtualBox 6.0.4 Oracle VM VirtualBox Extension Pack.

Support for USB 2.0 and USB 3.0 devices, VirtualBox RDP, disk encryption, NVMe and PXE boot for Intel cards. See this chapter from the User Manual for an introduction to this Extension Pack. The Extension Pack binaries are released under the VirtualBox Personal Use and Evaluation License (PUEL). Please install the same version extension pack as your installed version of VirtualBox.




Thursday, February 21, 2019

Install JetBrains Toolbox App on Linux, and also Android Studio and IntelliJ IDEA (Java IDE)

JetBrains Toolbox App is a lightweight cross-platform companion application for JetBrains' coding tools, to manage installed tools, download new ones and open recent projects.

System requirement to install Toolbox App for Linux:
64-bit x86, glibc 2.17 (Ubuntu 14.04 or newer). JetBrains Toolbox App is packaged in AppImage and requires FUSE to run.

To check the version of your glibc, it's a simple method, using ldd command in Terminal:
$ ldd --version

It will show something like this:
ldd (Ubuntu GLIBC 2.27-3ubuntu1) 2.27

To install and set FUSE, follow the steps in AppImage Wiki.

For Ubuntu, enter the commands in Terminal:

$ sudo apt install fuse
$ sudo modprobe fuse
$ sudo groupadd fuse
$ user="$(whoami)"
$ sudo usermod -a -G fuse $user

Visit https://www.jetbrains.com/toolbox/app/ to download the, currently it's version 1.13.

This video show how to Install JetBrains Toolbox App on Linux Mint 19.1

Install Android 3.3.1 on Linux Mint 19.1 with JetBrains Toolbox, Hello World and convert Java to Kotlin.

IntelliJ IDEA (Java IDE) with JetBrains Toolbox.

Saturday, June 17, 2017

Install Python 3.6 (and IDLE/pip) on Ubuntu 17.04


To install Python 3.6 on Ubuntu 17.04, enter the command:
$ sudo apt-get install python3.6

Install IDLE for Python 3.6, idle-python3.6:
$ sudo apt install idle-python3.6


To install package using pip for Python 3.6:

- Download get-pip.py from https://pip.pypa.io/en/latest/installing/

- Install pip for Python 3.6
$ sudo python3.6 get-pip.py

- Install package:
$ sudo python3.6 -m pip install <package>
reference: Python documenet - Installing Python Modules - ... work with multiple versions of Python installed in parallel

Monday, September 7, 2015

Install Xiaomi RedMi 2 (紅米手機2) USB and ADB driver, on Windows

To install RedMi 2 (紅米手機2) USB and ADB drivers, tested on Windows 10:
- Plug in your phone to PC, using USB cable. You will find a CD Driver, click to run the Setup.


- It will install the Xiaomi Assistance program, USB and ADB driver.



To enable USB debug, you have to allow USB debugging on your phone.


To enable ADB Wireless debugging, your PC and your phone should be in the same WiFi network:
- Switch to platform-tools directory, normally in "C:\Program Files (x86)\Android\android-sdk\platform-tools"
- Run "adb devices", you should find the usb connected device.
- Run "adb tcpip 5555" to reset the tcpip connection.
- Run "adb connect <your phone's IP>" to connect adb with wireless
- Run "adb devices" again, you should find both the usb connected and WiFi connected devices.
- Now, you can remove the USB connection, and debug with ADB wirelessly.



Sunday, August 30, 2015

How to check if your Intel CPU's Virtualization Technology is Enabled? - Intel® Processor Identification Utility

If your CPU is Intel, you can use Intel® Processor Identification Utility to check if your CPU's Virtualization Technology is Enabled or not.

Intel® Processor Identification Utility Download for Windows

Intel® Processor Identification Utility is designed to identify current Intel® Processors and technologies, and it enables you to run and save a processor ID report. The utility also features a frequency test to make sure that the processor is working at the rated speed.




This video walks you through how to download and install the application. It also provides an overview of the most common technologies supported by the processor.


Alternatively, you can check it with Coreinfo.

Friday, August 14, 2015

Check your installed Google Play Services version


To know version of the installed Google Play services on your Android devices, go to Setting -> Apps Manager, tap Google Play services to view App info.

Wednesday, May 13, 2015

How to enable Developer Options on Xiaomi Redmi 2



To enable Developer Options on Xiaomi Redmi 2 (紅米手機2), running Android 4.4.4:
> Settings
> About phone
> Tap on "MIUI version" 7 times to enable Developer Options.

Once enabled, to access Developer Options:
> Settings
> Additional settings
> Developer options



Sunday, March 29, 2015

adb command to reboot Android device

To deboot connect devies using adb, enter the commnad:
$ adb shell am broadcast -a android.intent.action.BOOT_COMPLETED


Wednesday, March 25, 2015

Setting Up Google Play Services, for Eclipse-Android SDK

This video show how to set up Google Play Services on Eclipse with Android SDK, reference Google document Setting Up Google Play Services.


Include how to:
- Install Google Play services SDK using Android SDK Manager.
- Import library project google-play-services_lib.
- Add referencing to google-play-services_lib in your project.
- Modify AndroidManifest.xml, to add <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> under <application>.

Also override onResume() method, to call GooglePlayServicesUtil.isGooglePlayServicesAvailable() method to test our setup.

Then finally, try something wrong, in case:
- With google-play-services_lib project closed, Errors of java.lang.NullPointerException occurred during the build.


- Without <meta-data...> in AndroidManifest.xml, no error in compiling, but fail in run time.


- Without referencing to google-play-services_lib, cannot resolve com.google


Once you've set up your project to reference the library project, you can begin developing features with the Google Play services APIs.

Wednesday, March 18, 2015

How to set static IP on Android

This video show how to set static IP address on Android device.




  • In Wi-Fi settings.
  • Tap and hold the network you want to connect.
  • Tap Modify Network.
  • Tap to check Advanced Options.
  • Tap to select IP Settings, select Static.
  • Enter your setting.
  • Tap Save.



Monday, January 26, 2015

How to fix "Found 2 versions of android-support-v4.jar in the dependency list"

Recently after updated SDK on Android-Eclipse, tried to import my old example, and have the following error reported:

Found 2 versions of android-support-v4.jar in the dependency list,
but not all the versions are identical (check is based on SHA-1 only at this time).
...

My solution is to delete the file android-support-v4.jar in libs folder of my project.

Friday, December 26, 2014

The method getContentResolver() is undefined for the type...

Normally we will call getContentResolver() in our Activity or ActionBarActivity... to get a ContentResolver instance for your application's package. In case you try to call it at seperate class, you will be reported error of "The method getContentResolver() is undefined for the type...". You have to pass Context of your activity to the another class to call getContentResolver(), as shown in the video.


This example also show different ContentResolver return with different context passed.



MainActivity.java
package com.example.androidhello;

import android.support.v7.app.ActionBarActivity;
import android.content.ContentResolver;
import android.os.Bundle;
import android.widget.TextView;

public class MainActivity extends ActionBarActivity {

 @Override
 protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  
  TextView tv = new TextView(this);
  setContentView(tv);
  
  ContentResolver contentResolverA = getContentResolver();
  
  //same ContentResolver returned
  ContentResolver contentResolverB = AnotherClass.tryGetContentResolver(this);
  //ContentResolver contentResolverB = AnotherClass.tryGetContentResolver(MainActivity.this);
  //ContentResolver contentResolverB = AnotherClass.tryGetContentResolver(tv.getContext());
  //ContentResolver contentResolverB = AnotherClass.tryGetContentResolver(getBaseContext());

  //not same
  //ContentResolver contentResolverB = AnotherClass.tryGetContentResolver(getApplicationContext());
  
  String msg = this +"\n"
    + MainActivity.this + "\n"
    + tv.getContext() + "\n"
    + getBaseContext() + "\n"
    + getApplicationContext() + "\n\n";
  
  if(contentResolverA == contentResolverB){
   msg += "contentResolverA == contentResolverB\n"
    + contentResolverB;
  }else{
   msg += "contentResolverA != contentResolverB\n"
    + contentResolverA + "\n"
    + contentResolverB;
  }
  
  tv.setText(msg);
 }

}

AnotherClass.java
package com.example.androidhello;

import android.content.ContentResolver;
import android.content.Context;

public class AnotherClass {
 
 static public ContentResolver tryGetContentResolver(Context c){
  ContentResolver contentResolver = c.getContentResolver();
  return contentResolver;
 }

}

Thursday, September 18, 2014

How to enable emoji input on Android

Open Setting -> Language & input, scroll down to Keyboard & Input Method. If you see the option of iWnn IME (Emoji), that means your device built-in support Emoji input. Check to enable it.


When you enter text, press and hold SpaceBar, to switch to Emoji (iWnn IME).



Tuesday, September 16, 2014

"The import android.support.v7 cannot be resolved" and "ActionBarActivity cannot be resolved to a type"

It's a common error "The import android.support.v7 cannot be resolved" on import android.support.v7.app.ActionBarActivity; and "ActionBarActivity cannot be resolved to a type" on extends ActionBarActivity. It may be various reason to cause it. One of the reason is the auto-generated project appcompat_v7 closed.

Please check the video:

Friday, August 15, 2014

Install VirtualBox 4.3 on Ubuntu 14.04 from repository source

This post show how to install VirtualBox 4.3 on Ubuntu 14.04, from repository.




The list of repository sources can be found at https://www.virtualbox.org/wiki/Linux_Downloads. For 14.04 ("Trusty Tahr"), it is "deb http://download.virtualbox.org/virtualbox/debian trusty contrib".



Run the command to add apt repository to your sources list:
$ sudo add-apt-repository "deb http://download.virtualbox.org/virtualbox/debian trusty contrib"

Before update apt source list, you have to add Oracle public key. Download the Oracle public key for apt-secure (oracle_vbox.asc) from the same page. It should be like this.

Then run the command:
sudo apt-key add oracle_vbox.asc

Update apt-get and install VirtualBox 4.3:
$ sudo apt-get update
$ sudo apt-get install virtualbox-4.3


Saturday, July 26, 2014

'Android SDK Content Loader' has encountered a problem - parseSdkContent failed

After install fresh Ubuntu 14.04.1 and Eclipse ADT with Android SDK, 'Android SDK Content Loader' has encountered a problem of parseSdkContent failed, Could not initialize class android.graphics.Typeface.


To fix it, delete Android L (API 20, L preview) in Android SDK Manager and restart Eclipse. It work in my case. Even re-install Android L (API 20, L preview).

Friday, July 25, 2014

Android SDK-Eclipse crash when Content Assist provide suggestion

Recently, install Android SDK on updated Ubuntu 14.04. But it always crash when Content Assist try to provide suggestion. And report error like this:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x6115b86d, pid=4231, tid=3076355840
#
# JRE version: Java(TM) SE Runtime Environment (8.0_11-b12) (build 1.8.0_11-b12)
# Java VM: Java HotSpot(TM) Client VM (25.11-b03 mixed mode linux-x86 )
# Problematic frame:
# C  [libsoup-2.4.so.1+0x5486d]  soup_session_feature_detach+0x1d
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /home/u/Android/eclipse/hs_err_pid4231.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.sun.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#


This solution work for me:
  • Edit the file <Android SDK-Eclipse folder>/eclipse/eclipse.ini.
  • Insert the line:
    -Dorg.eclipse.swt.browser.DefaultType=mozilla


Monday, July 21, 2014

Install Oracle JDK 8 on Ubuntu 14.04

This post describe how to download and install Oracle JDK 8 on Ubuntu 14.04, and also update alternatives to correct the links.

Download Oracle JDK from http://www.oracle.com/technetwork/java/javase/downloads/index.html.

Accept License Agreement and download the corresponding .tar.gz file, jdk-8u11-linux-i586.tar.gz in my case.

Unpack the downloaded tarball (.tar.gz) and move unpacked folder to where you want, /home/u/jdk1.8.0_11/ in my case.

Run the following commands in terminal to update the alternatives of javac and java. Where /home/u/jdk1.8.0_11/ is the installed folder of jdk.

$ sudo update-alternatives --install /usr/bin/javac javac /home/u/jdk1.8.0_11/bin/javac 1
$ sudo update-alternatives --install /usr/bin/java java /home/u/jdk1.8.0_11/bin/java 1

$ sudo update-alternatives --config javac
$ sudo update-alternatives --config java

After installed and setup

Step-by-step:

Sunday, July 20, 2014

Install Cinnamon on Ubuntu 14.04

Against Unity, Cinnamon can seem fairly performance orientated.



To install Cinnamon on Ubuntu 14.04, enter the commands in Terminal:

$ sudo add-apt-repository ppa:lestcape/cinnamon
$ sudo apt-get update
$ sudo apt-get install cinnamon




reference: OMG!Ubuntu! - How to Install Cinnamon from a PPA on Ubuntu 14.04


Note for using RecordMyDesktop on Cinnamon:

By default, the bottom bar will disappear when running RecordMyDesktop to record your screen activity. To fix it, run with Extra Options of --no-frame.

- Click Advanced button.


- Select Misc tab.
- Enter "--no-frame" in Extra Options box.


Edit /etc/default/grub to set GRUB_CMDLINE_LINUX="acpi=off"/"pci=noacpi" options

As mentioned, Ubuntu 14.04 is installed on my old/legacy PC, with option "acpi=off". In my legacy Fujitsu M2010 Netbook, it display in 800x600 only. Alternatively, it can be set "pci=noacpi" to recognize the true resolution of 1024x600, but cannot set brightness and always in dark.

The default generated /etc/default/grub file is:
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX="acpi=off"

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"


To set option "pci=noacpi", modify to GRUB_CMDLINE_LINUX="pci=noacpi" in /etc/default/grub. Like this:
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
#GRUB_CMDLINE_LINUX="acpi=off"
GRUB_CMDLINE_LINUX="pci=noacpi"

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

After the file /etc/default/grub edited, run the following command to update /boot/grub/grub.cfg
$ sudo update-grub

And restart to make the new setting take effect.