2012-06-03 3 views
0

나는 다음 코드J2ME 폴란드어 snapshotscreen

 snapShotScreen = new SnapshotScreen("Snapshot"); 
     snapShotScreen.addCommand(cmdBack); 
     snapShotScreen.addCommand(cmdCapture); 
     snapShotScreen.setCommandListener(new ThreadedCommandListener(this)); 
     this.display.setCurrent(snapShotScreen); 

이미지를 캡처하는 휴대 전화의 카메라를 사용하는 것을 시도하고 그리고 난, 널 (NULL) 값이 리턴 얻을. 내 대상 장치가 mmapi 기능을 가지고 노키아/2700_classic, 나는 아직도 작동하지 않는 이유를 이해하지 않습니다. 누구든지 어떤 제안이 있습니까? 참고로

+0

해결책을 찾았 으면 스냅 샷 화면에 다음과 같이 스타일을 첨부해야합니다. // # style snapshotScreen snapShotScreen = new SnapshotScreen ("Snapshot"); – jade

답변

0

,

안드로이드 카메라가 작동하려면, 당신은 MidletBridge.java 파일을 편집해야합니다. 이 파일을 당신은 발견 할 것이다 :

J2ME-Polish_Root \ j2mepolish-의 src \의 J2ME \ SRC \ \ 충분한 \ 폴란드어 \ 안드로이드 \ 미들 릿의 \의 MidletBridge.java 드

당신은 일반 안드로이드 카메라 코드를 추가해야합니다 aswell 당신이 사진을 촬영 한 후 데이터를 retreive에 공개 바이트 []로합니다 (MidletBridge 활동 내에서) 두 가지 방법으로 저장하고 바이트 [] 이미지를 설정 클릭 :

MidletBridge.java file: 

public byte[] imagebytearray = null; 

public void startCameraIntent(){ 
     Intent i = new Intent("android.media.action.IMAGE_CAPTURE"); 
     startActivityForResult(intent, 10121); 
} 

@Override 
public void onActivityResult(int requestCode, int resultCode, Intent data) { 
     super.onActivityResult(requestCode, resultCode, data); 
     switch (requestCode) { 
      case 10121: 
       imagebytearray = (byte[]) data.getExtras().get("data"); 
       break; 
     } 
} 

이 작업을 완료 한 후, J2ME 폴란드어 응용 프로그램에서 MidletBridge를 인스턴스화해야합니다 (

).
de.enough.polish.android.midlet.MidletBridge m = new de.enough.polish.android.midlet.MidletBridge(); 
m.startCameraIntent(); 
//I couldnt remember if the code continues here after you have taken the picture 
byte[] img = m.imagebytearray; 
//If the code doesnt pause here, you can just use a button to retreive the image or store the 
//image within the RMSStorage -- need some more code for that -- and then retreive it that way. 

나는 이것이 여기까지 오는데 수 주일이 걸린 것처럼 누군가에게 도움이되기를 바랍니다. 내 응용 프로그램이 잘 작동하고 판매되었습니다. 소스 코드를 잃어 버렸습니다. 그렇지 않으면 J2ME- 폴란드 사용자 모두가 매우 행복했을 것입니다. Blackberry, nokia, android 및 windows ce와 함께 작업했습니다.

BTW .. 그 당시 J2ME- 폴란드 인에게 코드 전체를 보냈는데 코드를 게시 한 것처럼 보이지 않습니다. 네가 정말로 모든 근원을 원한다면 ... 가서 그들을 귀찮게해라.