Friday, July 12, 2013

Flashing a ROM onto your Android phone

When I flashed a ROM on to my Android phones, I followed the steps below:
1. Yeah, the first step is to find the ROM that matches the phone
2. Connect the phone to computer via USB able.
3. Make sure in Developer options, USB debug is checked. And yeah, if you are running pure newer Android ROM, for example JB4.2, the developer option you saw in older version of Android ROM is not there. It is hidden somewhere. There is magic "word" to call it out. From Settings-> About phone -> Build number, knock on the "Build number" 7 times, then the "Developer options" will come out in the "Settings".
إفتح يا سمسم iftaḥ ya simsim .

4. If the phone can not be recognized by the computer, use the Device Manager on the computer to update the driver. I usually choose the USB Composite Device in the compatible list.
5. Run adb reboot bootloader
6. Run fastboot oem rebootRUU if using the zip file to flash
7. Run fastboot flash zip zip-file-for-ROM
8. Run fastboot reboot
9. If using RUU to flash, start from Step 5, run the RUU exe directly and follow the instructions.
10. Sometimes, I need to flash the device with older ROM first, then flash the device again with newer ROM.

I forgot to mention that the phone may need to be S-OFF, and the CID may needs to match the ROM's build in CID, or may need to set the cid to super cid, a special ID for every ROM. To change the CID, in the bootloader mode, run fastboot oem writecid cid_char_string.

If you can find a RUU, it would be easy to run it to flash the phone.

Thursday, July 11, 2013

Google Android Studio 0.2.x

Google released Android Studio 0.2.0 with build number of 130.737825.

It is a new bundle and users need to download the installer from Google Android website.
http://developer.android.com/sdk/installing/studio.html#Updating

In the installation guides, it suggests users to back up some folders in the 0.1.x installation if users want to install the new version in the folder of the older version previously installed on the computer.

One of the most important feature in this release is the parallel build of independent modules, but it is not turned on in default settings, users need to "go to Preferences > Compilerand check the box Compile independent modules in parallel."

And this release is not backward compatible with previous releases.

After downloading the recent update of 0.2.1, the start up time is terrible long. After clicking on the shortcut icon on the desktop, I waited for about 1 mins for the window with progress bar show up, and the progress bar move slowly too, it took another 20 seconds for the Quick Start windows show up. This made me feel I am using very old version of Netbeans which usually took 2 mins to start up, but now the latest Netbeans starts up very quick. The time taking to start up this version of Android Studio is in the range of Netbeans 7.3.1, but in Netbeans it also starts up a bunches of services, servers, and load up my projects.

If I set the Android Studio to load up my projects at start up, it would take more longer. Even the project has been built, the building system is still trying to rebuilt the project again, and do other stuffs like checking something.

It also takes longer to create a new project. The building system is very busy. And while the system is doing the indexing, the tip window is not responsive.

Update 130.762670, 0.2.3, this is a minor update with more user friendly improvement on error warning message.

Updated to 0.2.7, and learnt a way to delete project in QuickStart - just move the mouse to the project and hit the "Delete" button in your keyboard/keypad.


Sunday, May 19, 2013

Google Android Studio - Preview version v0.1 for Windows

Google announced the new Android app development tool called Android Studio.
According to the materials available online, it is based on IntelliJ IDEA. There is also a FAQ about IntelliJ IDEA and Android Studio.

The download link of the preview version of Android Studio is http://developer.android.com/sdk/installing/studio.html.
I have downloaded and tried it.

In the installation process,
the installer will try to find out the JDK that has been already installed on your computer.
If you do not have JDK, you will need to download it from Oracle's Java download site to download it then install it on your computer.

After the Android Studio installer finished the installing process, it would ask you to run it now or not.

The problem is  that you would get chance to note that nothing happens after you click OK to run the Android Studio now, or after you choose to close the installer and run the Android Studio later.

The possible cause is that the installer has not remembered the path for the JDK on your computer.
There is a file in the bin folder where your Android Studio has been installed, the file name is studio.bat in Windows machine.

In the studio.bat file, the code first looks up the path of the following parameters:
ANDROID_STUDIO_JDK, ..\jre, JDK_HOME, JAVA_HOME
If these parameters have not been set in the system environment variable,
the batch file will always print out the error message at the end of the batch file:

ECHO ERROR: cannot start Android Studio.
ECHO No JDK found. Please validate either ANDROID_STUDIO_JDK, JDK_HOME or JAVA_HOME points to valid JDK installation.

Even though the Android Studio installer has found there is JAVA installed on your computer,
the information of JAVA Path has not been added into the studio.bat file.
You need to either set it in this batch file, or set it correctly in your system environment.

When you start it up for the every first time,
you will see a smaller UI. Only after you create a new project or import an old project from Eclipse,
the UI of the IDE will be in larger size or full window.




The other issue I see is Android Studio can not pull in the Android SDKs that have already been downloaded and installed on my computer. The installer does not even check the Android SDKs that have been installed on the computer.



I am an Android developer and have been using Eclipse and even tried the NetBeans plugin.
Versions of Android SDK, Tools have been installed on my computer.
Up to now I have not found a way to let Android Studio use them. I need to use the Android SDK Manager in Android Studio to install all of the SDK again.

It is interesting to see that there is "sdk" folder where Android Studio is installed.
In the structure of this folder is similar to the Android SDK folder where I installed Android SDKs in the past, however only Android SDK API level 17 is installed by the Android Studio installer.
I tried to create a link of this "sdk" folder to my old Android SDK folder, but it does not work.
The Android Studio can not recognize it.

OK, now I finally found a way to point the IDE to the Android SDK folder I used for Eclipse IDE.
In the Quick Start, there are several clickable items in the right panel. One of them is "Configure".
Following the path Project Defaults -> Project Structure -> SDKs -> +  -> Android SDKs -> Select Home Directory for Android SDK, then I can choose the folder Android SDK folder I used for Eclipse.


If you have happened created a new project with Android Studio or have imported a project from Eclipse, you may find that every time you start up Android Studio, it would load the project(s), and you may wonder how to get to the Quick Start Window.


From the full IDE UI, File->Settings->IDE Settings->General->Startup/Shutdown, please uncheck the "Reopen last project on startup", then every time you run the Android Studio, you will see the Quick Start Window, where in the left panel a set of projects would be listed. The full IDE will be started up when you click on one project.

And after about half an hour poking around, I have not found a way to change Project properties similar to the click through in Eclipse, so I can not use any Android SDK add-ons in the way I used to in Eclipse.
Anyway, like the official page of Android Studio mentions, this tool is just for preview, and my past experiences with Eclipse could not be ported to this IDE.

After reading the Get started up guide on the web, I gave it a try again by exporting my Eclipse project to get the gradle build file, then from Android Studio, import the project into the IDE. After the project was imported, it would be displayed in the left panel of the Quick Start window. It would be loaded into the IDE after it is clicked. But at this stage, when I ran the build, there would be complaining about missing libraries of my addon SDK used in my Eclipse project.

Like I mentioned above, when I right clicked on the project to find the "Properties" of it, there is not such item in the menu. Instead related option is under "File" -> Project Structure.

In the dialogue window of "Project Structure", there are 2 major items: Project Settings, Platform Settings.
In the "Platform Settings", I can point the Android SDK to the folder where my Android SDK used by Eclipse exists: C:\android-sdk. It shows up as "Android 4.2.2 Platform", and in the right panel  I can now choose the build target from the drop down list of all of Android SDKs, add-ons. Now the imported project can be built against the add-on without any error.

It is very interesting to note that there are 2 links at http://developer.android.com/sdk/installing/studio.html#download for users to download the tool.

One is for Windows platform, the other link is "DOWNLOAD FOR OTHER PLATFORMS".
When you click on the 2nd link, a table would show up which lists the downloads for Windows, Mac OS and Linux. I am wondering what is the difference between the download for Windows platform in this table and that in the link above. Interesting...

And yeah,  in my first installation, when I clicked on the link "Check for update now", it said there was not network connection, it asked me to check network settings; after uninstalling and removed related data
 (project data, settings, ...), and installing it again, if I clicked the link to check update, it would say "


The other issue I noticed at the very first run is the slow starting up the IDE. Sometime it took about 10 seconds for the starup IU show up

This behavior is so different from other IDEs. For example, Eclipse and NetBeans shows the start up UI in 2 to 3 seconds when I clicked to run them. Latency of 10 seconds is some kind of long.

Today, on 05/28/2013, there is an update from build 130.677228 to 130.687321, quite the same time Google Android Team released the update to R22.0.1 of ADT plugin and  Android SDK Tools, it is within two weeks of the first preview release of the Android Studio. It took several minutes to download the patches and applied them.

The popup window for Check Update Information will keep popping out when user repeats run Help -> Check for Update.

To me, the Android Studio should first check if there is an popup window, if there is not, then show the popup; if there is one already visible, then close it, and show it again when the update info is available.

On June 6, release 130.700.763 is available, the patch has the size of 6 MB, the release note is at http://tools.android.com/recent/androidstudio013released. However, when I ran the checking update,
the popup windows told me there was update, if I clicked on "release note" or "what is new", it would direct to http://tools.android.com/recent/androidstudio013released. The link http://tools.android.com/recent/androidstudio013released was found by Help->What is New in Android Studio after the IDE applied the patch and restarted.

When you want to run the app on real device, please use the main menu "Run" -> "Edit Config"-> in the right panel, under "Target" device, please choose "USB device". Then next time you run the app, the app would be launched to the real device connected to your computer via USB cable. Or if you prefer, choose "Show Dialog", and it would show a popup window asking you to choose either device or emulator.

While if I deleted one project once has been run and built by Android Studio, if I deleted it from folder on my hard drive, it would still appear in the project list in the Quick Start Window. If I want to remove it from this list, I need to click on it, then a popup window would appear saying it does not exist anymore, do I need to remove it. If I click on to remove it, it would still be in the list, e.i., the list would be updated, I need to restart the Android Studio, then the project would not be in the list any longer.

On June 14,  new patch is released to users, the build number is bumped to 130.709792, revision 0.1.5. The size of the patch is about 1 MB. The release note is at http://tools.android.com/recent/studio015released.

On June 21, updated to 0.1.6 with build number 130.716844, the patch is 2 MB. The release note is at http://tools.android.com/recent.

New version 0.1.8 was found when the IDE was started up today (Jun 28), build number is 130.725679, the patch is 1MB. The release note is at http://tools.android.com/recent/androidstudio018released. It said there are several patches to 0.1.7 (Jun 25, 2013) which I did not get it but jumped from 0.1.6 to 0.1.8 directly. Two releases in 4 days !

Thursday, February 21, 2013

Get your app ready for the (HTC) One with XXHDPI

On Feb 19, 2013, HTC announced their new flagship phone, HTC ONE, http://www.htc.com/us/smartphones/htc-one/#overview.


This device has a 4.7 inch display with full HD 1080p, 468 PPI (pixel per inch). The resolution of the screen/display falls in the range of XXHDPI defined by Google Android standard.

The phone would be carried by most of carriers around the world. From the announcement, and the official specs posted http://www.htc.com/us/smartphones/htc-one/#specs, and comments from the analysts, reporters and mobile gadget enthusiasts, the phone would be leading the mobile device market for this year. Other OEMs need some time to find out how to match the specs of this device, specifically the features of Camera (UltraPixel), Zoe (Gallery), BOOM (sound), BlinkFeed (social media), Sense TV (IR control), the gorges design and manufacturing processes to produce the product.

BOOM Sound


BlinkFeed Social Media

Zoe - Living Photo Gallery

Currently HTC is offering the special promotions, customers can get at least $100 cash back or trade in value of customer's current phone. Please check details at http://www.htc.com/us/smartphones/htc-one/#offers.



TV Guide and IR Remote Control


Gorges Design


Sense Voice - Clearer Voice Than Ever

Please get your apps ready for the ONE. See my previous post about handling XXHDPI for your app, http://programmingtolive.blogspot.com/2012/12/handle-xxhdpi-in-your-apps.html

Enjoy the ONE, and see what you can bring to life with this smart phone.

Wednesday, February 20, 2013

My old Nexus 7 got 4.2.2 update

While reading the tech news, I crossed over several posts about the latest update of Android 4.2.2 from Google, then I checked my old Nexus 7. And yeah, there is a notification about the update, asking me to install it or not, and I clicked it yes. Now the tablet is installing the update. From my experiences in the past, it will take several minutes to complete it. This time it is around 1 to 2 minutes. Now the device is rebooting, I like the boot up animation.

In the software info, the kernel is still in 3.1.0-g05b777c, built on Nov., 29, 2012. For more details of the update, please check PCMag blog at http://www.pcmag.com/article2/0,2817,2415481,00.asp

Meanwhile, the SDK Tool 21.1 is also available for developer to download and install, for the release note please check http://developer.android.com/tools/sdk/tools-notes.html, some bugs reported have been fixed, there are also some performance improvements.

Now it is almost 3 months away from annual Google I/O Conference, where the next major release of Android would be announced and available. Not sure which version number would be used. Last year before Google formally released the Jelly Bean, people were talking about the version number would be bumped to 5.0, and actually it was released as version 4.1, followed by minor releases of 4.1.1, 4.1.2, then 4.2, 4.2.1, and now 4.2.2. But definitely the code name would start with letter "K".






Saturday, January 12, 2013

Nexus 7: Navigation

There are two preloaded apps on Nexus 7 that could be used for navigation. One is the Google Maps app, the other Navigation.

In my recent trip to the west coast, I wanted to check what cities the carrier was flying by. When I started up the Navigation app, I found the app took much longer to pin down current location, the app used about 3 mins, because the A320 was flying very fast. After the GPS signal got received and processed by the app, my location would show up on the map, and I could know which city the A320 was passing by.

However sometimes the map could not show at high resolution, and at other times the Navigation app just exited by itself when I rotated Nexus 7 from portrait mode to landscape mode. The reason may be due to the tablet was not connected to any network. However I could not replicate this case   on the ground when the WiFi connection was turned off.

Without network connection, the Maps app could not work at all. I could not zoom into high resolution map, the other layers could not be loaded either.

Tuesday, December 25, 2012

Android SDK tool update 21.0.1, platform tool 16.0.1, and SDK platform API 16 R4

Google provided updates to the Android development tools as Christmas gifts!

When I opened my Android SDK manager, I noticed there are 3 updates listed there.
One is Android SDK Tools 21.0.1, the other is Android SDK Platform Tools 16.0.1, and another is Android SDK platform API level 16 Revision 4.

If you are Eclipse and choose Windows -> Android SDK Manager, then select these 3 updates to install them, you may experience a little trouble, the error or warning would say some directory is currently being hold by some process. You would just need to exit the Eclipse IDE, then from the Android SDK Manager run the installation again.

After installing these updates, everything in the $android_sdk_folder/tools/ has been touched.

Right now I do not know what have been updated, and need to look at carefully to dig them out.

I wish I could find release note somewhere.
(
http://developer.android.com/tools/sdk/tools-notes.html
http://developer.android.com/tools/sdk/eclipse-adt.html
The release note for SDK Platform API Level 16 Revision 4 is not available yet at the link
http://developer.android.com/tools/revisions/platforms.html
)


Tuesday, December 18, 2012

Handle XXHDPI in your Android apps

After Google mentioned the xxhdpi in their online document and first batch of mobile devices supporting this resolution rolled out to the market, developers may need to know how to handle this  resolution in the apps.

HTC Butterfly (Japan)




HTC Butterfly (China)


HTC DNA (Verizon Wireless)



Since this screen resolution parameter is new, if your apps have not handled it, your apps may not be visible on devices when users use Google Play store to search apps.

To solve the issue of app not visible on devices with xxhdpi resolution, developers need to read the documentation provided by Google. Please check the best practice Google provides at http://developer.android.com/guide/practices/screens_support.html ,

It is said that the best practice is to use the <supports-screens > element in the manifest file of the application, and developers can set anyDensity is true. This will solve most of the cases. There are some cases that this solution would not work. 

As you may notice that there is another element, <compatible-screens>,  mentioned in Google's online document.  Some apps on the market are using this element/tag in the manifest files to resolve the screen resolution issue, and even use these 2 tags/elements in the same time. If you create a simple apk with various combinations of these two tags in the manifest file, it could be easily found that some of the definitions inside of the <compatible-screens> would override the definitions inside of the <supports-screens> tag.

It is mentioned that if you have to use <compatible-screens> in the manifest file to filter out your apps for devices with certain screen resolutions or sizes, you will need to add one more value inside of this tag:
        <screen android:screenSize="normal" android:screenDensity="480" />
for the xxhdpi. The other definition you may also add is tvdpi, its value is 213, which is for devices like Nexus 7.

After modifying the manifest file, you may also consider adding resources, such as drawables, layout styles, for the xxhdpi.

Friday, December 07, 2012

Build Android Kernel Source Code

In my previous post, I talked about downloading Android kernel source codes and listed links of download sites from major players in the markets of Android devices.

So what are you going to do with the kernel codes after you download it?

Some guys would like to take a look at the Linux codes to see the changes,
others is going to twist it, build it, and flash the devices with the images from the build.

OEM usually provides the Android kernel to end users in zip format,
it may be only one zip file, or several zip files. To open the zip file, the zip tool would be needed. There are several free zip tools user can download from the internet.

After unzipping the downloaded zip file,  you can start to check the source codes. If you could like to build it the kernel, other tools and environment would be needed. It is recommended Linux machine would be used to run the build, you can either get an individual Linux PC, install a dual boot of popular Linux  OS, or install a virtual machine of Linux on your PC. Some of the Linux Os' are free for personal use.

For myself, I am using a Windows laptop, have a Oracle Virtual Box installed on it. I use Ubuntu Linux as a virtual machine on Virtual Box. You may download Oracle Virtual Box from this web page  https://www.virtualbox.org, and the Ubuntu Linux from http://www.ubuntu.com/download .

When you set up and configure the Ubuntu virtual machine in Oracle VirtualBox, please pay attention to the RAM, Storage size and number of processor of the host machine ( for me it is my Windows laptop), please choose proper amount of storage, RAM and number of processors to use by the virtual machine. If you assign too much ram and all the processor of the host machine for the virtual machine, when you run the virtual machine and do heavy jobs, the host machine may not be responsive.

After setting up the Linux machine, please follow the steps at http://source.android.com/source/index.html to set up the environment. You will need the tool chain from AOSP to build the Android kernel code. The tool chain is in the code base of AOSP source codes, or you can get it from somewhere else you could find, please put the tool chain in your path.

Please unzip and put the Android kernel source code in your project directory, for example,
/home/dave/Project/kernels/. Before start building the kernel, you may want to take a look at the build instructions that comes together with the Android kernel source codes, such as a readme.txt file in the directory, or any instructions the OEM lists on their website.

I happened to look at the Android kernels recently published at http://htcdev.com/devcenter/downloads ,
In the download file, there is a readme.txt, which contains the commands recommended to be used to build the kernel, including the instructions to set the path of the tool chain.

After finishing building the kernel, you may try to push some modules you just built on to you device. Please note that you may need to run at root privilege to do this.


Please make sure to back up your personal data, device settings, ect.., anytime you flash your devices with customized build module or rom, and make copy of the modules on your devices you are going to replace with the new modules, and this process is only for person with strong mobile technique experiences.


For example, if I want to put bluetooth driver module onto my device (but most of the time, all driver modules would be needed to push over to device to make the device work properly),
I will run the following commands:

adb remount
adb shell push ./drivers/bluetooth/bluetooth-power.ko system/lib/modules/
adb shell chmod 644 system/lib/modules/*
adb reboot

In case your devices got stuck to start up, you may need to run recovery and reset the device to factory settings (!!!! you would lose data on your device !!!!), you may need to put back the original modules you have backed up, or in the worst case, you may run to boot loader  mode and select the recovery or reset options from the menu, or run the recovery and reset command from the adb shell.

Wednesday, December 05, 2012

Download Android kernels published by OEMs

Android is an open source project under GPL licences. OEMs under these licenses are obliged to publish the kernels they modified and used in their products.

The major players in the field of Android devices including the following OEMs including Google:
Google Inc (Android creator), Huawei (Android mobile devices), HTC (Android mobile devices), LG (Android mobile devices), Motorola (Android mobile devices), Samsung (Android mobile devices), Sony (Android mobile devices), ZTE in the alphabetic order.


Google's contributions to the kernel source codes are released in the Android Open Source Project at http://source.android.com/

The download sites of the kernel source codes from other OEMs

Huawei - http://www.huaweidevice.com/worldwide/downloadCenter.do?method=index&type=software

HTC - http://htcdev.com/devcenter/downloads

LG- http://www.lg.com/global/support/opensource/opensource.jsp

Motorola - http://sourceforge.net/motorola/

Samsung - http://opensource.samsung.com/index.jsp

Sony - http://developer.sonymobile.com/downloads/opensource/

ZTE - http://supporthk.zte.com.cn/support/news/NewsDetail.aspx?newsId=1002402 for example


Monday, December 03, 2012

Old Nexus 7 received 4.2.1 update

It was days ago my old Nexus 7 got update of 4.2.1, the latest version of Android Jelly Bean.
So now I am checking what is new in Jelly Bean 4.2.1.

First look at the home screen. From the top of the layout, the notifications are on the left the notification bar, and on the right side there is the status bar, user can pull the bar down and check the details.

As always, the voice enabled Google search is on top of the home screen, user can tap on the voice search icon to start voice search. Looks like it would take the speech engine to learn your accents, and after that, the returned results are more accurate.

The application tray at the bottom of the home screen do not change at all, but in the Android site, it says the application tray is a new feature. Am I getting it wrong?

OK, now I see the several more Wallpapers than I used to have with Jelly Bean 4.1, and I can also use the "Day Dream" to display content.

What I really like in this update are new features in developer options, specifically it enable OpenGL traces and simulation of 2nd display.

Thursday, October 18, 2012

Nexus 7 updated to Android 4.1.2

My Nexus 7 tablet received the update to Android 4.1.2, build number JZ054K, kernel build g009b6d1.
I did not notice any change in the application or the UI. Have you guys found anything new from this update?

OK, I saw the widget of "Recommended on Play" and "Recommended Apps" when I scrolled the home screen. Have they already been there in the previous version?

Hopefully it would be bumped to 4.2 soon after Google's 10/28/9 event.



IGZO based display and battery life

IGZO is named after indium gallium zinc oxide. It is a material with special properties and can be used in liquid crystal display (LCD) to replace the traditional layer of silicon. It is reported that energy consumption would be lowered to 1/5 to 1/10 of the traditional TFT, 
 it used only a quarter of the power of its competitor when idle, and about 25 percent less during active use. This technology also allows more pixels in per unit area of the display, which would make the images displayed on the screen more clearer and sharper, and more accurate touch response or quicker response speed.

At CEATEC 2012, Sharp introduced its new 5-inch 1080p LCD smartphone display at 443 ppi, they also showed a 6.1 inch IGZO based display with 498 ppi. Later Sharp introduced the first IGZO panel smartphone, Sharp's SH-02E, and it also launched a 7-inch Tablet with IGZO LCD Screen of 1280x800 resolution, 217 ppi. 
This week, HTC announced HTC J Butterfly, it has a 5 inch LCD3 1080 HD, 441 ppi display.

In the comments on the reports, people are worrying about the battery life of these new devices, because as more pixels packed into the display, more energy would be needed to light up the display. However if the report of the energy efficiency feature of this new technology is true, the battery would have a decent life span on these devices.



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.

Sunday, August 12, 2012

Nexus 7: Long press on screen to change wallpaper

Want to change the wallpaper of the Nexus 7 tablet? Yes you can.

The routine way is to go through Settings -> Display -> Wallpaper, then choose the wallpaper from Gallery, Live Wallpapers, Wallpapers.

There is other way to do it.

Instead of going through Settings,
you may try to long press on the left or the right edge of the display (when there are apps icons using the screen space), or press at any area of the screen (when there is not any app icons on the screen), or press the area not occupied by the app icons, then a popup view would be display with tile "Choose wallpaper from", listing three options, i.e., "Gallery", "Live Wallpapers", "Wallpapers", each of them are tied to their icons respectively.

Screenshot of the home screen with popup of wallpaper options after pressing the edge of the screen
(screenshot was taken by pressing the volume down button and the power button)

Friday, August 10, 2012

Nexus 7: use your mice

In the section of Connect to Devices of "Nexus 7 Guidebook", it is mentioned that Nexus 7 tablet can be connected to other devices by the USB cable and adapter.

I happened to have a USB wireless mice, and just tried to connect it with Nexus 7, and it worked well. I can use the mouse to click on the items on the screen, even at 3 meters away. The system handles the mouse event very well and smooth, including scrolling the home screen with the center wheel of the mouse.

Clicking on the 3 navigation buttons at the bottom of the screen also works well. On some of the android phones, clicking on the 3 navigation buttons with the mouse does not work, though it works well for other mouse events. Looks like the 3 navigation buttons on the phones I tested are not on the LCD display, that is the reason the mouse even can not reach to the 3 navigation buttons.

While I also tried the Android sample code of FingerPaint under the category of Graphics. I can use the mouse to do the painting, and other events. But looks like the app would not handle the finger touch and mouse event at the same time, this is truce for the finger touch and mouse motion events on the home screen.




Windows 8: want to use "traditional" desktop UI?

Windows 8 boots up with the tiled style UI, it was called "Metro", with each application displayed on the screen as a tile, you can put a lot of tiles on the screen as long as you feel comfortable and there is space for you to do it.

Since the first release of Windows 8 Preview, users are providing feedback about the UI and UX, and want to use the traditional desktop UI. To do it, it is as simple as just hitting one key on the keyboard of your PC, but to my own experience, I need to click the "Desktop" tile first in the "Metro" mode, which means the traditional desktop UI needs to be running on the CPU, then the click on the windows key on the PC's keyboard will switch me from Metro style to traditional style.
The other way to do it is to put your mouse at the lower left corner of the screen, then the icon of traditional desktop would show, and you can click it to switch. Or just put your mouse at the lower left corner, and do the left click on your mouse to switch back and forth between these 2 modes, this is the most easy way to do it.

After switching to the traditional desktop UI, you may find that there is not the "Star tup" button. Now in the social media, people are talking about Microsoft's latest decision to disable any 3rd party software capable of putting back the "Start up" button. One of the work around is to stick the app to the task bar.

Windows 8 provides similar functions of "Start up" button in other ways.
Please try to move your mouse to the lower right corner of the screen, which is near the end of the task bar, then a vertical menu would show up on the right side of the display, which has the options of "Search", "Share", "Start", "Devices" and "Settings". Putting mouse on the upper right corner of the screen would also work. I feel the motion event of the mouse is mimic the touch event on the screen, I think on tablet, user just need to touch the right corners of the display to show the menu.

In "Search", it would allow you to search the app you would like to you, and display a list of apps let you to choose. This feature provides quite the same function of "Start up" button which would list the apps when user clicks on it.

There seems to be no need to get the traditional "Start up" button back and put it at the lower left corner of the screen.

Users can also point the mouse to the left lower corner of the screen, then do the right click on the mouse, a menu would pop up and a list of options would be displayed there allowing user to choose.
User can choose "Search" to look for the apps. It would display quite the same screen mentioned above.

To get back to the desktop from the search screen, you just need to move the mouse to the upper left corner and click on the 'Desktop" icon, or try to move the mouse to the lower left corner again, and do the right click on your mouse, then from the menu, select "Desktop". Or simply put your mouse at the left lower corner, and do the left click on your mouse.





Tuesday, August 07, 2012

Nexus 7: Settings and menu issues

In my last post, I talked about the network options on Nexus 7 tablet, and mentioned that there is not data service or option of "internet pass through".

Now if you open Play Books application, click the menu at the upper right corner of the display, you would see "Settings" option, which means it is a "Setting" option you can use to set Play Books.

Now when you open the "Settings" option, you would see
a. Auto-rotate screen, under which it says "Use system setting", and you can not change it, and if you want to change it, you would need to go to the "system setting".

b. Download over Wi-Fi only, under which it says "To reduce carrier data charges, don't download over mobile networks", and you can check on or off the box on the right side. Because the current version of Nexus 7 is Wi-Fi only, there is not feature of network data service, so this option item is meaningless, no matter you check it on or off, you would be always downloading data over Wi-Fi.

c. Automatically read aloud, under which it says "Automatically read aloud when application starts if accessibility is set", and there is a check box on the right side.

So basically, only item c need to be listed on this view, and allow user to choose, item a and b should be invisible and hidden.


Oh, there is other issue when you compare the menu of Play Book and menu of Play Magazines.

On the menu of Play Books, there are the following option items:
a1. Make available offline
b1. View as list (or View as carousel)
c1. Refresh
d1. Accounts
e1. Settings
f1. Help.

On the menu of Play Magazines,
a2. View by title (or View recent)
b2. Show archived magazines
c2. Manage subscriptions
d2. Refresh
e2. Settings
f2. Help

It is very obvious that the order of the items is not the same.
At least, the last 3 menu items in Play Books would be

Refresh
Settings
Help

and the first two items would be

View as list
Make available office

which would make it a little bit better.

And for Play Magazines, in "Settings", there is an item "Account",
which has similar function of "Manage subscription".

Looks like "Play Books" and "Play Magazines" are designed by two teams/designers,
and developed by two separate teams also. Otherwise, this kind of issue would not happen in the these two products.

If you look at other apps, such as Play Movies, Music, YouTube, they have similar issues on the menu.