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.