SMS Concatenation

Technically you can concatenate up to 255 SMS but it’s common to find that a message with more that 480 characters (3 SMS) is converted to an MMS; at least this happens on Samsung A3.

The conversion from SMS to MMS can be avoided by selecting Options > Sending options > Message type > Text when in the Text message window writing the message. The message is then always sent as SMS text message and no conversion to MMS occurs.

Via: https://en.wikipedia.org/wiki/Concatenated_SMS

Problem: Android 5.1 Phone Book not Synced with Bluetooth in-car system

When i linked the new android 5.1 wife’s phone to the Bluetooth car infotainment, we saw that only some contacts was synced; we was able to see only SIM contacts and not the Gmail contacts as selected on “Contacts to display” setting on Contacts app.
We discovered that selecting as contacts filter the option “Customize” the contacts are correctly synchronized.

Contacts_51

How to automate Android settings

Inside a project of rollout of new mobile phone we had the need to automate some settings configuration to make android devices rollout quickly.

We used ADB and Monkeyrunner tools for accomplish this task. These tools are inside Android SDK: http://developer.android.com/sdk/index.html

Install Android SDK and from SDK Manager select both “Android SDK Tools” and “Android SDK Platform-tools”

Android SDK Manager

ADB can found on ..\Android\android-sdk\platform-tools

Before using ADB remember to enable Developer Menu and the USB Debug option: https://241931348f64b1d1.wordpress.com/2015/10/30/how-to-enabledisable-developer-menu-on-android/

With ADB you can perform various tasks against your Android device.
For example this script wait for a device and then install an app (MDM.apk) and remove some other unnecessary apps:

cd C:\Users\sysadmin\AppData\Local\Android\android-sdk\platform-tools
adb wait-for-device
adb install C:\Data\MDM.apk
adb shell pm uninstall com.vodafone.android.myweb.launcher
adb shell pm uninstall uk.amazon.mShop.android
adb shell pm uninstall com.ebay.mobile

To browse all the apps installed you can use this command:

adb shell pm list packages

More commands can be found here: Http://developer.androud.com/tools/help/shell.html

Then I used monkeyrunner for automate some configuration. Monkeyrunner can be found in this folder: ..\Android\android-sdk\tools
Then I downloaded two scripts to make using monkeyrunner easier: https://github.com/miracle2k/android-platform_sdk/tree/master/monkeyrunner/scripts
Copy monkeyrunner_recorder.py and monkeyrunner_playback.py into ..\Android\android-sdk\tools folder.

If you already connected your Android device via USB with USB_DEBUG enabled the run this command for record some actions:

monkeyrunner monkeyrunner_recorder.py

Using the mouse perform the actions on MonkeyRunner Recorder screen then save the script clicking on the menu “Export Actions”. Save the file with file extension “.mr”. For example C:\Data\test.mr

To perform the same action you recorded again type this command:

monkeyrunner monkeyrunner_playback.py C:\Data\test.mr

Remember to insert some sleep after each action you recorded because probably your device is not so quickly as commands are sent by script.

PRESS|{'name':'HOME','type':'downAndUp',}
WAIT|{'seconds':1.0,}
TOUCH|{'x':479,'y':822,'type':'downAndUp',}
WAIT|{'seconds':1.0,}
TOUCH|{'x':60,'y':822,'type':'downAndUp',}
WAIT|{'seconds':8.0,}
TOUCH|{'x':120,'y':800,'type':'downAndUp',}
WAIT|{'seconds':1.0,}
TOUCH|{'x':120,'y':700,'type':'downAndUp',}
WAIT|{'seconds':1.0,}
TYPE|{'message':'mdm-kion.telekom.ebf.de',}
WAIT|{'seconds':1.0,}
TOUCH|{'x':479,'y':600,'type':'downAndUp',}

Here a list of actions that you can type directly on your monkeyrunner script:

  • To press “HOME” Button:
     PRESS|{'name':'HOME','type':'downAndUp',} 
  • To type something:
     TYPE|{'message':'mdm-kion.telekom.ebf.de',} 
  • To Scroll Down:
     DRAG|{'start':(50,500),'end':(316,500),'duration':1.0,'steps':10,} 
  • To Scroll Left:
     DRAG|{'start':(216,768),'end':(216,153),'duration':1.0,'steps':10,} 
  • To wait 1 second:
     WAIT|{'seconds':1.0,} 

Following some ADB notes:

  • connect adb over Wi-Fi
     adb shell setprop service.adb.tcp.port 5555 && stop adbd && start adbd adb connect 
  • Unlock your Android screen
     adb shell input keyevent 82 
  • Lock your Android screen
     adb shell input keyevent 6 adb shell input keyevent 26 
  • Open default browser
     adb shell input keyevent 23 
  • Keep your android phone volume up(+)
     adb shell input keyevent 24 
  • Keep your android phone volume down(-)
     adb shell input keyevent 25 
  • Go to your Android Home screen
     adb shell input keyevent 3 
  • Take Screenshot from adb
     adb shell screenshot /sdcard/test.png 
  • start clock app
     adb shell am start com.google.android.deskclock 
  • stop clock app
     adb shell am force-stop com.google.android.deskclock 
  • start wifi settings manager
     adb shell am start -a android.intent.action.MAIN -n com.android.settings/.wifi.WifiSettings 

Via: https://software.intel.com/en-us/android/articles/automated-android-application-testing
http://testautomationdiary.blogspot.de/2014/05/testing-android-devices-using.html

How to enable/disable developer menu on Android

To turn on developer options in Android phone:
  1. Go to “Settings”
  2. Click on “About Phone”
  3. Find the heading called “Build number”
  4. Tap on “Build number” several times (seven taps)
  5. Developer options is turned on. You will find it in the “Settings” (the previous menu)

If you want to turn off the “Developer options”, then there is a slider on top which you can click. The slider will move to off. This turns off developer options but it does not hide it from the settings menu.

To disable and hide “Developer option” from settings menu:

  1. Go to “Settings”
  2. Find “Apps” menu (You will be shown Downloaded, Running and All apps)
  3. Click to the “All” apps tab
  4. Scroll and find “Settings” app
  5. Click on button “Clear data”
  6. The “Developer options” item from the settings menu will be hidden