Thursday, September 27, 2012

Google added XXHDPI for android devices ?

Google, the creator of Android mobile platform, recently added one item at http://developer.android.com/reference/android/util/DisplayMetrics.html#DENSITY_XXHIGH,
which will support devices with terrible high resolutions ( I had to keep asking myself when I thought about it, do I really need this high resolution? may be I do, just for viewing high quality contents).

According to the Google document
"
public static final int DENSITY_XXHIGH Since: API Level 16

Standard quantized DPI for extra-extra-high-density screens. Applications should not generally worry about this density; relying on XHIGH graphics being scaled up to it should be sufficient for almost all cases.
Constant Value: 480 (0x000001e0)
"
It is read like "extra-extra-high-density". Looks like the engineers ran out of the word to describe it. I am wondering what the newer resolutions would be called in the future when hardware engineers would pack more pixels into per square inch on the display. Would it be called "extra-extra-extra-extra-...-extra-high-density", or call it " n-extra-high-density" ?

The name would be potentially very LONG, and when programmers try to communicate this info with project managers, the project managers would need to count how many "extra" the programmer has used, or may think the programmer is so nervous and get stumbled, or the brain get short-circuit to find the next word.

It is also weird that Google provided this info in the page of DisplayMatrices http://developer.android.com/reference/android/util/DisplayMetrics.html
and 

I can only see the values of ldpi, mdpi, hdpi, xhdpi, tvdpi, and "nodpi".

Is it a great idea to use word of "nodpi" for supporting all densities?

Come on, please find a proper word to replace the "extra-...-extra" naming style.

Please check my other post http://programmingtolive.blogspot.com/2012/12/handle-xxhdpi-in-your-apps.html for handling xxhdpi in your Android apps.


Oh, they added XXXHDPI?

Tuesday, September 25, 2012

Your android device is not recognized by adb ?

In a previous post I discussed about the problem for Google Nexus 7. In general, every device may have this problem. When you first purchase the device and plug it onto your computer and  the run the command "adb devices", your devices may not be listed there.

Usually, when you plug in your device to your computer, your computer would detect that a new device is plugged in, and it would automatically install the drivers for the device, and it would be recognized. But for android device, it could be listed as MPT device or USB Composite Device.
If the default type of your device is MPT, then it would not appear in the adb device list.
To solve the issue, there are a lot of posting and discussion on the internet by installing the drivers, and there are also even suggestions to root the device in order to solve the problem.

I myself ran into this issue again after updating my devices. When I checked the Device Manager of my laptop, it is listed as MPT device under "Portable Devices". I fooled around on the device settings, trying to find where I can change the device type to either CPT device or USB Composite Device. However in the Storage Menu of my phone, there is not such option. I even tried to use the Device Manager to update the drivers, and that did not help.

Here is the tip from my teammate.

On your computer, please open the Device Manager, open the node of Portable Devices,
right click on on the item for your device, then choose "Update Driver Software".

In the dialog of "Update Driver Software", Please click on "Browse my computer for driver software".
In the new dialog, set driver software location to the "Extra" folder where your Android SDK is installed, and check "Include subfolders".

Then click on "Let me pick from a list of device drivers on my computer. In the new dialog window, choose "USB Composite Device", and click "Next" to start installing the drivers.

After the installation is done, please make sure you device has the Developer Options turned on,
and USB connection for debugging is checked.

Please check again in the DOS window "adb devices" to verify if the device is recognized.

If you have multiple devices, you would need to do this for each of them.

I am hoping that OEM would add the device type options in Settings,
so that when user has this kind of problem, he/she can set the device to "USB Composite Device", or "CPT" device, and when the device is plugged into computer, related drivers would be installed automatically by the computer, and he/she does not need to go through the steps above manually.