Bluetooth and WIFI Printing for Android
Starting with Android 4.4 you can print documents from a device to a hardware printer via wifi.
Android apps can now print any type of content over Wi-Fi or cloud-hosted services such as Google Cloud Print. In print-enabled apps, users can discover available printers, change paper sizes, choose specific pages to print, and print almost any kind of document, image, or file.
A brief example of how to start the printing process:
private void doPrint() {
PrintManager printManager = (PrintManager) getActivity().getSystemService(Context.PRINT_SERVICE);
printManager.print("My document", new CustomPrintDocumentAdapter(getActivity()), null);
}
where CustomPrintDocumentAdapter extends PrintDocumentAdapter.
More information is available on Android Developers.
How to connect a mobile and a printer via WIFI to print a text file in android?
ther is no api provided by google (<19, thanks to @KaranJ), so third part solutions have to be done, eg:
http://www.printershare.com/help-android-integration.sdf
https://developers.google.com/cloud-print/docs/android
a standalone solution would be very difficult! :/
you could use an alert dialog builder, to guide the user to the google playstore, for installing something like printshare or google cloud print.
EDIT
also the content should be laid out to be ready for printing, more here:
http://developer.android.com/reference/android/print/PrintManager.html
http://developer.android.com/training/printing/custom-docs.html
Related Topics
How to Create Colorstatelist Programmatically
Detect 7 Inch and 10 Inch Tablet Programmatically
Duplicate Files Copied (Android Studio 0.4.0)
Android Viewmodel Additional Arguments
Disable Orange Outline Highlight on Focus
How to Get a Dialog Style Activity Window to Fill the Screen
How to Measure Height, Width and Distance of Object Using Camera
Recyclerview Changing Items During Scroll
How to Display a List of Images in a Listview in Android
Can't Include C++ Headers Like Vector in Android Ndk
How to Add New Column to Android SQLite Database
Android + Pair Devices via Bluetooth Programmatically
Android: Remove All the Previous Activities from the Back Stack
Slide a Layout Up from Bottom of Screen
How to Set Android_Sdk_Home Environment Variable
Clicking Hamburger Icon on Toolbar Does Not Open Navigation Drawer