Skip to main content

Printing custom html from android app using PrinterShare



I am printing a custom html from my app using PrinterShare .





The reason why I'm using html is because, I'm changing the contents of the html by passing name value pairs through a query string. My html file is pretty simple and I have stored it under asset. When I try to access it as:







Intent i = new Intent(Intent.ACTION_VIEW);

i.setPackage("com.dynamixsoftware.printershare.amazon");

Uri printFileUri= Uri.parse("file:///android_asset/receipt-voucher.html?shopName=BTMShop&date=20/12/2007&serial=1121");

i.setDataAndType(printFileUri,"text/html");

startActivity(i);







The PrinterShare app is giving the web page unavailable error. So for testing purpose I created a text file under assest flder and tried to access it as-





Uri printFileUri= Uri.parse("file:///android_asset/test.txt");





and changed the data and type.





But even for the text file, I'm getting the error: No such file or directory from PrinterShare.





I have made the necessary additions in Manifest file.





Any idea?


Comments

Popular posts from this blog

Slow Android emulator

I have a 2.67 GHz Celeron processor, 1.21 GB of RAM on a x86 Windows XP Professional machine. My understanding is that the Android emulator should start fairly quickly on such a machine, but for me it does not. I have followed all instructions in setting up the IDE, SDKs, JDKs and such and have had some success in staring the emulator quickly but is very particulary. How can I, if possible, fix this problem?