2016-07-26 2 views
-1

안녕 내가 그것을 인쇄 데이터를 전송하고 싶었 POS (판매 시점) 의 응용 프로그램은 내가이 솔루션 https://play.google.com/store/apps/details?id=com.fidelier.posprinterdriver 을 발견 블루투스 프린터 를 통해 인쇄 할 필요가 자사의 드라이버에 나를 도울 수 내 프린터 위해 그들은 어느 한이 안드로이드 응용 프로그램

+### Print from your Android App (interactive user action) 
+ 
+Create your ESC data using the helpers Create an Android Intent using Add your ESC data as a “Data” extra Start the intent. 
+You can be printing in minutes with just a couple lines of code. It's as simple as creating your intent, adding your ESC formatted string and start the (service) intent. 
+ 
+Example: 
+ 
+```java 
+ 
+String dataToPrint="$big$This is a printer test$intro$posprinterdriver.com$intro$$intro$$cut$$intro$"; 
+ 
+Intent intentPrint = new Intent(); 
+ 
+intentPrint.setAction(Intent.ACTION_SEND); 
+intentPrint.putExtra(Intent.EXTRA_TEXT, dataToPrint); 
+intentPrint.setType("text/plain"); 
+ 
+this.startActivity(intentPrint); 
+ 
+``` 

어떤 몸이 내가 그렇게 할 수있는 방법을 말해 줄 수 있다고 ??? 이 코드를 어디에 넣어야합니까? ?

+0

당신은 단지 여분의 텍스트와 함께이 명시 적 의도를 보낼 필요가 ... 그래서 당신은 인쇄를 시작하고자하는이 코드를 삽입 ... – AxelH

답변

0

는이 방법에 버튼 링크 활동이 있다고 가정하자 :이 버튼을 클릭하면

public void click(View v){ 
    Intent intentPrint = new Intent(); 

    intentPrint.setAction(Intent.ACTION_SEND); 
    intentPrint.putExtra(Intent.EXTRA_TEXT, "Just some dummy text to print"); 
    intentPrint.setType("text/plain"); 

    this.startActivity(intentPrint); 
} 

을, 의도가 시작됩니다, 이것은 아마도 이런 종류를 처리 할 수있는 응용 프로그램의 목록이 열립니다 의도 (ACTION_SEND)가 올바른 것을 선택하면됩니다.

+0

내가 당신에게 내가 당신에게 응용 프로그램을 도울 수 있습니까? –

+0

http://decompile-storage.s3.amazonaws.com/complete/711989/967ed1f1805b1796c3f750cced8a98cb/source.zip –

+0

여기에 소스 파일이 있습니다 –

관련 문제