Saturday, February 23, 2013

Nexus 4 4.2.2 OTA Enable LTE

Living in Canada and as a fan of Nexus line, I can't resist to not buying Nexus 4.  Upgrading from Galaxy Nexus, I can tell the new Nexus 4 is really nice phone.  For less than $400 CAN, you get a quad-CPU, 2G RAM, 16G storage, and most of all..LTE connection from Fido.

Before I update to 4.2.2, LTE works great with the new Fido LTE sim card.  As a 6G data plan user, this is a great function.  However after I update to 4.2.2, LTE no longer work for me and the *#*#4636#*#* tick no long hold the LTE option.  OK, ask myself do I really need LTE?  Tried the phone few day without LTE and I can tell, Yes, I do really want LTE and now I need to bring back the LTE.  Did some research and ended up this function is broken by BaseBand from 4.2.2.  As a Nexus phone (Dev phone), we can flash the phone to use a different BaseBand.  Here is what I did to enable LTE again on 4.2.2 Nexus 4.  NOTE: I just record the step for myself and I'm not sure what will happen if you follow the steps.

DO IT AT YOUR OWN RISK!!

Step 1:
Install Android SDK and all latest update on your PC.  The key point of installing Android SDK is to get the fastboot.
Step 2:
Connect your phone to your PC via USB cable.  Make sure you install the driver.  (If you need the driver, you can point it to "C:\Program Files (x86)\Android\android-sdk\extras\google" assume you install your SDK under "C:\Program Files (x86)").

Step 3:
Now we need to flash the radio.  I flashed my with .33 from 4.2.1 and I got it from 4.2.1 image.  (I put the radio file in a zip file and publish it here)

Step 4:
When you phone is connected, reboot it to fastboot mode.  To do it, turn off your phone and turn it on by holding volume down and power button.

Step 5:
NOTE: This step will reset your phone and all settings/apps will be gone.  Back up your data before you do it.
Now your phone is in fastboot mode and it is connected to your PC, we can use the command prompt to flash the radio.

From CMD, type:
fastboot devices (If it is connected, you will see your device ID)
fastboot oem unlock (If it works, you will see a message "OKAY")
fastboot flash radio [Name of the radio img file].img (If it works, you will see more "OKAY" messages)
fastboot reboot (Now we are done we reboot the phone)

Once it is flashed, you need to go through all configuration just like you got it from the box.  After that, the 4636 tick for LTE will work again.

I have that enabled for few days and I don't have any issue with the WIFI, Connectivity with Fido (on 4G), and battery itself seems no impact at all.  Hope it helps.


Sunday, March 18, 2012

New iPad

After a year long, I'm back to the blogger and doing more posting. Nothing related to programming but it is more related to the new gadget! Yup, the new gadget, iPad. Well, apple is dropping the number so no more iPad 3 but just iPad.

The one I bought is black as I'm sharing it with my wife and my wife like black:


The new iPad looks great. I don't have iPad 2 and I only had iPad 1 before. Compare to iPad 1, the new iPad is way faster. For the weight, I guess it's almost like iPad 1 so I can accept it.

I opened it the date that release and linked it to my apple account. Everything seems OK. Checked the battery and it showed 86%. OK, used it for a night and tried to charge the iPad. Woke the next day and the battery went back to 86%!!!! I was so worry as I'm not sure why it didn't charge to 100%. Did some research and found out, the new iPad needs the 10W USB power supply as the old one I got is only do 5W! Plugged into the new 10W and tried to charge it, works without issue. oops...

I went to the apple store today and I already saw the new 10W USB:



Hope the information helps as I guess there are so many people out there that still using their old iPad USB charger.

Wednesday, February 9, 2011

Remote Desktop ASPX from WHS 2003

I got a (HP) Window Home Server at home for a long time. Previously, I was just using it as file server and never thought of using it as a IIS server. Last month, my wife was working on a web project and asked me there is any free web hosting service on line or not so that she doesn't need to pay anything for just trying out her web site. Because of that reason, I started searching around and found a tool called "WHIIST" for Home Server. I'm not going to talk about this tool since there are many information from the internet about this tool and if you want, you can go to the official website to download and try it. (Beside, I just found out Andrew is not going to write the WHIIST for WHS VAIL. What a bad news!)

Having WHIIST installed on my home server gives me a lot of freedom and a lot of possibilities. After I installed WHIIST, SQL 2008, and .NET 4.0 framework on the server, I can now host my WebMatrix project on my home server and access it from the web. (I will talk about on how to configure the IIS and .NET 4.0 framework for WebMatrix later) However, one of the limitation from home server is that the remote desktop from the remote desktop page doesn't bring me to the desktop, instead, it brings me to the Home Server Console! Remote into the Home Server Console doesn't help me a lot in terms of configuring the IIS or the File. Therefore, I need to find a way to remote to the desktop. In order to do that, we need to edit the rdpload.aspx file.

By default, when you try to remote into the server you will get route to the Home Server Console:

































However, we can edit the rdpload.aspx file so that it doesn't route us to the Home Server Console.

Open the file by using NotePad and find the following line:

/* Comments*/
MsRdpClient.SecuredSettings.StartProgram = "HomeServerConsole.exe -b";
MsRdpClient.SecuredSettings.WorkDir = "<%= WorkDir %>";
And replace those 2 lines with the following:

/* Comments*/
MsRdpClient.SecuredSettings.StartProgram = "Explorer.exe";
MsRdpClient.SecuredSettings.WorkDir = "c:\\Windows";
Once you are done, save the file and try the remote desktop function from your remote page. If nothing goes wrong, it should route you to the desktop:


















As you can see, we can edit the file to enable the full-screen viewing rather than viewing it in a block. I'm going to stop here and leave the option on you to continue editing the file to find other possibilities.

Thursday, February 3, 2011

.NET requestValidationMode

I'm not sure how often other people have this kind of problem but when I decided to update my blog with "<" or ">" character, I have to find a HTML Encoder tool to encode the character. Since I have a window home server at home, I decided to write my own on-line HTML encoder page.

I have finished the web site and I host it on my home server. The web site is written by .NET 4.0 (I know it doesn't need to do with .NET..) and you can try it by clicking HERE

The syntax to encode the HTML text is really simple:

/* Comments*/
protected void Button1_Click(object sender, EventArgs e)
{
String value = "";
value = InputTxt.Text.Trim();
EncodedTxt.Text = "";
EncodedTxt.Text = Server.HtmlEncode(value).Trim();
}
To convert the text is really simple. However, the issue I had is about the HTML Request Validation. Once I have all the codes ready, I tried to run the page on my PC and test it by pasting "<header></header>". By clicking the button to trigger a page postback, I got the following error message:






After I did some research about this message, I figured out the error message I was having is because MS has a Request Validation to check the request contains any "Script" or not. For me, I have to disable the validation in order to perform the encoding. There are different ways to disable this validation. I choose to edit the web.config to disable the validation.

To disable the validation by editing the web.config file, open the web.confg file and update it like the following:
<system.web>
<compilation debug="true" targetFramework="4.0" />
<httpRuntime requestValidationMode="2.0" />
<pages validateRequest="false" />
</system.web>
After I updated the web.config file, I'm able to perform the encoding.

Sunday, January 30, 2011

IOS Safari Bookmark Icon for Blogger

Not sure why but once I started sharing idea on Blogger, I also love to browse around Blogger to see other people Blog and idea. Most of the time, I will do that at night time on my IPad and I really like the experience on IPad. I can tell the default settings for Blogger is really nice on IPad. Sometime, I run into some Blogs which are really good and I will bookmark it and save it on the IPad homepage. However, the bookmark icon on the IPad doesn't look good.

When I was playing around the Dashcode, I remembered there is a link reference which you can add to the HTML so that when people try to add the bookmark to the homepage, it will give them a nice icon. Actually, this setting works with Blogger.

Before we change the setting in Blogger, we need to prepare a nice icon PNG file. I'm not really good with Photoshop so I ended up just "google" around and download a nice PNG file. (Actually, I went to iconspedia and download from there.)

Once you have the nice icon, upload it on your host server and you are ready to edit the Blogger template. Log into your Blogger -> Go to Design -> Edit HTML, and you should see the HTML editor. Add the following line just below <header>.

<!-- Add the following code below Header -->
<link href='http://yourhostserver/youricon.png' rel='apple-touch-icon'/>
<!-- End Comment -->

Once you finish editing the template, save it and preview it.

When other people browsing your blog, this addition reference doesn't add or remove anything functionality. However, if the person is browsing your blog on IOS device and try to add bookmark to the home screen, it will use your icon instead of use the screenshot.

I have updated my blog to include a nice icon and you can try it if you have any IOS device.
(ScreenShot)




Sunday, January 23, 2011

Syntax Highlighter for Blogger

When I decided to put some source on Blogger, I was always thinking how other people are able to put their source code on their blog with some great highlighter. After I did some research, I found out most people are using a Javascript called "Syntax Hightlighter". The tool is really good and works great with Blogger. I know there are few other people already did post the instruction on other blog but I still want to share what I have done on Blogger and what it looks like if it works.

First, you need to download the zip file from the official site of "Syntax Hightligher" (Click HERE to download it. The version I have is 3.0.83). Extract it and host the files somewhere so that blogger can access it. Before we continue to configure Blogger, it is great to test the Javascript from your host server. The package comes with a great test file called "index.html". If nothing go wrong, you should able to see something like following when you try to access it:











Now, we need to edit the template to include the Javascript. Log into your Blogger and we need to design your template by the HTML Editor. Once you are in HTML Editor, find the line "</header>" and paste the following lines above it:
<link href='http://yourhostserver/styles/shCore.css' rel='stylesheet' type='text/css'/>
<link href='http://yourhostserver/styles/shThemeDefault.css' rel='stylesheet' type='text/css'/>
<script src='http://yourhostserver/scripts/shCore.js' type='text/javascript'/>
<script src='http://yourhostserver/scripts/shBrushCpp.js' type='text/javascript'/>
<script src='http://yourhostserver/scripts/shBrushCSharp.js' type='text/javascript'/>
<script src='http://yourhostserver/scripts/shBrushCss.js' type='text/javascript'/>
<script src='http://yourhostserver/scripts/shBrushJava.js' type='text/javascript'/>
<script src='http://yourhostserver/scripts/shBrushJScript.js' type='text/javascript'/>
<script src='http://yourhostserver/scripts/shBrushAS3.js' type='text/javascript'/>
<script src='http://yourhostserver/scripts/shBrushSql.js' type='text/javascript'/>
<script src='http://yourhostserver/scripts/shBrushVb.js' type='text/javascript'/>
<script src='http://yourhostserver/scripts/shBrushXml.js' type='text/javascript'/>
<script language='javascript'>
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.config.clipboardSwf = &#39;http://yourhostserver/scripts/clipboard.swf&#39;;
SyntaxHighlighter.all();
</script>
After you finish editing the template, don't forgot get to save the template and try to preview it before you post any new blog. The official website has a lot of documents to help you understand on how to use it and I personally like to use it with "<pre>" tag. In order to use it, you need to edit your blog in HTML and put the "<pre>" tag into your blog.

For example, putting the following code into your blog:
<pre class="brush: c-sharp;"> 
/* Comments*/
// Hello1.cs
public class Hello1
{
public static void Main()
{
System.Console.WriteLine("Hello, World!");
}
}
</pre>
it results as:
 
/* Comments*/
// Hello1.cs
public class Hello1
{
public static void Main()
{
System.Console.WriteLine("Hello, World!");
}
}
There is one more thing I would like to share with others is the "Brush aliases". Here is a list of what I feel like most people will use:

BrushBrush aliases
ActionScript3actionscript3
C#csharp
JavaScriptjs
SQLsql
XMLxml



Wednesday, January 19, 2011

Dashcode: RSS Reader for IPhone

My wife bought me a Macbook 3 yrs ago. Since that time, I was putting a lot of my personal time with the Mac OSX, XCode, Dashcode, and iLife tools. Currently, I just bought her a new iMac with i3 CPU and she loves it a lot and start using iWeb (From the iLife) for blog.

Try to following her blog on my IPhone 4 is a easy task. For some reasons, she picked a template with a lot of pictures and it took a long time to load on my IPhone 4 through the 3G network. (If anyone wants to take a look her blog, you can click HERE to give it a try. Beware this is a chinese web site.)

Currently, I just noticed the blog template from iWeb has RSS feed to return the lastest 5 blogs and I was thinking, hmmm, I can have some RSS reader on my IPhone 4 to review the documents.

Before we continue on the RSS reader, let us take a look the RSS feed. The RSS feed returns a single XML contains all the information we need for our reader. (Again, if you want to see what is that XML looks like, you can click HERE and take a look. Same as last time, it is coming from my wife's blog site and it contains chinese characters)

Beside buying a RSS reader through App Store, I remember Dashcode has a RSS reader template as well. Because I wanted to go cheap so I ended up to use Dashcode to generate the RSS reader.

Surprisingly, it is really a easy task. Assume you have XCode and Dashcode installed on your Mac, open Dahscode and select "Safari" -> "RSS" with "Mobile Safari" option only:




















Click "Choose" to open a new project. Once it opens the new project, you should see something like the following:




















The nice thing about this template is that it has most of the functionality already built into it. We don't have to do much if we are happy with the out-of-the-box functionality. In order to make this RSS reader works, there is 1 mandatory thing to do which is telling the RSS reader where to get the XML (which means we need to provide the URL address of the XML).



















Now goto the "Application Attributes", you can put the URL address into "Feed URL" and test the RSS Reader on the IPhone Simulator. If nothing goes wrong, the RSS Reader should work without any issue and return the list of blog titles.

There is a minor problem with this approach. The final solution cannot be deployed on any web server and it has to be deployed on the web server where it hosts the blog. (In order word, the domain has to be the same for the RSS Feed and the Web App) Assume your blog is hosted on a domain "www.mydomain.com" and the RSS Feed URL is "www.mydomain.com/blogtitle/blog/rss.xml", the final solution must be also hosted on "www.mydomain.com" domain as well in order to make it work properly.

If you want to try my RSS Reader, you can click HERE to give it a try. (This is the third time to remind you that the RSS Reader contains chinese characters!)