Wireless adb debugging

Wireless adb debugging

images (2)
In my attempts to make terminal clients of whatsapp and paytm, I was consistently asked that if we had to connect it via USB, there is not much fun. So I made this entire experience wireless. This article will explain how to do wireless adb debugging over a network.

What do you need?

  1. Connectbot app: To power wireless connection over ssh.

  2. Adb setup: Use this google guide to set this up.

  3. Same Wifi network for phone and laptop.

 

Lets do it.

  1. Note down ip address of your system. (use ifconfig on linux).

  2. Open Connectbot, Enter your username@hostname for ssh field.

Screenshot_2014-09-28-16-31-43

You should be able to connect to your system terminal after basic authentication clearance.

  1. Long press your newly made connection and select Edit host. Inside Post login automation, add this

adb connect localhost:5555

Screenshot_2014-09-28-16-41-40

ensure to enter an extra [ENTER] after this command and press ok.

  1. Again go back to your connection, long press it and select Edit port forward this time. (Yes, We are going to use port forwarding to make it wireless)

Use settings button to add new port forward and enter this

Nickname: ADB

Type: Remote

Source Port: 5555

Destination: localhost:5555

Screenshot_2014-09-28-16-42-02

save the settings and mobile part is done.

  1. Connect your android to system and enter below command to allow tcpip on 5555 port for adb.

adb tcpip 5555

And you are done. Go wireless now and type adb devices on your system. you should see something like this.

Screen Shot 2014-09-28 at 4.39.54 PM

 

Now go out and try Wireless terminal Whatsapp and Seemless mobile recharge via Paytm.

Paytm AndroidTerminal – Seamless recharge via linux

Paytm AndroidTerminal – Seamless recharge via linux

download (4)

In continuation to my previous attempt to control Whatsapp via command line (If you haven’t read that, Please do before continuing), This guide will allow you to recharge your mobile number via command line using Paytm.

 

Prerequisites:

With all prerequisites as in previous guide still valid (including Android phone attached via data cable to Linux machine), couple of additional ones are

  1. Paytm app – Download here.

  2. A logged in user with paytm wallet balance – Yeah, this guide is not a free recharge guide and will be using Paytm cash from user’s account.

Terminal Commands

1. To unlock your phone

adb shell input keyevent 82

If your phone is locked, this command will unlock it for you. For those who are using screen-locks, it can also be automated but it is again beyond scope of this tutorial.

2. Open Paytm app

As we did for whatsapp, we can open paytm app via stop-start machanism to ensure it to work even though it was open already.

adb shell am force-stop net.one97.paytm
adb shell am start -n net.one97.paytm/.AJRHomePage

3. Ask Recharge number

After reading the recharge number, Tap on recharge number coordinates (270, 650) found by hit and trial.

echo -n "Enter Number:"
read number
adb shell input tap 270 650
adb shell input text $number

4. Ask user for amount he wants to recharge with.

Similar to Number, Tap on coordinates for amount and fed the desired amount in it.

adb shell input tap 270 1050
echo -n "Enter Amount:"
read amount
adb shell input text $amount

5. Get the recharge done

Now to proceed further, you need to tap on back button once to remove keypad screen and then press on Proceed buttons and subsequently tapping on pay with path cash button.
adb shell input tap 270 1850
adb shell input tap 270 1350
adb shell input tap 270 1450
adb shell input tap 990 1650
adb shell input tap 990 1650
adb shell input tap 990 850

6. Close the Paytm app.

Echo a thanks message before closing the app.

echo "Thank you for recharging with Paytm AndroidTerminal \m/"
adb shell am force-stop net.one97.paytm

 

PS: If your android phone is connected to internet via a slow connection, you might need to add appropriate sleep command to make it work.

This entire experience can be automated by saving below commands in a file

adb shell input keyevent 82
adb shell am force-stop net.one97.paytm
adb shell am start -n net.one97.paytm/.AJRHomePage
echo -n "Enter Number:"
read number
adb shell input tap 270 650
adb shell input text $number
adb shell input tap 270 1050
sleep 2
echo -n "Enter Amount:"
read amount
adb shell input text $amount
adb shell input tap 270 1850
adb shell input tap 270 1350
adb shell input tap 270 1450
sleep 2
adb shell input tap 990 1650
sleep 2
adb shell input tap 990 1650
sleep 2
adb shell input tap 990 850
echo "thank you for recharging with command line paytm \m/"
adb shell am force-stop net.one97.paytm

Save it in a file named paytm and make it executable with global access. Now next time you need to recharge, Paytm CommandLine will be at your service.

Android Cheat sheet

Android Cheat sheet

Android Tools

World’s most popular mobile OS* offers some cool cheat codes/hacks for manufacturers to quickly identify and possibly fix small issues on the fly. Good thing is, you can also use the same using below android cheat sheet.

Disclaimer: Usage of mentioned hacks in this post is subjected to experienced users only and not for Beginners. DO NOT use any code if you are not sure about what you are doing. These codes may temporarily/permanently damage your phone if not used correctly. ZillionThoughts will not be responsible for any misuse of mentioned information

 

Code Feature Prompt/Sub Menu Risk
*#*#7780#*#* Factory reset Yes/No
*2767*3855# Factory reset No/No *High*
*#*#34971539#*#* Update/View Yes/Yes *High*
*#*#7594#*#* To permanently skip SubMenu on long press power button. (SubMenu including Vibration Mode, Airplane Mode, Power off will be skipped to default power off feature) No/No
*#*#273283*255*663282*#*#* To quickly manage all Images/Videos/Songs to one location. It includes well explained submenu which lets you choose desired  destination and other options. Yes/Yes
*#*#197328640#*#* Service Mode Yes/Yes
*#*#526#*#* Android WiFi firmware re-installation. For further info: Read http://zillionthoughts.com/android-wifi-error-quickfix/ No/Yes
*#*#232338#*#* Show MAC Address No/Yes
*#*#1472365#*#* *#*#1575#*#* GPS Test No/Yes
*#*#232331#*#* Bluetooth Test No/Yes
*#*#232337#*# Bluetooth unique identifier No/Yes
*#*#0588#*#* Proximity sensor test No/Yes
*#*#2664#*#* Touch Screen test No/Yes

Feel free to share your more of such cheats in comments.

*Source http://en.wikipedia.org/wiki/File:World_Wide_Smartphone_Sales.png

Image: http://dailytipsndtricks.blogspot.com/2012/12/how-to-fix-your-android-phone.html

Android WiFi Error [QuickFix]

Android WiFi Error [QuickFix]

android-wifi

If you are unable to switch ON your android’s wifi as it shows error and tired of restarting it, Following quick fix will make your life easier.

Disclaimer: Usage of mentioned hacks in this post is subjected to experienced users only and not for Beginners. DO NOT use any code if you are not sure about what you are doing. These codes may temporarily/permanently damage your phone if not used correctly. ZillionThoughts will not be responsible for any misuse of mentioned information

Issue:

When trying to switch ON android’s WiFi, it shows error and works only when phone is restarted.

Quick Fix:

Open keypad on your android phone and dial following number

*#*#526#*#*

How it worked:

As soon as you enter last asterisk, it will enter “WLAN Test Engineering Mode” and then Reload the required drivers. After 1-2 seconds, it should show Driver loading successful. If it is able to load the drivers successfully, your WiFi will be working perfectly now. How it works? It re-installs firmware of WiFi and has no side effects on any other feature. What other number codes/hacks/fixes are present in androids? Read http://zillionthoughts.com/android-cheat-sheet/

 

Image: http://mobileproblems24.blogspot.in/2013/01/how-to-use-android-phone-as-modem-in-pc.html#.UZT4o6JxSSo

How to improve battery performance of Android device?

How to improve battery performance of Android device?

battery

Android, even after covering more then 60% market share of smart phones, faces this very question on consistent basis about how to improve battery performance of Android devices? Following simple guidelines can boost your battery backup by at least 1.5x.

1. Screen brightness

In general, Display consumes 3/4 of total battery consumption of any android device. This can simply be reduced by setting brightness level low. A full brightness white pixel uses 5.8 times more battery juice than a black pixel.  It can easily be controlled via Settings » Sound & Display » Brightness. Keep it to minimum required to achieve most out of the backup.[pullquote]Smartphones are fun for about half an hour. Then the battery dies. – Alex Smith[/pullquote]

2. Keep minimum widgets

Widgets holds significant contribution in battery consumption. Battery consumption of a Live feed widget, which needs to update data from remote server like Facebook, weather service, will be many folds.

3. Live wallpapers

Live wallpapers runs in background and use complex system resources which in turn uses valuable battery power. One can save as much as 18% of battery just by switching to an extra dark, static wallpaper instead of a live wallpaper.

4. Background applications

Applications which keep running in background consumes high amount of power. Chat applications, Social networking apps contributes major portion in this. However, such apps can be manually stopped by Settings » Applications » Running Services » Select application » Stop the application.

5. Screen timeout

Keeping screen time out to minimum possible also enhances the backup. Just go to (Settings » Sound & display » Screen timeout) to choose.

6. Turn off GPS, Wi-Fi, Bluetooth when not required.

These services consumes heavy amount of battery even if running in background and not in use.

7. Manually killing tasks using clear RAM

Although android is designed to kill background apps automatically, It can also be done manually by Task Manager » RAM » Clear memory. Several Task killer apps are also available in android market which automatically takes care of background apps but choosing the right application for the purpose is critical as a wrong application will keep running in background and will have adverse effect on your battery eradicating the whole purpose.

 

Reference: http://stevemould.com/phone-battery-save-black-wallpaper/