Monday, December 31, 2012

Tagged under: , ,

How to upgrade Samsung Captivate to Jelly Bean 4.1

I’ve just upgraded my Android phone to Jelly Bean 4.1.2 which is really great in speed and performance. So this is what I did.

I decided to use CyanogenMod 10 for my Samsung Captivate.

1

First, I donwloaded a stable CM10 for my Captivate on CM official page and put it into my phone. But my phone used some modified ROM (2.3) which can’t be upgraded to CM10. So I flashed my phone back to stock ROM of Captivate.

I backed up my phone using Nandroid in recovery mode (turn off phone, hold volume up & down simultaneously then press & hold power button).

I opened I897UCJF6-final-OCD-REV0.exe, then plugged the phone to my laptop. The program quickly detected my phone with a yellow sign, I clicked Start (or Master Clear I don’t remember) and waited for some minutes.

After the process completed, the phone was already at stock ROM.

2

At this step I couldn’t use recovery mode (I think it was because of the lack of ROM Manager). I couldn’t find RM on Market because the lastest RM is now not supported on 2.1! So I had to google and download RM 2.5 which can run on 2.1 Eclair.

The phone needed to be rooted before it could use RM. After trying some ways, only UnlockRoot worked!

Then I installed RM and used it to install recovery clockwork and rebooted to recovery mode.

3

At this step I couldn’t find the recovery clockwork mode normal menu, so I chose Advanced and didn’t know why but everything was OK after that!

Chose Install zip from sd card and browsed to the CM10 zip file.

After the process completed, my phone rebooted to CM10 successfully

4

The last problem was I couldn’t find Google Play or any program of Google on CM10! The reason is CM Team can not put them into their ROM because of Google Copyright Rules.

I had to download gapps-jb-20121011-signed.zip and installed it through recovery mode just like CM ROM (Install zip file from sd card).

Thursday, May 17, 2012

Tagged under: , , , , ,

How to use auto-complete textfield in Drupal

This is mostly applied to both Drupal 6 and 7, the only difference is Drupal 6 uses drupal_json() and Drupal 7 uses drupal_json_output(). Here's what I did.

Create a link to my form and a link to page that used for return autocomplete results:
//hook_menu
function my_module_menu() {

 $items['my_autocomplete_form'] = array(
'type' => MENU_CALLBACK,
'title' => 'My Autocomplete Form',
'access callback' => TRUE,
'page callback' => 'drupal_get_form',
'page arguments' => array('my_autocomplete_form')
);


$items['autocomplete'] = array(
'type' => MENU_CALLBACK,
'title' => 'Autocomplete',
'access callback' => TRUE,
'page callback' => 'my_autocomplete_form_result'
);

return $items;

}


Create content of my form:
function  my_autocomplete_form () {
$form = array();
 
$form['my_autocomplete_textfield'] = array(
'#title' => 'Text',
'#type' => 'textfield',
'#description' => 'This is a autocomplete textfield',
'#autocomplete_path' => 'autocomplete',
'#maxlength' => 500,
);

return $form;
}


Query whatever you want from database using the text you type in the textbox:
function istar_front_product_manager_result($string) {
$matches = array();

$result = db_query_range("SELECT nid, title FROM {node} WHERE LOWER(title) LIKE LOWER('%%" . $string . "%%')", 0, 10);
while ($row = $result->fetchObject()) {
$matches[$row->nid] = check_plain($row->title);
}

return drupal_json_output($matches);
}




Monday, May 14, 2012

Tagged under: , , ,

Quick CSS adjustment on JCarousel module in Drupal

Sometimes you use JCarousel module in your Drupal website and you want it fit your website quickly. All you have to do is:

#block-views-kornova-news-news-scrollbar .jcarousel-container {
  width: 460px;
}

#block-views-kornova-news-news-scrollbar .jcarousel-clip {
  width: 460px;
  overflow: hidden;
}

Saturday, May 12, 2012

Tagged under: , , ,

How to control sound volume with hotkey



If you're using a laptop, there's no problem with adjusting sound volume because there's always hotkeys for that (Fn + some key depending on the manufacturer). But on desktop, there's nothing like that and it's really inconvenient when your computer suddenly make a loud noise. Using hotkeys is obviously faster than looking for the volume icon on the taskbar, click on it and then scroll your mouse. Here's how.