1

i make Android application that can communicate to bluetooth printer for printing some text, now i want to call that android function that i made printText() from my phonegap html file.. has anyone know how to do that?? thanks.. :)

here's my code:

private void printText() {
        EditText EditText1;
        EditText1=(EditText)findViewById(R.id.editText1);
        String temp;
        try {           
            mPrinter.reset();  
            mPrinter.printTaggedText(EditText1.getText().toString());           
            mPrinter.feedPaper(110);
        } catch (IOException e) {
            error(R.drawable.text, getString(R.string.failed_print_text) + ". " + 
                    e.getMessage());            
        }
    }

and here's my HTML file:

 <HTML>
    <BODY>
        <!-- What Should i Do?? -->
    </BODY>
</HTML>

1 Answer 1

2

You'll want to create a plugin in order to do this:

http://wiki.phonegap.com/w/page/36753494/How%20to%20Create%20a%20PhoneGap%20Plugin%20for%20Android

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.