2016년 1월 30일 토요일

zxing 바코드, 큐알스케너#가로모드에서 세로모드로 변경하기




zxing 바코드, 큐알스케너
#가로모드에서 세로모드로 변경하기



위 화면을 보시면 가로로 바코드나 큐알을 스캔할  수 있도록 되어  있어요

landscape = > portrait로 변경해주는 방법

토탈 네차례 정도의 단계를 거쳐주셔야 세로로 스켄을 할 수 있도록 변경이 돼요

=====

첫째. 메니페스트(AndroidManifest.xml) 에 있는다음의 구문의 정보를 수정하세요~ 
<uses-feature android:name="android.hardware.screen.landscape"/>
   부분을 <uses-feature android:name="android.hardware.screen.portrait"/>로 변경해주세요~

   AndroidManifest.xml의 소스중 액티비티(CaptureActivity) 의 screen orientation을 portrait으로 변경해주세요~

   CameraManager 클래스의 openDriver() 함수로 가셔서 theCamera = Camera.open(); 구문의 아래쪽에 theCamera.setDisplayOrientation(90); 을 추가시켜주세요




=====

둘째. 카메라와 액티비티를 세로모드로 전환하셨어도 사진을 통해 찍힌 이미지가 여전히 가로로 나오게 돼요
   사진을 찍은 후 얻은 byte[] data를 세로로 전환시켜주게 돼요
   DecodeHandler.java 파일을 열어보시면 
   activity.getCameraManager().buildLuminanceSource(data, width, height);
   를 호출하는 소스 부분이 있어요
   호출하는 그 라인 이전의 소스에 아래와 같이 추가해주세요~

   byte[] rotatedData = new byte[data.length];
   for (int y = 0; y < height; y++) {
  for (int x = 0; x < width; x++)
     rotatedData[x * height + height - y - 1] = data[x + y * width];
    }

    int tmp = width;
    width = height;
    height = tmp;

    byte[]data를 회전하여 rotatedData에 저장하고 width와 height를 스왑해주게 돼요
    그 다음에 
    buildLuminanceSource(rotatedData, width, height); 와 같이 바뀐 인자값을 넣어주세요~


=====

셋째. CameraManager.java 파일을 열어 보세요~
getFramingRectInPreview()의 rect 와 관련된 부분의 소스를 다음과 같이 바꾸어주세요

rect.left = rect.left * cameraResolution.y / screenResolution.x;
rect.right = rect.right * cameraResolution.y / screenResolution.x;
rect.top = rect.top * cameraResolution.x / screenResolution.y;
rect.bottom = rect.bottom * cameraResolution.x / screenResolution.y;


=====

넷째. CameraConfigurationManager의 getCameraResolution()과 getScreenResolution()의 소스를 다음과 같이 수정해주세요~

Point getCameraResolution() {
int tmp = cameraResolution.x;
cameraResolution.x = cameraResolution.y;
cameraResolution.y = tmp;
    return cameraResolution;
  }

  Point getScreenResolution() {
int tmp = screenResolution.x;
screenResolution.x = screenResolution.y;
screenResolution.y = tmp;
    return screenResolution;
  }

****  중요한 부분
그런데 이렇게 해서 만약에 에러가 발생한다면 그 소스를 치환보다 그대로 두세요~
*****


추가적인 부분들
1. CameraConfigurationManager 클래스에 setDesiredCameraParameters() 메소드에
  Camera.Parameters parameters = camera.getParameters(); 소스 구문이 존재해요
  그 소스의 아래쪽 부분에 다음의 소스를 추가해주세요~
  parameters.set("orientation", "portrait");

2. PlanarYUVLuminanceSource 클래스의 다음 구문을 검색하셔서 다음 소스구문들을 모두 주석처리 해주세요~
   if (left + width > dataWidth || top + height > dataHeight) {
      throw new IllegalArgumentException("Crop rectangle does not fit within image  
       data.");
    }

테스트를 해보시면 정상적으로 동작을 하게 돼요

가로는  해외 분들은 편할 수 있으나 지인들은 가로로 어플을 사용하는데 익숙해져 있어서 바코드스캐너, 큐알스캐너를 사용하는데는 세로방식을 편리해해요
barcode scanner, qr scanner 편리하게 만들어야 유저분들이  많이 사용하게 돼요


----------
강좌소개

안드로이드 강좌 - 서울 (셋팅 + 하이브리드어플)



달력메모장 어플 - 스케줄관리하기에 편리해요~


달력메모장 어플 - 

스케줄관리하기에 편리해요~


어플은 안정적이고 편리해야 유저가 많이 쓰게 돼요
포인트는 유저가 쓰기에 편리해야 한다는 것
편리하면 자연스럽게  입소문이 나서 많은 사람들이 설치하고 사용하게 돼요
편리하게 만들어진 달력 - 메모장 어플을 소개해요~





많은 사람들이 설치하고 있어요, 10만에서 50만대 설치수를 기록하고 있어요
대부분의 사람들이 좋다고  평가도 해요

2016년도  1월  말 기준



복잡한 스케줄러 대신 간편한 메모장으로 쓰자!
급하게 기억하려고 해 둔 메모!
메모를 했다는 사실조차 잊어버리셨죠?
이제 달력메모장 앱으로 한눈에 확인하세요!
위젯에서 쉽게 메모하고 달력에서 한눈에~
건망증 탈출!!!
일기장으로 사용해도 좋아요!!!
[달력 메모장 기능 및 특징]
1. 캘린더 (Calendar)
2. 휴일표시, 음력표시, 오늘표시
3. 메모장
4. 메모잠금 기능(비밀메모)
5. 메모백업기능
5. 위젯(Widget) - (4×4) (5×5)
6. QHD 지원
7. 약 700KB 정도의 가벼운 앱
[추후지원 예정]
1. 언어(영어) 지원

Tag. 메모장 일기장 달력 카렌다 위젯 MINAMSSI
=====
방문해 주심에 감사드려요~
즐거운 시간 보내세요~


2016년 1월 27일 수요일

전화통화시의 생활영어회화가 어떤것들이 있을까?



전화통화시의 생활영어회화가 

어떤것들이 있을까?



여보세요? 안녕하세요인데 전화시는 여보세요로 쓰인다
Hello?

여보세요. 저는 제임스입니다.
Hello. This is James speaking

누구를 찾으시나요?
Who are you trying to reach?

로버트 씨 계시나요?
Is Robert there?

로버트 씨와 통화하고 싶어요.
I'd like to speak to Robert.

잠깐만 기다려 주세요
Wait a minute, please.

==========================

전화생활영어회화중 다른 여러표현들

죄송합니다. 제가 전화를 잘못 걸었어요
I'm sorry. I think I have the wrong number

문자 메시지 남겨 주세요.
Please send me a text message

전화를 기다리고 있어요.
I'm waiting for a call.

==========================

지금 통화 가능하세요?
Can you talk now? 
 
전화가 늦어서 미안해요
Sorry for calling you late.
 
식사 하셨나요?
Have you eaten yet? 

저녁 몇시 정도에 전화하면 되나요?
What evening time do I call you back ?
 
다음주에 또 전화 할께요
I will call you back next week.


위 내용들은 전화통화시에 쓰이는 전화영어공부 회화내용들인데 도움이 많이 되셨나요?
여러 표현들이 있으니 처음부터 끝까지 주~ㄱ 살펴보세요~

Have a nice day~


2016년 1월 23일 토요일

안드로이드강좌 > EditText의 커서위치를 맨 마지막으로 이동시키기



안드로이드 개발 TIP


[Android] 

EditText의 커서위치를 맨 마지막으로 이동시키자




안드로이드에서 간단하게 비트맵 이미지를 resize 할 수 있는 메소드를 기억 저장용으로 기록해둬요
resize 하려하는 Bitmap Image와 최대 길이를 지정하면 비율에 맞게 리사이즈가 돼요

아래 소스를 참고하세요~

//커서의 위치를 맨 마지막으로 이동시킨다.
CharSequence text = etSCMoneyInput.getText();
if(text!=null && text.length()!=0){
        int cursorPos = Math.min(text.length(), 2000);
        etSCMoneyInput.setSelection(cursorPos, cursorPos); 
}

- EditText에 대한 팁 -

즐거운 시간 보내세요~




----------
강좌소개

공연/극장/연극장에서의 생활영어회화 어떻게 할까?



공연/극장/연극장에서의 

생활영어회화 어떻게 할까?



엔터테인먼트에 해당되는 공연/극장,연극 공연장에서의 기초생활영어를 배워보세요~

안녕하세요~
Hello

공연 프로그램과 가격표를 보여 주세요
Can I see the program and price table?

네, 이 정보를 참고 하세요
Yes. You can look at these for information.

공연은 몇 시에 시작하나요?
When does it begin?

누구의 공연인지 알수 있나요?
Who's playing?

같이 영화보러 가실래요?
Would you like to go to the movies with me? 
다른표현
You wanna go see a movie with me?  (많이 친한 친구사이일 경우 이 표현 쓰세요)  

어떤 영화 보시겠어요? (극장에 여러 영화가 있는 중에서 물어볼 경우 사용)
Which one do you want to watch? 
Which one do you feel like? 

(좌석 예매 시에 좌석을 가리키며 친구나 함께 간 분에게 의향을 물어볼경우) 
이 자리 괜찮아요?
Is this seat okay?  

극장에서 오징어 먹어 보셨나요?
Have you tried eating squid in the theater? 

극장이나 공연장에서의 생활영어회화 조금이라도 도움이 되셧나요?
예매시에도 쓰이는 간단한 영어 외국인 만나면 위 회화내용을 실습 해보세요~

즐거운 시간 보내세요~

Have a nice day~

2016년 1월 21일 목요일

[Android] 간단하게 사용하는 Bitmap 리사이즈(Resize) 예제



안드로이드 개발팁

[Android] 간단하게 사용하는 Bitmap 리사이즈(Resize) 예제



안드로이드에서 간단하게 비트맵 이미지를 resize 할 수 있는 메소드를 기억 저장용으로 기록해둬요
resize 하려하는 Bitmap Image와 최대 길이를 지정하면 비율에 맞게 리사이즈가 돼요

아래 소스를 참고하세요~

/* 
 * 비트맵 이미지의 가로, 세로 이미지 사이즈를 리사이징 
 * @param source 원본 Bitmap 객체 
 * @param maxResolution 제한 해상도 
 * @return 리사이즈된 이미지 Bitmap 객체 
 */ 
public Bitmap resizeBitmapImg(Bitmap source, int maxResolution){ 
        int width = source.getWidth(); 
        int height = source.getHeight(); 
        int newWidth = width; 
        int newHeight = height; 
        float rate = 0.0f;
         
        if(width > height){
                if(maxResolution < width){ 
                        rate = maxResolution / (float) width; 
                        newHeight = (int) (height * rate); 
                        newWidth = maxResolution; 
                }
        }else{ 
                if(maxResolution < height){ 
                        rate = maxResolution / (float) height; 
                        newWidth = (int) (width * rate); 
                        newHeight = maxResolution; 
                }
        }

        return Bitmap.createScaledBitmap(source, newWidth, newHeight, true); 
}


have a nice day~







생활영어회화 : 여행, 관광시에 관련된 생활영어



생활영어회화 : 

여행, 관광시에 관련된 생활영어




관광,여행에 관련된 생활영어회화내용 > 

이 도시의 관광 명소에는 어떤 곳들이 있나요? 
What are the tourist attractions in this city?

서울역에는 꼭 가보세요 
You should go to Seoul Station.

관광 안내소가 어디에 있나요?
Where is the tourist information center?

========================

택시를 탔을경우의 영어회화내용 

택시기사아저씨: Where are you going?

여행객(손님) : To the central park, please  센트럴파크로 가주세요

택시기본료 물어볼경우와, 빨리가달라는 표현

What's the basic rate? 이건 기본료 물어보는 거로, '택시기본료가 얼마인지 물어보실때 사용하세요'

Take the shortest way, plese '빠른길로 가주세요'

버스탈 경우의 생활영어회화내용
Where can I buy a bus ticket? 표를 어디에서 살수 있나요?
Does this bus go to central park?  이 버스가 센트럴 파크 까지 가나요?
Where should I get off ? 내가 어디서 내려야 하나요?

========================

호텔에서 필요한 영어

체크 인할 때
Good afternoon. Can I help you?
안녕하세요. 무엇을 도와드릴까요? 

Yes, I’d like to check in, please.
네, 체크 인을 하려고 해요

Do you have a reservation?
예약은 하셨나요? 

I have a reservation for five nights. My name is Angel.
5일간 예약했어요. 내 이름은 엔젤입니다.
Just a moment, please.
잠깐만 기다려 주세요. 

Oh, yes. One twin. Is that right?
아, 네. 트윈 하나군요. 맞죠?

예약이 안된 경우
Hello. Is there a room available tonight? 
여보세요. 오늘 저녁 지낼 방이 있나요? 

What kind of room do you have in mind?
어떤 방을 원하시나요?

I'd like a twin room(a single/ a double room), please.
트윈 룸(싱글/더블)이 필요해요. 

Hold on please.
잠깐만 기다려 주세요. 

I’m afraid we’re fully booked.
빈 방이 없어요

The only room available at the moment is suite.
지금 비어 있는 건 스위트 룸뿐입니다.

What’s the rate for the room? 
그 방의 요금은 얼마나 되나요? 

========================

레스토랑에서 필요한 영어회화

입구에서의 회화내용

How many, sir?  
몇 분이신가요?

Five, please.
다섯명입니다.

This way, please. Is this table right?
이쪽으로 오세요. 마음에 드세요? 

Yes, that’ll be fine. Thank you. 
예, 좋군요. 감사해요

========================
레스토랑에서 필요한 영어회화
주문할 때의 여행영어회화내용

May I take your order, sir?
손님, 주문하세요

I’d like to see the menu, please. 
메뉴판 주세요

What will you have? 
어떤걸로 드시겠어요?

I don’t know anything about American food. 
서양 음식에 대해서는 잘 모르겠어요

What do you recommend?
어떤 음식이 좋나요? 추천해주세요

Which do you prefer, meat or fish?
고기와 생선 중에서 어느쪽을 더 좋아하세요? 

I’d rather have meat.
고기를 더 좋아해요

Then, why don’t you try the 777?
그러면 777를 드시는 게 어때요?

What kind of dish is it? 
어떤 요리죠? 

It’s grilled meat.
그건 구운 고기

O.K. 
OK 그걸로 주세요~

========================

교통편 이용시의 생활영어
버스 정류장을 찾을 때 

Where can I catch a bus to go to sydney?
시드니에 가는 버스는 어디서 타면 되나요?

You can catch one across the street.
길 건너편에서 타세요~

교통편 이용시의 생활영어
택시를 이용할 때

Can you take five of us to the airport?
다섯명인데 공항까지 갈 수 있습니까? 

What’s the fare, please?
요금이 얼마나 나왔나요? 

Keep the charge.
잔돈은 가지세요.

여행시의 생활영어회화 조금이라도 도움이 되셧나요?

즐거운 시간 보내세요~

Have a nice day~

2016년 1월 20일 수요일

안드로이드 EditText 이벤트 처리



안드로이드 개발 팁




안드로이드 EditText 이벤트 처리 정보


Android에서는 EditText 에서 입력 이벤트 처리를 해 주어야 할 경우가 있어요

키보드에서 입력하는 동안의 이벤트와 그리고 enter키가 눌렸을 때의 이벤트 처리 등 해줘야 할 부분이 있어요
EditText 에 있는 OnEditorActionListener 와 OnKeyListener 를 이용해서 하게 되면 Enter와 back 키와 같은 이벤트를 처리 할 수 있어요 

OnEditorActionListener와 OnKeyListener 의 결과가 비슷하기 때문에 OnEditorActionListener를 이용한 예제 코드를 보세요 

  1. package com.example.coding;   
  2.   
  3. import android.app.Activity;   
  4. import android.os.Bundle;   
  5. import android.util.Log;   
  6. import android.view.KeyEvent;   
  7. import android.widget.EditText;   
  8. import android.widget.TextView;   
  9. import android.widget.TextView.OnEditorActionListener;   
  10.   
  11. public class EditTextEvent extends Activity implements OnEditorActionListener{   
  12.        
  13.     EditText editInput = null;   
  14.     TextView textResult = null;   
  15.     
  16.     @Override  
  17.     public void onCreate(Bundle savedInstanceState) {   
  18.         super.onCreate(savedInstanceState);   
  19.         setContentView(R.layout.main);   
  20.            
  21.         editInput = (EditText)findViewById(R.id.EditText_example);   
  22.         editInput.setOnEditorActionListener(this);   
  23.     }   
  24.   
  25.     @Override  
  26.     public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {   
  27.         switch(v.getId())   
  28.         {   
  29.         case R.id.EditText_Input:   
  30.         {   
  31.             if(event.getAction() == KeyEvent.ACTION_DOWN)   
  32.             {   
  33.                 Log.i("테스트""테스트");   
  34.             }   
  35.             break;   
  36.         }   
  37.         }   
  38.         return false;   
  39.     }   
  40. }  

위 처럼 구현하시면 돼요
하지만 고려할 사항이 있어요
소프트 키보드에서 입력한 순간 순간마다의 이벤트는 받지 못해요. OnKeyListener를 이용하여도 마찬가지 로 이벤트를 받지 못해요
이럴 경우에는 addTextChangedListener 라는 것을 이용하세요. 
이것에 대한 예제  다음을 참고하세요~ 

  1. package com.example.coding;   
  2.   
  3. import android.app.Activity;   
  4. import android.os.Bundle;   
  5. import android.text.Editable;   
  6. import android.text.TextWatcher;   
  7. import android.util.Log;   
  8. import android.view.KeyEvent;   
  9. import android.widget.EditText;   
  10. import android.widget.TextView;   
  11. import android.widget.TextView.OnEditorActionListener;   
  12.   
  13. public class EditTextEvent extends Activity implements OnEditorActionListener{   
  14.        
  15.     EditText editInput = null;   
  16.     TextView textResult = null;   
  17.        
  18.     @Override  
  19.     public void onCreate(Bundle savedInstanceState) {   
  20.         super.onCreate(savedInstanceState);   
  21.         setContentView(R.layout.main);   
  22.            
  23.         editInput = (EditText)findViewById(R.id.EditText_example);   
  24.         editInput.setOnEditorActionListener(this);   
  25.         editInput.addTextChangedListener(textWatcherInput);   
  26.     }   
  27.   
  28.     @Override  
  29.     public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {   
  30.         switch(v.getId())   
  31.         {   
  32.             case R.id.EditText_Input:   
  33.             {   
  34.                 if(event.getAction() == KeyEvent.ACTION_DOWN)   
  35.                 {   
  36.                     Log.i("테스트""테스트");   
  37.                 }   
  38.                 break;
  39.             }
  40.         }
  41.         return false;   
  42.     }
  43.     
  44.     TextWatcher textWatcherInput = new TextWatcher() {   
  45.            
  46.         @Override  
  47.         public void onTextChanged(CharSequence s, int start, int before, int count) {   
  48.             Log.i("onTextChanged", s.toString());               
  49.         }   
  50.            
  51.         @Override  
  52.         public void beforeTextChanged(CharSequence s, int start, int count,   
  53.                 int after) {   
  54.             Log.i("beforeTextChanged", s.toString());           
  55.         }   
  56.            
  57.         @Override  
  58.         public void afterTextChanged(Editable s) {   
  59.             Log.i("afterTextChanged", s.toString());    
  60.         }   
  61.     };     
  62. }  
TextWatcher안에 있는 onTextChanged는 변경된 텍스트에 대한 결과를 beforeTextChanged는 변경되기 전에 입력 되었던 텍스트에 대한 내용을 afterTextChanged는 텍스트가 변경이 되었을 때의 결과를 보여줘요
개발자분들에게 도움이 되시길 바라며
즐거운 시간 보내세요~