Tip: In Eclipse, press Ctrl + Shift + O to import missing classes (Cmd + Shift + O on Mac).
Monthly Archives: June 2013
Android Emulator : Keyboard Commands
ที่มา : developer.android.com/
Emulator keyboard mapping
Emulated Device Key | Keyboard Key |
---|---|
Home | HOME |
Menu (left softkey) | F2 or Page-up button |
Star (right softkey) | Shift-F2 or Page Down |
Back | ESC |
Call/dial button | F3 |
Hangup/end call button | F4 |
Search | F5 |
Power button | F7 |
Audio volume up button | KEYPAD_PLUS, Ctrl-F5 |
Audio volume down button | KEYPAD_MINUS, Ctrl-F6 |
Camera button | Ctrl-KEYPAD_5, Ctrl-F3 |
Switch to previous layout orientation (for example, portrait, landscape) | KEYPAD_7, Ctrl-F11 |
Switch to next layout orientation (for example, portrait, landscape) | KEYPAD_9, Ctrl-F12 |
Toggle cell networking on/off | F8 |
Toggle code profiling | F9 (only with -trace startup option) |
Toggle fullscreen mode | Alt-Enter |
Toggle trackball mode | F6 |
Enter trackball mode temporarily (while key is pressed) | Delete |
DPad left/up/right/down | KEYPAD_4/8/6/2 |
DPad center click | KEYPAD_5 |
Onion alpha increase/decrease | KEYPAD_MULTIPLY(*) / KEYPAD_DIVIDE(/) |
How to Enable the Hidden Developer Options on Your Samsung Galaxy S4
To unlock the Dev Options menu, go to Settings -> About Device and scroll down to the “Build Number.”
การติดตั้ง Chord SDK Plug-in (emulator) สำหรับ Android บน AVD
ภาพรวมการทำงานของ Chord SDK Plug-in for the Android Virtual Device Framework
Android : ADT Plugin Revisions
Get the Android SDK
http://developer.android.com/sdk/index.html
ดูรายละเอียดของ ADT Plugin เวอร์ชั่นต่างๆ
ข้างล่างนี้แสดงรายละเอียดของ ADT Plugin เวอ์ชั่นต่างๆ
แต่การใช้งานจริง ให้ดาวน์โหลด Android SDK (ADT Bundle) จะใช้งานง่ายกว่า โดยดาวน์โหลด ได้ตามลิงค์ด้านบน
The sections below provide notes about successive releases of the ADT Plugin, as denoted by revision number.
For a summary of all known issues in ADT, see http://tools.android.com/knownissues.
ADT 22.0.1 (May 2013)
- Dependencies:
-
- Java 1.6 or higher is required for ADT 22.0.1.
- Eclipse Helios (Version 3.6.2) or higher is required for ADT 22.0.1.
- ADT 22.0.1 is designed for use with SDK Tools r22.0.1. If you haven’t already installed SDK Tools r22 into your SDK, use the Android SDK Manager to do so.
- General Notes:
-
- Fixed issue with Lint ServiceCast check and fully qualified class names. (Issue 55403)
- Fixed crash issue with Lint ArraySizeDetector check. (Issue 54887)
- Fixed problem with the Gradle export feature.
- Fixed version check issue for the ADT Plugin.
ADT 22.0.0 (May 2013)
ADT 21.1.0 (February 2013)
ADT 21.0.1 (December 2012)
ADT 21.0.0 (November 2012)
ADT 20.0.3 (August 2012)
ADT 20.0.2 (July 2012)
ADT 20.0.1 (July 2012)
ADT 20.0.0 (June 2012)
ADT 18.0.0 (April 2012)
ADT 17.0.0 (March 2012)
ADT 16.0.1 (December 2011)
ADT 16.0.0 (December 2011)
ADT 15.0.1 (November 2011)
ADT 15.0.0 (October 2011)
ADT 14.0.0 (October 2011)
ADT 12.0.0 (July 2011)
ADT 11.0.0 (June 2011)
ADT 10.0.1 (March 2011)
ADT 10.0.0 (February 2011)
ADT 9.0.0 (January 2011)
ADT 8.0.1 (December 2010)
ADT 8.0.0 (December 2010)
ADT 0.9.9 (September 2010)
ADT 0.9.8 (September 2010)
ADT 0.9.7 (May 2010)
ADT 0.9.6 (March 2010)
ADT 0.9.5 (December 2009)
ADT 0.9.4 (October 2009)
Adding a library/JAR to an Eclipse Android project
Instead, follow the (widely available) instructions for importing the third-party library, then adding it using Build Path (which makes it known to Eclipse for compilation purposes). Here is the step-by-step:
- Download the library to your host development system.
- Create a new folder, libs, in your Eclipse/Android project.
- Right-click libs and choose Import -> General -> File System, then Next, Browse in the filesystem to find the library’s parent directory (i.e.: where you downloaded it to).
- Click OK, then click the directory name (not the checkbox) in the left pane, then check the relevant JAR in the right pane. This puts the library into your project (physically).
- Right-click on your project, choose Build Path -> Configure Build Path, then click the Libraries tab, then Add JARs…, navigate to your new JAR in the libsdirectory and add it. (This, incidentally, is the moment at which your new JAR is converted for use on Android.)
Ref: http://stackoverflow.com/questions/3642928/adding-a-library-jar-to-an-eclipse-android-project
Working with files in Drupal 7
Drupal 7 has replaced the old Upload module (which provided the “Attachments” feature on nodes) with a FileField (as FileField is now in core). So, while there’s no longer the option to enable attachments for the content type within the main page of the content type edit form, you can now add a new File field to the content type. Once you’ve saved the new field for your content type, the upload form will appear on the edit page for nodes of that type.
Since in Drupal 7 both nodes and comments are “entities”, you can attach fields to both in the same way. When Comment module is enabled and you click to edit one of your content types, you’ll see both a Manage Fields tab (for fields on the node) and a Comment Fields tab (for fields on the comments for this particular content type).
ที่มา : https://drupal.org/node/1026432
จากข้อความด้านบนสรุปได้ว่าโมดูล Upload ใน Drupal 6 ไม่มีแล้วใน Drupal 7 เพราะมีการสร้าง FileField ไว้ในแกนหลักของ Drupal 7 แล้ว การจะใช้งานก็ให้ไปทำการเพิ่มฟิลด์ให้กับ Content type ที่จะใช้ เช่นต้องการให้ Article สามารถทำการ Upload ไฟล์ได้ ก็ให้ไปเพิ่มฟิลด์ที่ Article ดังรูป
หลังจากกด Save จะแสดงหน้ากำหนดค่า
การกำหนดค่าที่สำคัญคือ file extension ซึ่งปกติจะมีแต่ txt แต่ถ้าต้องการให้ Upload ไฟล์ชนิดอื่นได้ด้วย ให้เพิ่ม file extension คั่นด้วย comma ดังรูป
หน้าเว็บ Drupal 7 ภาษาไทย
Upgrade จาก Drupal 6 ไปเป็น Drupal 7
ที่มา : https://drupal.org/node/570162
Upgrade Steps
- Backup your existing site and database.
- Update Drupal core, modules and themes to the latest releases for your existing Drupal version.
- Log in as user ID 1 (the site maintenance user).
This is the user name that you created during the installation process for your site. - Put your site in maintenance mode
Go to the site maintenance page, select “Off-line” and save the configuration. If you have defined a custom maintenance theme in your settings.php file, comment it out before proceeding. - Change all themes to Garland
Go to the Themes page, enable “Garland” and select it as the default theme. If you have been using a separate theme for administration, select “Garland” for your administration theme as well. If you are using a custom maintenance theme, comment out'maintenance_theme' => 'your theme name'
in settings.php. - Disable non-core modules
Go to the Modules page and disable all modules that are not listed under “Core – required” or “Core – optional”. It is possible that some modules cannot be disabled, because others depend on them. Repeat this step until all non-core modules are disabled.If you know that you will not re-enable some modules for the target Drupal version and you no longer need their data, then you should uninstall them under the Uninstall tab after disabling them.You can also use Drush to disable all non-core modules (first save a list of all enabled modules):drush pml --no-core --type=module --status=enabled --pipe > modules.txt
xargs -a modules.txt drush -y dis
xargs -a modules.txt drush -y en - Remove default settings file
On the command line or in your FTP client, remove the filesites/default/default.settings.php
- Remove all old core files and directories
Remove all old core files and directories, except for the ‘sites’ directory and any custom files you added elsewhere. If you made modifications to files like.htaccess
orrobots.txt
, you will need to re-apply them from your backup, after the new files are in place. - Remove uninstalled modules
If you uninstalled any modules, remove them from thesites/all/modules
and othersites/*/modules
directories. Leave other modules in place, even though they are incompatible with Drupal 7.x. - Download Drupal
Download the latest Drupal release of the target version to a directory outside of your web root. Extract the archive and copy the files into your Drupal directory.On a typical Unix/Linux command line, use the following commands to download
and extract:wget http://drupal.org/files/projects/drupal-x.y.tar.gz
tar -zxvf drupal-x.y.tar.gz
This creates a new directorydrupal-x.y/
containing all Drupal files and directories. Copy the files into your Drupal installation directory:cp -R drupal-x.y/* drupal-x.y/.htaccess /path/to/your/installation
If you do not have command line access to your server, download the archive using your web browser, extract it, and then use an FTP client to upload the files to your web root. - Re-apply modifications to core files
Re-apply any modifications to files such as.htaccess
orrobots.txt
. - Make your
settings.php
file writeable
Make yoursettings.php
file writeable, so that the update process can convert it to the new format. - Run the update script
Runupdate.php
by visitinghttp://www.example.com/update.php
(replacewww.example.com
with your domain name). This will update the core database tables.If you are unable to accessupdate.php
do the following:- Open
settings.php
with a text editor. - Find the line that says:
$update_free_access = FALSE;
- Change it into:
$update_free_access = TRUE;
- Once the upgrade is done,
$update_free_access
must be reverted toFALSE
.
- Open
- Backup your database
Backup your database after the core upgrade has run. - Upgrade fields
If you are upgrading from Drupal 6 to 7 and were using CCK (and perhaps additional modules) to create fields for your content types, you will need to upgrade the data in those fields as a separate step. Download the Drupal 7 CCK module, and turn on Content Migration. Go to Structure > Migrate Fields orhttp://example/com/admin/structure/content_migrate
for a page to walk you through the migration process. There are now several types of fields in core, but not every type. You might need to download Drupal 7 versions of contributed modules to support other types of fields (such as the References module for nodereference fields and/or userreference fields). Learn more about migrating content from CCK to Core Fields. - Update contrib modules and themes
Replace and update your non-core modules and themes, following the procedures athttp://drupal.org/node/948216 - Check the Status Report
Go to the Status Report page and verify that everything is working as expected. - Make sure settings.php is secure
Ensure that$update_free_access
isFALSE
in settings.php.
Remove write permissions. - Check Drupal Core Modules
Make sure that standard modules from a typical fresh install are engaged. In a Drupal 6 to 7 upgrade, some modules that may not be engaged are: ‘Dashboard’, ‘Contextual Links’, ‘Overlay’, ‘Field’, ‘File’, ‘Image’ and ‘Shortcut’. - Remove your site from Maintenance Mode
Go to the Maintenance Mode page and disable the “Put site into maintenance mode” checkbox and save the configuration.
Note that the file structure, particularly the locations of core and contributed modules have changed in Drupal 8.
โดยสรุปคือ
- Backup ไฟล์ทั้งหมด และฐานข้อมูล
- Update โมดูลทั้งหมด ทั้ง core และ โมดูล กับ ธีม ให้ update ให้หมด
- ล็อกอินด้วย user ที่สร้างตอนติดตั้งเว็บไซต์
- เซ็ตให้เว็บไซต์ของเราเป็น maintenance mode
- เปลี่ยนธีมให้เป็น Garland
- ปิดการใช้งาน non-core modules
- ลบไฟล์ sites/default/default.settings.php
- ลบไดเร็กทอรี่ทั้งหมด ยกเว้น sites
- ลบโมดูลที่ปิดการใช้งานในข้อ 6
- ดาวน์โหลด Drupal 7
- x
- x
- ทำการ Update ด้วยการเรียก http://www.example.com/update.php
หลังจากทำการ Update เสร็จแล้ว ถ้าต้องการให้ Admin ใช้งาน Overlay, Dashboard ให้ไป enable โมดูล Overlay, Dashboard
และยังมีอีกหลายๆ core modules ที่หลังจาก Update แล้วต้องไป enable เอง ไม่เหมือนการติดตั้งใหม่ core modules ต่างๆนี้จะ enable มาให้เลย
ปัญหาที่พบหลังการ Update
- Drupal 7 มี administrator role ซึ่ง Drupal 6 ไม่มี เลยไปเพิ่ม role เองที่ฐานข้อมูล จากนั้นมาที่หน้า admin -> people -> permissions เพื่อเพิ่มสิทธิให้กับ administrator role
- user ที่เป็น administrator ไม่มี UI ให้กำหนดรูป (ยังไม่ได้หาทางแก้)
- content type ไม่เหมือนกัน ระหว่าง Drupal 6 และ Drupal 7 ทำให้ติดตั้ง CKEditor บนตัว update ไม่สามารถใช้งาน CKEditor ได้ (แต่ติดตั้ง CKEditor บน Drupal 7 ที่ install ใหม่ สามารถใช้งานได้ปกติ)
- enable โมดูล Dashboard แล้วทำงานได้ แต่เมนูนำทางต่างๆไม่ขึ้น (อาจต้องไปกำหนดค่าที่ไหนซักที่)
สรุปการ Update
การ Update จาก Drupal 6 ไปเป็น Drupal 7 สามารถทำได้ แต่ไม่สมบูรณ์นัก (เฉพาะโมดูล core ไม่นับโมดูลที่ติดตั้งเพิ่ม) ดังนั้นถ้าจำเป็นต้อง Update จาก Drupal 6 ไปเป็น Drupal 7 จริงๆ ก็ต้องเผื่อเวลาในการแก้ไขปัญหาจุกจิกต่างๆไว้พอสมควร
CNAME record
CNAME record ก็คือ ชื่อเล่นนั่นเอง เช่น
NAME TYPE VALUE
--------------------------------------------------
bar.example.com. CNAME foo.example.com.
foo.example.com. A 192.0.2.23
foo.example.com (Type: A) ชี้ไปที่ไอพี 192.0.2.23
แต่ bar.example.com (Type: CNAME) ชี้ไปที่ foo.example.com
ซึ่งก็ต้องไปดูที่ foo.example.com อีกทีจึงจะได้ไอพี 192.0.2.23 มาใช้งาน
ที่มา : en.wikipedia.org/