Thứ Hai, 27 tháng 8, 2012

notes

OMG!!! Very very exciting & interesting Xmas for U, I wish i was U and with U to go everywhere in the world for Xmas and new year season!!! haizzz I'm everything is OK but this Noel is still alone as same as many many last Xmas!!! Haizzzzz

Thứ Hai, 20 tháng 8, 2012

Emulator SKIN

QVGA 320x240, 120 dpi, 3.3"
WQVGA 432 x 240, 120dpi, 3.9"
HVGA 480 x 320, 160 dpi, 3.6"
WVGA800 800x480, 240 dpi, 3.9"
WVGA854  854x480, 240 dpi, 4.1"

Thứ Hai, 13 tháng 8, 2012

Android Activity Life Cycle


Oncreate -> onstart - onresume
Khi ấn back:  onpause - onstop - ondestroy
- chay lai : onCreate - onstart - onresume
- An Home: onStateInstant - onPause - onStop 


Thứ Tư, 8 tháng 8, 2012

Working

1. testcase :
\\server02\NECVN\Projects\13.長野支社AndroidAP開発\01.AU着メロディPJ\10.評価 (Test)\05.歌詞アプリとの連携対応\ベトナム語版
2. password:
File: nes-necvn2012
AU : necvnhcm.android@gmail.com
necvnhcm

Thứ Ba, 7 tháng 8, 2012

IDE for PHP

IDE for PHP

* Zen Studio: http://downloads.zend.com/studio/5.5.0/ZendStudio-5_5_0.exe
Key / Serial Number:
Xander S/N: EDAEB93323122604
The Blade S/N: 45368D9D12022020

Android note


1.    Hello Google MAP:
Cmd > cd /C:/program File/ Java/sdk/bin > keytool -list -alias androiddebugkey -keystore C:\Users\sonnt\.android\debug.keystore -storepass android -keypass android –v

Copy: chuỗi MD5.
E9:2C:A5:2E:80:79:FF:CD:4B:DB:25:B0:8D:7C:AA:CE

Sẽ thu đựơc :

Cảm ơn bạn đã đăng ký khóa Android Maps API!
Khoá của bạn là:
0qM3SvB2qp0QntwmC_nS582rZSmG8WYSBXteEGg
Khoá này phù hợp với tất cả các ứng dụng được ký bằng chứng nhận có dấu vân tay:
E9:2C:A5:2E:80:79:FF:CD:4B:DB:25:B0:8D:7C:AA:CE
Đây là bố cục xml mẫu để bạn bắt đầu tìm hiểu về ánh xạ:
              <com.google.android.maps.MapView
                 android:layout_width="fill_parent"
                 android:layout_height="fill_parent"
                 android:apiKey="0qM3SvB2qp0QntwmC_nS582rZSmG8WYSBXteEGg"


them vào maníet.xml dòng sau :
<uses-library android:name = “com.google.android.maps”/>
(nằm trong tab <application>  </application>)

Activity extends MapActivity


2.        JAVA MAP
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
 
public class MapExample {
 
    public static void main(String[] args) {
 
        Map<Object,String> mp=new HashMap<Object, String>();
 
        // adding or set elements in Map by put method key and value pair
        mp.put(new Integer(2), "Two");
        mp.put(new Integer(1), "One");
        mp.put(new Integer(3), "Three");
        mp.put(new Integer(4), "Four");
 
        //Get Map in Set interface to get key and value
        Set s=mp.entrySet();
 
        //Move next key and value of Map by iterator
        Iterator it=s.iterator();
 
        while(it.hasNext())
        {
            // key=value separator this by Map.Entry to get key and value
            Map.Entry m =(Map.Entry)it.next();
 
            // getKey is used to get key of Map
            int key=(Integer)m.getKey();
 
            // getValue is used to get value of key in Map
            String value=(String)m.getValue();
 
            System.out.println("Key :"+key+"  Value :"+value);
        }
    }
}
3.          Google Analytics SDK for Android
https://developers.google.com/analytics/devguides/collection/android/devguide?hl=vi-VN
 
4.       Tabhost extend activity
tabHost = (TabHost) findViewById(R.id.tabhost);
             
              mLocalActivityManager = new LocalActivityManager(this, false);
        mLocalActivityManager.dispatchCreate(savedInstanceState);
        tabHost.setup(mLocalActivityManager);
 
 













Check Permisstion:
if (context.checkCallingOrSelfPermission(Manifest.permission.INTERNET)
                != PackageManager.PERMISSION_GRANTED) {

-    Handle and Thead
private Handler messageHandler = new Handler() {
};
public void handleMessage(Message msg) {
super.handleMessage(msg);
progressDialog.dismiss();
}


start = (Button) findViewById(R.id.Button01);

start.setOnClickListener(new OnClickListener() {});
@Override
public void onClick(View arg0) {
fetchData();
}
protected void fetchData() {

progressDialog = ProgressDialog.show(this, "", "Doing...");


new Thread() {

public void run() {
try {
    Thread.sleep(800);} catch (InterruptedException e) {
}
messageHandler.sendEmptyMessage(0);
}
       }.start();
    }


---- get Name class strong intent:
intent.getComponent().getClassName()


Beyond Compare

-Background and text, back ground

Textcolor : #ffff, textsize 18dp, textstyle bold

Date:
Calendar c = Calendar.getInstance();
           int day = c.get(Calendar.DATE) ;

read write file:
File root = new File(Environment.getExternalStorageDirectory(), "Notes");
                     if(!root.exists()){
                            root.mkdirs();
                     }
                     File mFile = new File(root, path);
                     FileWriter mFileWriter = new FileWriter(mFile);
                     BufferedWriter buff = new BufferedWriter(mFileWriter);
                     buff.append(text);
                     buff.newLine();
                     buff.close();

File root = new File(Environment.getExternalStorageDirectory(), "Notes");
                     if(!root.exists()){
                            root.mkdirs();
                     }
                     File mFile = new File(root, filename);
                     StringBuilder sText = new StringBuilder();
                     BufferedReader br = new BufferedReader(new FileReader(mFile));
                     String line;
                     while((line = br.readLine())!= null){
                            sText.append(line);
                     }
                     return sText.toString();


Export ko co SVN: team -> export
XML design:
Set textsize : 12 sp
Set margin : 12dp
Background – mau nen trong suot : android:background="#a0000000"
Background-mau nen den/trang : android:background="@android:drawable/alert_light_frame"/android:background="@android:drawable/alert_dark_frame"


-    To call again click of button : call function: performClick();
Mang:
View... buttons ====== ArrayList<View>buttons;
String… arrString ====== ArrayList<String>arrString;

Trong ham static, cac doi so trong ay phai static, co cach nao truyen ham thuong vao static.
public class ResourceManager {
              private static final String TAG = "ResourceManager";
              private static ResourceManager instance = null;
              Context context;

             
              static ResourceManager createInstance(Context context){
                            instance = new ResourceManager(context);
                            return instance;
              }
             

              public static ResourceManager getInstance(){
                            return instance;
              }
              private ResourceManager(Context context){
                            this.context = context;;      
              }
             
             
}



-    Get String from string.xml:
context.getString(R.string.GA);
\


-    Lay color trong android mac dinh:
android:textColor="@android:color/white"

// chan hien thi ban phim vao edittext;
this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);

hide ban phim ao tren edittext khi click vao button
InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
           inputMethodManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);


-    Alert Dialog Builder
private void saveLyric() {
              AlertDialog.Builder lAlertDialog = new AlertDialog.Builder(
                            NewActivity2.this);
              lAlertDialog.setTitle("Save action");
              lAlertDialog.setCancelable(true);
              lAlertDialog.setPositiveButton("OK",
                            new DialogInterface.OnClickListener() {
                                   public void onClick(DialogInterface dialogInterface, int i) {
                                          Toast.makeText(getApplicationContext(),
                                                        "Selected item: " + i, Toast.LENGTH_SHORT)
                                                        .show();

                                   }
                            });
              lAlertDialog.setNegativeButton("Cancel",
                            new DialogInterface.OnClickListener() {
                                   public void onClick(DialogInterface dialogInterface, int i) {

                                   }
                            });
              lAlertDialog.setIcon(R.drawable.save_icon);
              lAlertDialog.show();

       }


tabHost nam duoi xml
<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/tabhost"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical"
        >

        <ImageView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:src="@drawable/header_gradient" />

        <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            />

        <ImageView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:src="@drawable/header_gradient" />

        <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0" />

        <ImageView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:src="@drawable/header_gradient" />
    </LinearLayout>

</TabHost>


Alert Builder
new AlertDialog.Builder(mContext)
                                          .setTitle("error")
                                          .setMessage("システムエラー")
                                          .setNeutralButton("close",
                                                 new DialogInterface.OnClickListener() {
                                                        @Override
                                                        public void onClick(DialogInterface dialog, int which) {
                                                               // 作りかけ(onCreate()が始まった)の設定画面を消せないかな?
                                                               mDLFileNGFlag = true;
                                                               finish();
                                                        }
                                                 })
                                          .show();