2011-02-28 6 views
0

나는 안드로이드에 아주 새로운 사람이다. 내 안드로이드 폰의 모바일 세부 정보를 삼성 갤럭시를 사용하는 서블릿 IM에 가져 오는 방법을 알려줄 수있는 사람이 없어. 브라우저를 사용하면 안된다. 내 안드로이드 응용 프로그램을 미리 도와주세요.모바일 내 서블릿에 대한 세부 사항

+0

전화 세부 정보 : http://stackoverflow.com/questions/3596722/how-to-get-the-android-phone-model-version-sdk-details –

답변

0

Build 클래스를 사용하면 장치 및 OS에 대한 정보를 얻을 수 있습니다.

업데이트 : 이 코드 단편을 참조하십시오.

// connect to the servlet 
String location = "http://www.foo.com/servlet/TestServlet"; 
URL testServlet = new URL(servletLocation); 
URLConnection servletConnection = testServlet.openConnection(); 

// inform the connection that we will send output and accept input 
servletConnection.setDoInput(true); 
servletConnection.setDoOutput(true); 

// Don't use a cached version of URL connection. 
servletConnection.setUseCaches (false); 
servletConnection.setDefaultUseCaches (false); 

// Specify the content type that we will send binary data 
servletConnection.setRequestProperty 
("Content-Type", "<insert favorite mime type>"); 

// get input and output streams on servlet 
. . . 

// send your data to the servlet 
. . . 

자세한 내용은 this article을 참조하십시오. 필요에 따라 변경하십시오.

+0

대단히 감사합니다. 예제 또는 샘플 프로그램을 제공하면 충분합니다. –

+0

@harry 대단히 감사합니다. 링크를 확인해 보았습니다.하지만 어떻게 cani가 서블릿에 세부 정보를 보내면 저를 도와 주시겠습니까? –

+0

@rahul the great : 업데이트 된 답변을 참조하십시오. – Mudassir

관련 문제