728x90
Android 에서 일본어 출력을 위해서 두가지 앱이 설치되어 합니다.

1. Classis Text To Speech - 무료
2. SVOX 일어 언어팩 - 2.99$

설치방법

1. 마켓에서 svox로 검색합니다.

2. 검색된 목록에서 Classis Text To Speech를 선택해서 설치합니다.


3. 다시 1번에서 검색목록에서 SVOX Japanese/日本을 선택해서 설치하십니다.


위에 2개의 앱을 설치 하셨다면 이제 환경 설정에서 TTS 엔진을 변경 하셔야 합니다.

환경설정

1. 환경설정에 들어 가셔서 음성 입력 & 출력을 선택합니다.


3. TTS(text-to-speech) 설정을 선택합니다.


4. SVOX Classic TTS의 체크 박스를 선택합니다.



5. 기본 엔진를 선택합니다.


6. 기본 엔진 목록에서 SVOX Classic TTS을 선택하시면 됩니다.



 

 

728x90
728x90
출처 : http://sotddi.tistory.com/tag/%EC%95%88%EB%93%9C%EB%A1%9C%EC%9D%B4%EB%93%9C%20opencv
http://triumphlsh.springnote.com/pages/6620993

1. cygwin 설치

Devel 확장 시킨후 gcc-core, gcc++, make, swig 를 선택하여 설치 한다.





2. Android NDK 설치

다운로드 : http://www.crystax.net/android/ndk-r4.php#download

C:\cygwin\home\[로그인계정] 폴더에
NDK파일(android-ndk-r4-windows-crystax-4.zip)을 다운받아서 압축을 푼다.


3. svn 클라이언트을 이용해서 opencv 파일을 내려받는다.

svn checkout http://android-opencv.googlecode.com/svn/trunk/


4. 빌드 환경 설정

C:\cygwin\home\[로그인계정]\.bashrc 파일 편집

export PATH=$PATH:/home/[로그인계정]/android-ndk-r4-crystax
export ANDROID_NDK_ROOT=/home/[로그인계정]/android-ndk-r4-crystax

 


5. opencv 컴파일




728x90
728x90
출처 : http://www.delphitricks.com/source-code/systeminfo/get_windows_system_temporary_directory.html

{ Getting the Temporary Directory } 

function GetTempDir: string; 
var 
  Buffer: array[0..MAX_PATH] of Char; 
begin 
  GetTempPath(SizeOf(Buffer) - 1, Buffer); 
  Result := StrPas(Buffer); 
end; 

function GetTempPath: string; 
var 
  TmpDir: PChar; 
begin 
  TmpDir := StrAlloc(MAX_PATH); 
  GetTempPath(TmpDir, MAX_PATH); 
  Result := string(TmpDir); 
  if Result[Length(Result)] <> '\' then 
    Result := Result + '\'; 
  StrDispose(TmpDir); 
end; 

function GetTempPath(var S: String): Boolean; 
var 
  Len: Integer; 
begin 
  Len := Windows.GetTempPath(0, nil); 
  if Len > 0 then 
  begin 
    SetLength(S, Len); 
    Len := Windows.GetTempPath(Len, PChar(S)); 
    SetLength(S, Len); 
    Result := Len > 0; 
  end else 
    Result := False; 
end; 
728x90
728x90
ListView 제어를 MVC 모델처럼 BaseAdapter 의 getCount, getView, getItem을 구현하여
List를 보여주는 예제입니다.

ListViewTest.java

ListView를 listview 로 생성하여
BaseAdapter 상속 받아서 구현한 ArrayAdapterExample 객체를
listview.setAdapter()호출하여 listview의 adapter로 설정합니다.
package com.shryu.test;

import android.app.Activity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;

public class ListViewTest extends Activity implements OnClickListener {
	
  private TextView text; 

  private ArrayAdapterExample adapter;
	
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    //setContentView(R.layout.main);
    
    LayoutInflater inflate = LayoutInflater.from(this);
    LinearLayout layout = (LinearLayout)inflate.inflate(R.layout.main, null);
    this.setContentView(layout); 
    
    text = (TextView)findViewById(R.id.TextView02); 
    
    ListView listview = new ListView(this);
    listview.setLayoutParams(new LinearLayout.LayoutParams(
    		LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.FILL_PARENT)); 
    layout.addView(listview);
    
    adapter = new ArrayAdapterExample(this, R.layout.list_item_1);
    listview.setAdapter(adapter);
  }

  @Override
  public void onClick(View v) {
    Button btn = (Button)v;
    text.setText(btn.getText());
  }
}
main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<TextView
    android:id="@+id/TextView02"  
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:text="@string/hello"
    />
</LinearLayout>
ArrayAdapterExample.java
package com.shryu.test;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.Filter;
import android.widget.Filterable;
import android.widget.TextView;

public class ArrayAdapterExample extends BaseAdapter implements Filterable {

	private Context mContext; 
	private int mFieldId = 0;

	public ArrayAdapterExample(Context context, int textViewResourceId) {
		super();
		mContext = context;
		mFieldId = textViewResourceId;
	}

	@Override
	public int getCount() {
		return 100;
	}

	@Override
	public Object getItem(int position) {
		String result = new String(position+"");
		return result;
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		View v = convertView; 
		if (v == null) { 
			LayoutInflater vi = LayoutInflater.from(mContext); 
			v = vi.inflate(R.layout.list_item_1, null);
		}
			
		String value = (String)this.getItem(position); 
		if (value != null) { 
			TextView tt = (TextView) v.findViewById(R.id.TextView01);  
			tt.setText("position = " + value);                        
			Button btn = (Button) v.findViewById(R.id.Button01);  
			btn.setText(value + " 선택"); 
			btn.setOnClickListener((OnClickListener)mContext);    
		}
		return v; 
	}

	@Override
	public Filter getFilter() {
		return null;
	}
}
list_item_1.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
	xmlns:android="http://schemas.android.com/apk/res/android"
	android:layout_width="fill_parent"
	android:layout_height="fill_parent">
<TextView android:text="@+id/TextView01" 
	android:id="@+id/TextView01"
	android:layout_width="wrap_content" 
	android:layout_height="wrap_content"/>
<Button android:text="@+id/Button01" 
	android:id="@+id/Button01"
	android:layout_width="wrap_content" 
	android:layout_height="30px"/>
</LinearLayout>
-end-
728x90
728x90

출처 : http://tigerwoods.tistory.com/12
http://vulpecula.tistory.com/3
http://nashorn.tistory.com/74
http://blog.vizpei.kr/94697746
http://www.jopenbusiness.com/tc/oss/entry/Android-ScrollView%EB%A1%9C-%ED%99%94%EB%A9%B4-%EC%8A%A4%ED%81%AC%EB%A1%A4-%EC%B2%98%EB%A6%AC
http://songdroid.blogspot.com/2009/12/linearlayout.html



main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<TextView  
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:text="@string/hello"
    />
</LinearLayout>
ScrollViewTest.java

package com.shryu.test;

import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.RelativeLayout;
import android.widget.ScrollView;
import android.widget.TextView;

public class ScrollViewTest extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //setContentView(R.layout.main);
        LayoutInflater inflate = LayoutInflater.from(this);
        LinearLayout layout = (LinearLayout)inflate.inflate(R.layout.main, null);
        this.setContentView(layout);
        
        //
        ScrollView sv = new ScrollView(this);
        sv.setLayoutParams(new RelativeLayout.LayoutParams(
             LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
        layout.addView(sv);
        
        LinearLayout subLayout = new LinearLayout(this);
        subLayout.setLayoutParams(new LinearLayout.LayoutParams(
        		LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT, 1.0f));
        subLayout.setOrientation(LinearLayout.VERTICAL);
        subLayout.setPadding(0, 0, 5, 0);
        sv.addView(subLayout);
        
        for (int i=0; i<20; i++) {
          TextView aa = new TextView(this);
          aa.setBackgroundColor(Color.BLUE);
          aa.setText("blue - " + i);
          subLayout.addView(aa);
         
          TextView aa2 = new TextView(this);
          aa2.setBackgroundColor(Color.BLACK);
          aa2.setText("black - " + i);
          subLayout.addView(aa2);
        }
    }
}

 
728x90
728x90

@header {
package xxx;
}

@members {
private AppBase appBase;

public void SetAppBase(AppBase appBase) {
  this.appBase = appBase;
}
}

@lexer::header {
package xxx;
}

packageDeclaration 
    :   'package' qualifiedName {
         System.out.println("--" + $qualifiedName.result.getLine() + "/" + $qualifiedName.result.getQualifiedName());
      }
        ';'
    ;

qualifiedName returns [AstQualifiedName result]
scope {
  AstQualifiedName current;
}
@init {
  $qualifiedName::current = new AstQualifiedName();
}

    :   IDENTIFIER {
          $qualifiedName::current.setLine($IDENTIFIER.getLine());
          $qualifiedName::current.addIdentifier($IDENTIFIER.getText());
      }
        ('.' IDENTIFIER {
          $qualifiedName::current.addIdentifier($IDENTIFIER.getText());
        }
        )* {
          $result = $qualifiedName::current;
        }
    ;

-----------------------------------------------------------------------------------

package xxx;

import xxx.AppBase;

import org.antlr.runtime.ANTLRFileStream;
import org.antlr.runtime.CommonTokenStream;
import org.antlr.runtime.RecognitionException;
import org.antlr.runtime.RuleReturnScope;
import org.antlr.runtime.Token;
import org.antlr.runtime.TokenStream;
import org.antlr.runtime.tree.CommonErrorNode;
import org.antlr.runtime.tree.CommonTreeAdaptor;
import org.antlr.runtime.tree.TreeAdaptor;

public class JavaTestMain {
 
 public static void main(String[] args) throws Exception {
  
  AppBase appBase = new AppBase();
  
  ANTLRFileStream fileStream = new ANTLRFileStream("ASTMain.java");
  JavaLexer lexer = new JavaLexer(fileStream);
  CommonTokenStream tokens = new CommonTokenStream(lexer);
  JavaParser parser = new JavaParser(tokens);
  parser.SetAppBase(appBase);
  parser.compilationUnit();
  }
}


728x90
728x90
- CustomDataSource 사용시 동적인 Count 사용
OptionsData.SmartLoad := True;

- 트리노드의 초기 + 표시
OptionsData.CheckHasChildren := false;
728x90
728x90
출처 : http://eclipse-javacc.sourceforge.net/

1. 메뉴 [Help] -> [Install New Software] 선택



2. [Install]창에서 [Add] 버튼 선택



3. 아래와 같이 입력하고 [OK] 버튼 선택

Name : JavaCC Plug-In
Location : http://eclipse-javacc.sourceforge.net/



4. JavaCC Eclipse Plug-in 선택하고  [Next] 버튼 선택



5. [Next] 버튼 선택



6. 라이센스 수용하고, [Finish] 버튼 선택



7. [OK] 버튼 선택



8. Plug-in 설치 완료 후, [Restar Now] 버튼을 선택하여 Eclipse을 다시 시작한다.



- jj 파일을 열어본 화면



- jj 파일에서 오른쪽 마우스를 선택하여 Compile 하기



- jj Compile 결과



- jj 파일 Compile 하여 생성된 java 파일들



728x90

+ Recent posts