I'm trying to read a dicom file using the instructions given in "Adding Imebra to your Intellij Idea" and am facing issues with the same.
The exact code snippet where am facing the issue is this:
Stream stream = new Stream();
stream.openFileRead("/sdcard/Download/87FDH4G2.dcm");
The error I get is that the stream cannot be opened. I believe the error is due to the non-availability of 87FDH4G2.dcm file on my machine.
My question is where should the location of 87FDH4G2.dcm file be on my machine?
I am confused with this part: /sdcard/Download/87FDH4G2.dcm
The reason why you have such a problem is simple. You do not have "87FDH4G2.dcm" file on your Android device or emulator (Android Virtual Device). Using Android Device Monitor you can browse files and check if you saved a DICOM image in correct directory.
Related
I want to open XLS,DOC, and PPT files inside android application using android studio without using any external app , this app should works in offline mode.
I searched a lot on internet. but did't get any solution for that.
With BluetoothChat sample from Google sources as the base, what are the steps in implementing a file transfer function using that base code? I am trying to send a pdf or an image file (jpeg, jpg, png) to the other devices.
The chat functionality already works and I'm trying to implement a file transfer.
I can get the Uri and real file path (using PickIt library, ex path: storage/0/emulated/etc/etc) of the file that the user picked from the ACTION_GET_DOCUMENT intent. For the image file, I have found sources. They first convert it to a bitmap then to bytes and vice versa on the receiving device but haven't tried to do that yet. As for the pdf file, how would I implement it? I'm confused and questions similar to mine are mostly 7-10 years ago. Any help is appreciated. TIA!
P.S. I'm still new to Android development and I'm using Java.
I have a PDF file, when I open it on my computer (Linux) the Images in the PDF file is displayed properly(Its sharp)
But when I copy the same PDF from the computer to Android device and opened it there using Adobe Reader,
It looks like as following,
What can be the reason for this image distortion. What is the difference in opening this in computer and Android?
Any suggestions can lead me to a better search.
Adobe is the issue, If opened from any other viewer it works
I am trying to follow the link below for the code for a Image viewing app in android.
android image "viewer" app
But I am getting an error with the r.raw.image1. (also on raw.image2 and image3). I have saved the images in the asset folder. Error says raw cannot be resolved or is not a field. I have checked various documentations for this but am unable to understand what i am doing wrong. The code is exactly the same as in the above link.
Try to save your image into res/raw folder.
I'm using the library QoppaPdf which is very good.
But there aren't much help on the net.
My problem is, that on Eclipse and with emulator, my pdf opens whitout issue, but when i transfer the .apk on my device and that i try , my pdf opens oddly.
I put two picture , one with emulator and other with device, to better understand my problem.
Screenshot of my emulator
image on emulator
Screenshot of my device
image my device
So i don't understand why my app do it..
Thank for your answer
I found how to resolve my problem !
After many search on the net and doc android ,
i simply add : android:hardwareAccelerated="false" in the AndroidManifest.xml .
You can put it in the or in the .
I hope that i help other people.
Bye !
Regarding gvsharma's question about the ExceptionInitializationError, the answer can be found in another Stackoverflow post: Qoppa PDF Android NullPointer.
You need to add the following code before making any calls to the qPDF Toolkit:
//this static allows the sdk to access font assets,
//it must be set prior to utilizing libraries
StandardFontTF.mAssetMgr = getAssets();