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

Sunday, 13 April 2014

Useful Android Network Console Commands

When dealing with network connectivity issues on computers the quickest and usually most productive troubleshooting tools involve opening a console and typing a few key but vital commands.

In the same way for Android I have found myself asking why not follow the same tried & tested method. I have found that the same commands exist and are outlined below. With these commands you will soon locate networking issues.

Note : Your device does not required to have root (super user) access as these as standard. You will require a console or network emulator to be installed which can be found free on Google Play.

Netcfg

  • This is really useful to find out what intefaces you have and the current IP's
  • I also find this a quick way to get the MAC address instead of having to navigate through the various Settings screens
  • The following screen shows an example (I have obfuscated my MAC addresses)


Ifconfig

  • This is similar to what you would use on any Linux machine (or ipconfig on Windows)
  • The main thing of note is 'ifconfig' on its own or 'ifconfig -a' will not work you need also to specify an interface 
  • A common example would be for the WiFi interface e.g. 
$ ifconfig wlan0

What are the DNS servers defined as?

  • If internet access is not working correctly you may have DNS issues
  • To check the DNS servers use 
$ getprop net.dns1
$ getprop net.dns2

Routing Table

  • Its important for networking issues to be able to view the routing table

$ show ip route


  •  The following screen shows examples of running the last three commands


Ping

  • The simplest yet very powerful tool is available
  • First ping the local gatway e.g. 192.168.0.1 then try an IP on the Internet  e.g. 8.8.8.8 (Google's Public DNS)



Buying an Android tablet for a non tech savvy relative

When buying a new tablet for ourselves its easy to know what must have features we want. Having to decide for a relative who is not technically savvy can be daunting. This guide gives a proven method to ensure the correct tablet is purchased. Top tip is making a survey for your relative (sample given at the end)!



Screen Size

  • The main options are either 7, 8 or 10 inch screens
  • Considerations
    • How do they feel about their current mobile phone size?
    • Is a larger screen size a preference?
    • Would they use it on a table or prefer to be hand held?
    • Does it have to fit into a particular bag size e.g. hand bag?

Weight


  • The larger screens inevitably lead to more weight
  • Considerations
    • Will the tablet be carried a lot e.g. for commuting?
    • If the tablet is to be used for reading is the preference to be able to hold the tablet like a book?

Cameras


  • Not all tablets have front and rear cameras
  • Considerations
    • Will the tablet be used for video calls (front camera required)?
    • Is there a need for taking good quality photos or apps that require back camera e.g. scanning bar codes for shopping apps?

E-Reader


  • One of the main functions of a tablet can be using it as an e-reader e.g. with Kindle or Kobo
  • Considerations
    • How often will the tablet be used as an e-reader?
    • Would the user prefer a large easy to ready screen, or a lighter, smaller tablet?

TV Connectivity


  • Connecting the tablet to TV can be great for sharing or playing content. Using an HDMI connection is easiest but there are adaptors available for tablets without HDMI connection e.g. USB and 30 pin to HDMI are available
  • Considerations
    • Does your current TV have any HDMI connections?
    • Are there sufficient available HDMI connections on the TV or will an HDMI splitter be needed?
    • Is there a location the tablet can be placed (e.g. a shelf) to connect to the TV?

Video Calls


  • One of the most common reason for buying a relative a tablet is for video calling using Skype or Google Hangouts so a forward facing camera would be required
  • Considerations
    • Is the quality of the video playback and sound good enough for video calls?
    • Does a particular application require to be supported e.g. Skype. Worth checking on reviews to see if other tablet owners have successfully used these apps.

3G or WiFi only


  • Wifi only is significantly cheaper. 
  • Considerations
    • Do they need 3G? 3G models also tend to weigh slightly more than their wifi only counterparts

GPS


  • If the tablet is to be used for maps outside the home GPS may be useful.
  • Considerations
    • Some GPS on tablets have "Assisted GPS" which relies on a data connection

Clumsy or Careful Owner


  • How rugged does this tablet need to be? 
  • Considerations
    • Will it be bumped, dropped or roll around in a bag? 
    • Models with Gorilla glass are tougher and less likely to be scratched but if you suspect rough treatment a good padded case and screen protectors are a must. 
    • Cheaper models may not have so good build quality. 
    • If possible feel them in store for flex and check out some reviews.

App Usage


  • What type of app's will your relative be interested in e.g. news, games, YouTube, music.
  • Considerations
    • Does the OS version matter. Are they familiar with a version of Android already? 
    • App compatibility with certain versions of Android.
    • Certain types of apps may display better on a larger screen and some apps were developed for mobile so look odd on a big screen.

Accessories


  • Accessories are important to most tablet owners
  • The person receiving the tablet might like to immediately accessory their latest tech gadgets with cases, screen protectors or speakers.
  • Considerations
    • While you might like to buy the latest model with great features for your own use bear in mind it might not be possible to buy accessories right away for new release models. 
    • The person receiving the tablet might like to immediately accessory their latest tech gadgets with cases, screen protectors or speakers.
    • Does the tablet have USB connections or bluetooth?
    • Do they want to use USB accessories or bluetooth keyboards and headphones? 

Getting the correct answers...the easy way!

  •  As there are so may things to consider speaking with a relative it can overwhelm them 
  • I would recommend taking 15 minutes to create a customized survey for your relative using something like SurveyMonkey which has a free service
  • With the survey approach the relative can think about what they really want on their own time & give you all the answers!

Sample Survey


1. Do you want to read e books?

Yes
No

Not sure

2. What size screen would you prefer?

7 inch
8 inch
10 inch
Other (please specify)


3. Do you want to use the tablet to take photos?

Yes
No
Not sure


4. Do you want to connect to tv via HDMI?

Yes
No
What is HDMI?


5. Do you want to make VoIP calls on tablet i.e. Skype or Google hangouts

Yes
No
Not sure


6. Will you want to use tablet for sudoku and crossword apps?  

Yes
No
Maybe


7. Is device likely to be used outside home?

Yes
No
Maybe 

Root access for Samsung Galaxy I9000 on Linux

This post explains how to root your Samsung Galaxy I9000 on Linux. I used Linux Mint 14 but the same process would work for Ubuntu.

One of the first hurdles you will fine when trying to root your Android Samsung Galaxy I9000 is that most post's recommed running 'Odin' which is a Windows only application.

For Odin I tried :

1. Using PlayOnLinux and this does not work with the Odin exe file

2. Using a Windows VM running on VirtualBox, running the Odin exe. I did have the VirtualBox extension pack installed and I could see the Samsung Galaxy I9000 within the VM when the phone was connected via USB when it was powered on. But when it was in 'Download' mode Odin could not detect the Phone in the VM.

The Solution I found was using the Linux posrt of Odin called Heimdall andthe process is :

1. From Heimdall GitHub site download the "Heimdall 1.3.1 command line tool - Debian 32 or 64-bit binary .deb file and install

# wget https://github.com/downloads/Benjamin-Dobell/Heimdall/heimdall_1.3.1_amd64.deb
# sudo dpkg -i heimdall_1.3.1_amd64.deb


2. Download the CF-ROOT kernel zip file

3. Unzip the file, then un tar the file so you are left with a zImage file i.e. you need to extract the archive twice

4. Enable USB Debugging on the phone via Settings, -> Applications -> Development -> USB Debugging option -> Select to enable

5. Power off your phone

6. Power on phone in Download mode (press Volume Down + Home Key +Power together. It will show a show a yellow icon saying "Downloading. Do not turn off Target!!!"

7. Connect USB cable from phone to laptop

8. Run command line tool to show its connected :

$ heimdall detect
Device detected


9. Flash image

$ sudo heimdall flash --kernel zImage
[sudo] password for clunky:
Heimdall v1.3.1, Copyright (c) 2010-2011, Benjamin Dobell, Glass Echidna
http://www.glassechidna.com.au

This software is provided free of charge. Copying and redistribution is
encouraged.

If you appreciate this software and you would like to support future
development please consider donating:
http://www.glassechidna.com.au/donate/

Initialising connection...
Detecting device...
Claiming interface...
Attempt failed. Detaching driver...
Claiming interface again...
Setting up interface...

Checking if protocol is initialised...
Protocol is not initialised.
Initialising protocol...
Handshaking with Loke...

Beginning session...
Session begun with device of type: 0

Downloading device's PIT file...
PIT file download sucessful

Uploading KERNEL
100%
KERNEL upload successful
Ending session...
Rebooting device...
Re-attaching kernel driver...


10. Reboot, phone and download a "Root checker" app from Google Play to check everything is correct.

11. You can also review the CWM and SuperUser new applications

Nexus 4 screenshot capture

Its useful to be able to quickly capture a screenshot on your Nexus 4 for many reasons. This post shows how you can quickly capture the phone screenshot.

  • Press both Power + Down Volume buttons at the same time


  • The screenshot will appear in the notifications window



  • You will have access to the screenshot under 'Gallery -> Screenshot'

Nexus 4 USB Connection Setup on Linux

Setting up USB transfer mode on my Nexus 4 was not as straightforward as I thought it would be. This post details how you can connect your Nexus 4 quickly to Linux Mint or Ubuntu. The solution involves using Go-mtpfs a simple FUSE filesystem for mounting Android devices as a MTP device.
  • Connect your Nexus 4 to your Linux box 
  • Under the 'Notification's window on the Nexus 4 it will show the USB options which you can select

 
  •  Ensure 'Media device (MTP)' is selected

  • Disconnect the Nexus 4 USB from the Linux box
  • From the terminal
$ sudo add-apt-repository ppa:webupd8team/unstable
$ sudo apt-get update
$ sudo apt-get install -y go-mtpfs
  • This will create a '/media/MyAndroid' directory
  • Connect your Nexus 4 vis USB
  • Create a simple mount bash script 'Nexus4MountUSB.sh'

  •  Create a simple dismount bash script 'Nexus4DisMountUSB.sh'
 

Some Useful Things

  • You can add the script under the a bin directory in your home folder i.e. mkdir ~/bin/
  • Add your bin directory (insert your username for <username>) to your PATH within ~/.bashrc Syntax

export PATH=/home/<username>/bin:$PATH

Example

export PATH=/home/cwishaw/bin:$PATH

  • Give the files executable privileges 
$ chmod +x Nexus4MountUSB.sh
$ chmod +x Nexus4DisMountUSB.sh
  • Using a fast access top down terminal like Guake is great to quickly start scripts with F12
  • FUSE (Filesystem in Userspace) allows non privilaged users to export a virtual filesystem to the Linux kernel
  • MTP (Media Transfer Protocol) is used from Ice Cream Sandwich to access the devices storage via USB
  • It allows access to the phone from the PC and the device simultaneously which the older USB Mass Storage did not  

Motorola Xoom Root on Linux



The following details how to Root your Motorola Xoom on Linux Mint or Ubuntu. First some useful definitions of ADB and Fastboot are given then the process is outlined. 

ADB

Android Debugging Bridge (ADB) is intended to be used by Android developers for debugging and testing applications. Its provided with the Android SDK (Software Development Kit). Its the communication method between the Android device and connected Linux system.

Fastboot

Fastboot is a command line tool allowing the ability to flash the Android device via USB. By default Android device have debug mode disabled to stop updates occurring in this manner. Its also provided with the Android SDK.

SDK Installation - ADB + Fastboot setup

  • From Android Development SDK download the Linux 64-bit or 32 bit version
  • Create a directory for the SDK in your home folder 
$ mkdir ~/AndroidSDK
  • Extract SDK to new folder
  • Navigate to following sub folder. Note <version> wil be the version you downloaded
$ cd adt-bundle-linux-<version>/sdk/platform-tools/
  • Check the ADB version
$ ./adb version
  • Check fastboot help
$ ./fastboot -h

Bootloader Unlock and Root Access

  • On the Xoom under "Settings -> Developer options" enable USB Debugging mode
  • Download file from Universal Xoom xda page. Note - the main link is no longer valid but post #411 on _that page has the file
  • Connect the Xoom to Linux computer via USB
  • Test Connectivity
$ sudo ./adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
0299918743aad023    device

  • Reboot Xoom
 $ sudo ./adb reboot bootloader
  • On Xoom boot screen with "Starting Fastboot protocol support" screen
$ sudo ./fastboot oem unlock
  • At text screen, press Volume Down (accept) then Volume Up (confirm)
  • Repeat process to confirm i.e. press Volume Down (accept) then Volume Up (confirm)
  • "Device unlock operation in progress" appears and it will reboot
     Xoom
  • Bootloader is now unlocked
  • Type the following commands
$ sudo ./adb reboot bootloader
$ sudo ./fastboot flash recovery recovery-Tiamat-R4c-100611-1150-cwm.img

  • When flash is complete, reboot Xoom with Volume Up + Power
  • On boot when the Motorolo logo appears, press Volume Down
  • "Android Recovery" appears in the top left corner
  • Press Volume Up to enter recovery mode
  • This mode is called "ClockworkMod recovery". Select to load the "install zip from sdcard" -> "Choose zip from sdcard", then select the downloaded zip file
  • Note : Use Volume Up/Down to navigate + Power to select
  • Reboot and Root access
     will be present :)

Remove Google Search Widget from Jelly Bean


With my recent move for search only using DuckDuckGo I wanted to remove the Google Search Widget from my Nexus 4. This was not as straight forward as I thought. Trying to remove in the same way as other widgets does not work! The following is my process on a non root Nexus 4 from Google Play.

Process to remove Google Search Widget from Jelly Bean


  • Open 'Settings' then 'Apps'
  • Select 'All'
  • Scroll down to the 'Google' installed Apps and open 'Google Search'
  • Select 'Disable'
  • Select 'Yes' I to remove to 'factory defaults'
  • The Google Search App is removed
  • Important : At this point the grey search screen is present but it does not say 'Google'. You must reboot the phone.
  • After the phone reboot the grey widget is gone :)

Some Considerations

  • You cannot add other widgets in the space that was used by Google Search
  • It _may affect voice input with other apps (I don't use voice input)
  • You cannot access Google Now (I don't use this as I cycle to work so the commute is not relevant)
  • You can install it again from Google Play if you would like it back at some point, which I tested then removed again 

Test drive Firefox OS in your browser!



You can install the mobile Firefox OS simulator to run in your browser which has been made available by Mozilla. The simulator installs as a ~60MB add on which takes a few minutes to install. Its pretty cool to spend some time going through it :)

Enable Simulator


  • Post install select Simulator to be Running
  • After a minute or so the simulator will appear in a separate window



  • Select right on the simulator and you will get some options




  • If you select 'Gallery' you can upload a picture from your desktop 
  • Then change wallpaper which is what I have done in the above screenshot

Marketplace 


  • Next its time to try the Marketplace
  • They have Facebook & Twitter but i tried Wikipedia








Maps


  • Default is Here maps developed by Nokia



  • Overall nice to get a quick taster of the look and feel of the HTML5 based OS!

How to easily share your screen for Skype on Android



Its really useful to be able to share your screen to another party for a presentation or troubleshooting. Skype makes this easy as they now have the ability to share your screen.

The process is very straight forward.

1. Connect to the other party as normal for a Skype call

2. Select the '+' button



3. Then select 'Share Screens'



4. Now you can see the other screen (but cannot take control).

5. When complete select 'Stop Sharng'


Have fun!